[Haskell-cafe] Type vs TypeClass duality

TJ tjay.dreaming at gmail.com
Tue Oct 23 23:00:14 EDT 2007

Tristan Allwood:

Very cool. I don't understand some (a lot of) parts though:

> instance Show a => Reify (ShowConstraint a) where
>   reify = ShowC

ShowC has type "(Show a) => ShowConstraint a", whereas reify is
supposed to have type "ShowConstraint a".

> data SingleList (a :: * -> *) where
>   Cons :: (a b) -> b -> SingleList a -> SingleList a
>   Nil :: SingleList a

Cons has a type variable "b" in its signature, but no forall. I
suppose it comes from the * -> * in SingleList's type?

That's all I can come up with for now. A great deal of high level
coding flying around above my head now.



More information about the Haskell-Cafe mailing list