[Haskell-cafe] Re[2]: [Haskell] Proposal: unification of style of function/data/type/class definitions

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Sep 11 01:28:44 EDT 2006


Hello Taral,

Sunday, September 10, 2006, 9:45:33 PM, you wrote:

>> data Expr t           = If (Expr Bool) (Expr t) (Expr t)
>>      Expr Int         = Lit Int
>>      Expr Bool | Eq t = Eq (Expr t) (Expr t)

> I find this somewhat unreadable due to the implicit "t" parameter not
> showing up on the left-hand side...

if you mean last line, i tend to agree. i was just a little impulsive
and don't mentioned that we define existential here :)

it may look as

      Expr Bool = Eq (Expr t) (Expr t) | Eq t

Brian Hulley developed here an idea about implicit "forall"
declaration just before class restrictions involving this variable, so
it will be equivalent to:

      Expr Bool = Eq (Expr t) (Expr t) | forall t . Eq t

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list