On 10/11/07, Dan Weston <[EMAIL PROTECTED]> wrote:
> 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.
>

newtype and data have different semantics: Haskell guarantees that an
A will have the exact same run-time representation as an Int, if A is
declared with the newtype as above. It doesn't guarantee that if you
use data instead of newtype. It may be that GHC compiles code in the
same way with either of your type declarations above, but that's an
implementation-dependent choice.

Cheers,
Tim

-- 
Tim Chevalier * catamorphism.org * Often in error, never in doubt
"in a recent future, this is past" -- James Keelaghan
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to