[Haskell-cafe] typeclass question

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Thu Sep 11 06:24:32 EDT 2008


> | class ToRenderable a b where
> |   toRenderable :: a -> Renderable b
> 
> But the above is, I think, too general for my needs. I don't want
> to be able to generate Renderables of different type b for a single input
> type a.

Sounds like a functional dependency (class ToReadable a b | a -> b )

> Also, MPTC take me out of the world of haskell 98, which I was trying
> to avoid. 

Why. "Everyone does it",
and MPTC will be in Haskell-Prime  (but FD may be not)
http://hackage.haskell.org/trac/haskell-prime/wiki/MultiParamTypeClassesDilemma

J.W.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080911/57b3d245/signature.bin


More information about the Haskell-Cafe mailing list