package FunctorCrash where class Functor f where map :: (a -> b) -> f a -> f b interface Bar at bt = a :: at b :: bt type Foo t = Bar t t foo :: t -> t -> Foo t foo a b = Foo { a = a; b = b; } instance Functor Foo where map f x = foo (f x.a) (f x.b)