
On 1 March 2012 13:20, Twan van Laarhoven
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
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
In GHC-7.4.1 that will give the following error: Number of parameters must match family declaration; expected 1 In the type synonym instance default declaration for `FunctorConstraint' However, I believe SPJ fixed this in HEAD. Bas