Haskell platform proposal: split package

Twan van Laarhoven twanvl at gmail.com
Sat Jul 21 14:30:10 CEST 2012


On 2012-07-21 02:34, Brent Yorgey wrote:
> You are right, actually, only ExistentialQuantification is necessary,
> as long as we also stop using GADT syntax.  I didn't realize before
> that this syntax is accepted:
>
>    {-# LANGUAGE ExistentialQuantification #-}
>
>    data Delimiter a =         DelimEltPred (a -> Bool)
> 		   | Eq a => DelimSublist [a]
>

Would the following type work?

     data Delimiter a
         = DelimEltPred (a -> Bool)
         | DelimSublistPred [a -> Bool]

You can go from the current DelimSublist to DelimSublistPred with just `map 
(==)`. And is the distinction between the DelimEltPred and DelimSublistPred then 
still needed at all?


Twan



More information about the Libraries mailing list