*Main> :k [] [] :: * -> * *Main> :k State State :: * -> * -> * *Main> :k State Int State Int :: * -> * *Main> :r [1 of 1] Compiling Main ( lec11.hs, interpreted ) lec11.hs:24:18: error: • Couldn't match expected type ‘(b, s)’ with actual type ‘State s b’ • In the expression: f y In the expression: let (y, s) = g x in f y In the first argument of ‘S’, namely ‘(\ x -> let (y, s) = g x in f y)’ • Relevant bindings include s :: s (bound at lec11.hs:23:23) x :: s (bound at lec11.hs:23:10) f :: a -> State s b (bound at lec11.hs:22:15) g :: s -> (a, s) (bound at lec11.hs:22:12) (>>=) :: State s a -> (a -> State s b) -> State s b (bound at lec11.hs:22:3) | 24 | in f y | ^^^ Failed, no modules loaded. *Main> :t () () :: () *Main> runState 0 (label tree1) (Node 0 (Node 1 (Leaf 2) (Leaf 3)) (Node 4 (Leaf 5) (Leaf 6)),7) *Main> runState 7 (label tree1) (Node 7 (Node 8 (Leaf 9) (Leaf 10)) (Node 11 (Leaf 12) (Leaf 13)),14) *Main> runState 7 (label tree1) (Node 7 (Node 8 (Leaf 9) (Leaf 10)) (Node 11 (Leaf 12) (Leaf 13)),14)