git.iko.soy/rowtype-yoga/purescript-native
on aba280f help sign in
rowtype-yoga/purescript-native/examples/passing/UnifyInTypeInstanceLookup.purs
25 lines 370 B history raw
1module Main where
3import Control.Monad.Eff.Console (log)
5data Z = Z
6data S n = S n
8data T
9data F
11class EQ x y b
12instance eqT :: EQ x x T
13instance eqF :: EQ x y F
15test :: forall a b. (EQ a b T) => a -> b -> a
16test a _ = a
18spin :: forall a b. a -> b
19spin a = spin a
21-- Expected type:
22-- forall t. (EQ t (S Z) T) => t
23test1 = test (spin 1) (S Z)
25main = log "Done"