On 8 February 2011 23:25, John Lato <[email protected]> wrote: >> class Container c where >> type Elem c :: * >> >> class (Container cIn, Container cOut) => CMap cIn cOut where >> cmap :: (Elem cIn -> Elem cOut) -> cIn -> cOut >> >> instance (a ~ Elem (c a), b ~ Elem (c b), Functor c, Container (c a), >> Container (c b)) => CMap (c a) (c b) where >> cmap = fmap
I'm not sure if that will work for types like Set, as you're not explicitly bringing the constraint in. -- Ivan Lazar Miljenovic [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
