
11 Oct
2007
11 Oct
'07
9:32 p.m.
I presume that the two statements below are equivalent [1]: newtype A = MkA Int data A = MkA !Int So does Haskell' still need newtype? It seems like a needless keyword. ---------- [1] I ran ghc -c -fglasgow-exts -O -ddump-simpl and renamed identifiers to match, then did a diff, resulting in identical Tidy Core except for an explicit (inlined) reification function unused elsewhere: Main.$WMkA :: GHC.Base.Int -> Main.A [DataConWrapper] [Arity 1 NoCafRefs Str: DmdType Sm] Main.$WMkA = __inline_me (\ (tpl_A1 :: GHC.Base.Int) -> case tpl_A1 of tpl1_A1 { __DEFAULT -> Main.MkA tpl1_A1 }) which I take to mean simply: Main.$WMkA = Main.MkA