[Haskell-beginners] Question: Data Type for user selection

Ertugrul Soeylemez es at ertes.de
Tue Aug 16 16:44:15 CEST 2011


Brent Yorgey <byorgey at seas.upenn.edu> wrote:

> > That's a bit of a contradiction, because you are using existentials
> > yourself in your GADT.
>
> No, he isn't.
>
>    data BasicSelect a where
>      SelectionNum :: Num a => a -> BasicSelect a
>      SelectionStr :: Show a => a -> BasicSelect a
>
> 'a' shows up in the result type of both constructors, so there is no
> existential quantification going on here.

Oh, right.  How would one express this as an ADT?  Seems impossible to
me.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





More information about the Beginners mailing list