[Haskell] simulating dependent types; ghc/ghci discrepancy

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Wed Apr 14 17:58:55 EDT 2004

> data Show' = forall a . Show a => Show' a

The "forall a. Show a =>" context here has no effect on the 
representation; it merely constrains applications of the data 
constructor Show'.  Since you have to say

> print' :: Show' -> IO ()

anyway (thus providing the dictionary) there is no point in storing it.


> *DepTest> :t x
> x :: forall a. a

is indeed the type of x.

There was a thread about this in the café recently; see


--KW 8-)

More information about the Haskell mailing list