
2008/11/27 Simon Peyton-Jones
can you tell us about the most persuasive, fun application you've encountered, for type families or functional dependencies?
Hi, I certainly had fun with the Instant Insanity puzzle, in Monad.Reader issue 8: http://www.haskell.org/haskellwiki/User:ConradParker/InstantInsanity That was using functional dependencies. Then Pepe Iborra pasted a version of Instant Insanity with type families: http://hpaste.org/2689 Looking back at this, Manuel left the following comment: -- There is unfortunately, no simple way to print the normalised type. -- In fact, GHC goes to great length to show types with as little -- normalisation as possible to users. (Especially for error messages, -- that usually makes them much easier to understand.) However, with -- type families, I think we really ought to have a ghci command to -- specifically request a normalised type. I'll put that on my -- TODO list! -- For the moment, you can of course try forcing normalisation by -- triggering type errors; eg -- > :t solution :: Int (Does ghci now have a command for printing normalised types?) There are also links to haskell-cafe discussion and some other implementations (in C++ templates and D) to, um, compare: http://www.haskell.org/haskellwiki/User_talk:ConradParker/InstantInsanity cheers, Conrad.