
1 Oct
2010
1 Oct
'10
9:27 a.m.
Given the following code, that is accepted by GHC:
data Exist = forall a. Exist a
exist :: Exist exist = Exist undefined
What type has the 'undefined' ? So far I assumed that at runtime all objects have a concrete type. This seems not to be true. I can also write
data ExistList = forall a. ExistList [a]
exist :: ExistList exist = ExistList []
where I do not need an 'undefined'.