Functor instance for Set?

Twan van Laarhoven twanvl at gmail.com
Thu Mar 1 13:20:33 CET 2012


On 01/03/12 09:31, Bas van Dijk wrote:
> class Functor f where
>      type FunctorConstraint f :: * ->  Constraint
>      type FunctorConstraint f = Empty
>
>      fmap :: (FunctorConstraint f b) =>  (a ->  b) ->  f a ->  f b
>
> class Empty a
> instance Empty a

Do you really need this Empty class? That seems inconvenient. I had 
hoped you would be able to write something like

     type FunctorConstraint f :: * ->  Constraint
     type FunctorConstraint f a = ()


Twan



More information about the Libraries mailing list