[Haskell-cafe] Polymorphic (typeclass) values in a list?

Kalman Noel kalman.noel at bluebottle.com
Fri Oct 19 13:58:42 EDT 2007


Jules Bean wrote:
> This looks very very much clearer in GADT syntax, since in GADT syntax 
> you always give constructors explicit types:
> 
> type ExistsNumber where
>    Number :: forall a . Num a => ExistsNumber a

The questions in response to my post have been answered already; I'd like to
mention, though, the two typos in your example, which should read instead:

    data ExistsNumber where
        Number :: forall a. Num a => a -> ExistsNumber

Kalman


More information about the Haskell-Cafe mailing list