[Haskell-cafe] Small displeasure with associated type synonyms

Hugo Pacheco hpacheco at gmail.com
Thu Mar 6 13:08:00 EST 2008

I don't know if this is exactly what you were expecting as a dummy argument,
but I solve this kind of issues like this:

_L = undefined

class C a where
    type TT a
    val :: a -> TT a

instance C () where
    type TT () = ()
    val _ = ()

instance (C a, C b) => C (a, b) where
    type TT (a,b) = (TT a, TT b)
    val _ = (val (_L :: a),val (_L :: b))

Why normal unification (val :: TT a) does not work I can't say why, but this
kind of behavior is not solely for type families.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080306/ffd6559a/attachment.htm

More information about the Haskell-Cafe mailing list