1module Main where
2
3import Prelude
4import Effect.Console (log)
5
6class (Functor f, Functor g) <= Eg1 f g
7
8f1 :: forall f g. Eg1 f g => f ~> f
9f1 = map identity -- Err, No type class instance was found for Functor f
10
11g1 :: forall f g. Eg1 f g => g ~> g
12g1 = map identity -- ok
13
14
15class (Functor g, Functor f) <= Eg2 f g
16
17f2 :: forall f g. Eg2 f g => f ~> f
18f2 = map identity -- ok
19
20g2 :: forall f g. Eg2 f g => g ~> g
21g2 = map identity -- Err, No type class instance was found for Functor g
22
23
24main = log "Done"
25
26