minimal repro code is here:
class (Functor f, Functor g) <= MyClass f g
fff :: forall f g. MyClass f g => f ~> f
fff = map identity -- Err, No type class instance was found for Functor f
ggg :: forall f g. MyClass f g => g ~> g
ggg = map identity -- ok
-- swap definition order f <-> g
class (Functor g, Functor f) <= MyClass f g
fff :: forall f g. MyClass f g => f ~> f
fff = map identity -- ok
ggg :: forall f g. MyClass f g => g ~> g
ggg = map identity -- Err, No type class instance was found for Functor g
and other examples:
-- g is not `Apply`
class (Apply f, Functor g) <= MyClass f g
ffff :: forall f g a b. MyClass f g => f (a -> b) -> f a -> f b
ffff = apply -- ok
-- g implies `Apply`
class (Apply f, Applicative g) <= MyClass f g
ffff :: forall f g a b. MyClass f g => f (a -> b) -> f a -> f b
ffff = apply -- Err, No type class instance was found for Apply f
purs 0.12.0 on macOS High Sierra 10.13.6 and Windows 10 Pro 1803
minimal repro code is here:
and other examples:
purs 0.12.0 on macOS High Sierra 10.13.6 and Windows 10 Pro 1803