[Haskell-cafe] Newbie Question on type constructors

Ketil Malde ketil+haskell at ii.uib.no
Tue Nov 2 03:09:31 EST 2004


Ben Rudiak-Gould <Benjamin.Rudiak-Gould at cl.cam.ac.uk> writes:

> In particular, your notation with type signatures makes it totally
> unclear that Circle and Square have disjoint ranges; in fact it looks
> like they have the same range. 
  :
> The syntax that would have made the most sense to me would have been
> something like
>
>     data Shape =
>         forall x::Float. Circle x
>         forall x::Float. Square x
>
> with maybe a "+" or something joining the lines, though that might
> have done more harm than good.

Instead of +, perhaps we could use U (union) - we are talking about
sets of values after all.  And U is analogous to V (logical or, a
value in the union is either in one set or the other), and on or the
most common 'or' characters is, of course, the vertical bar, so
perhaps the current syntax makes sense after all? :-)

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list