Constructors in GHC (fwd)

Hal Daume III [email protected]
Wed, 11 Dec 2002 08:36:05 -0800 (PST)


...this seemed not to make it to the mailing list ([email protected]
isn't valid)...

--
Hal Daume III

 "Computer science is no more about computers    | [email protected]
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

---------- Forwarded message ----------
Date: Wed, 11 Dec 2002 08:33:50 -0800 (PST)
From: Hal Daume III <[email protected]>
To: Simon Peyton-Jones <[email protected]>
Cc: [email protected], Kirsten Chevalier <[email protected]>
Subject: Re: Constructors in GHC

Hi,

It finally makes sense now :)

> We could make this more consistent in two ways.  Alternative (A): One
> way would be to make it clearer that $wMkT was the real constructor:
> 
> 	data T = $wMkT Int Int
> 	MkT p = case p of (x,y) -> $wMkT x y
> 	f x y = $wMkT x y
> 	g t = case t of $wMkT x y -> x
> 
> Alternative (B): The other alternative would be to make the original
> Haskell constructors into the $w things:
> 
> 	data T = MkT Int Int
> 	$wMkT p = case p of (x,y) -> MkT x y
> 	f x y = MkT x y
> 	g t = case t of MkT x y -> x

As someone using external core, I can resoundly say: I don't really care
:).  I would probably prefer (B), as you seem to, but it's not a strong
preference.