[Haskell-cafe] Inheritance constraints
Miguel Mitrofanov
miguelimo38 at yandex.ru
Thu Jun 7 13:42:21 CEST 2012
Hi cafe!
The ConstraintKinds extension makes it possible to create classes of classes, like this:
class F c where cfmap :: c f => (a -> b) -> f a -> f b
instance F Functor where cfmap = fmap
instance F Monad where cfmap = liftM
So, basically we are saying that "c" is a class that has some special properties.
Is it possible to express the property "c is a subclass of a specific class d"? Like
class F c where Functor f => c f
More information about the Haskell-Cafe
mailing list