At least with GHC 7.8, if you enable GADT support, then your typechecks code will do what you expect :
{-
as a result of:
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( foo.hs, interpreted ) Ok, modules loaded: Main. ฮปยป :i Identity data Identity a = Identity a
Cactus
source share