On Tue, May 11, 2010 at 2:01 PM, Gordon J.
Uszkay
<uszkaygj@mcmaster.ca> wrote:
I would like to build a
class that includes a method to move data from one arbitrary functor to
another, a natural transformation. The structures might be more than
just functors, but I can start with that. I ran into some practical
issues with resolving the type variables for my multiparameter type
class, which I can resolve with functional dependencies. I can also
not isolate the natural transformation from my overall operation,
muddling it with the element transformation. I was wondering if anyone
had any words of advice, example or warning about this kind of function
or method in general?
Class (Functor f, Functor g) => Foo f g a where
foo :: f a -> g a
bar :: (a->b) -> g a -> g b