import NatNum0 type NatFunc = [Natural] -> Natural o :: NatFunc o[] = 0 s :: NatFunc s [x] = x + 1 i :: Natural -> NatFunc i n ls = ls !! (fromNatural (n-1)) opS :: NatFunc -> [NatFunc] -> NatFunc opS f (g:gs) = \xs -> f $ smap (g:gs) xs where smap [] xs = [] smap (g:gs) xs = g(xs):(smap gs xs) opR :: NatFunc -> NatFunc -> NatFunc opR g h (n:xs) = r' n xs where r' :: Natural -> [Natural] -> Natural r' 0 ls = g ls r' t ls = h ((r' (t-1) ls):(t-1):ls) opM :: NatFunc -> NatFunc opM g = mu' g 0 where mu' g y xs = if (g (y:xs)) == 0 then y else mu' g (y+1) xs h = opS s [(i 1)] f = opR o h four = opS s [opS s [opS s [opS s [o]]]] o' = opR o (i 1) f1 = i 1 f2 = i 1 f3 = s f4 = opS f3 [f2] f5 = opR f1 f4