type equality symbol
Manuel M T Chakravarty
chak at cse.unsw.edu.au
Wed Dec 5 19:06:16 EST 2007
Simon Peyton-Jones:
> Nothing deep. Just that "=" means so many things that it seemed
> better to use a different notation.
>
Also, using "=" would have entailed significant changes to GHC's
parser. Type constraints are in the same syntactic category as types
and types can appear as part of expressions in type annotations (such
as "e::t") and on the lhs of let-bindings (such as "let x::t = e in
e'"). Especially, considering the later, imagine "t" can now also
contain the symbol "=" which in the grammar serves as a separator
between the lhs and the rhs of a let bindings.
I actually did try using "=", but it got too messy.
Manuel
> | -----Original Message-----
> | From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-bounces at haskell.org
> ] On Behalf Of
> | Isaac Dupree
> | Sent: 04 December 2007 15:59
> | To: Jan-Willem Maessen
> | Cc: Glasgow-haskell-users at haskell.org; Simon Peyton-Jones
> | Subject: type equality symbol
> |
> | >> conv :: (a~b) => a -> b
> | >> conv = id
> |
> | is there any particular reason that '~' is the symbol for type
> equality
> | constraints? I would think '=' would be the obvious choice,
> (although
> | perhaps it is already over-used, and is normally asymmetric in
> Haskell!)?
> |
> | Isaac
> | _______________________________________________
> | Glasgow-haskell-users mailing list
> | Glasgow-haskell-users at haskell.org
> | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
More information about the Glasgow-haskell-users
mailing list