h x y = x >>= (\x -> g x y)
or equivalently ( in context of the article )
h :: M Int -> M Int -> M Int
h x y = bind ( \x-> g x y ) x
where g is
g :: Int -> W Int -> W Int
g x y = y >>= (return . (+x))
for the monad:
data M a = M a deriving Show
Now I am a little confused, how can you put x in g if it takes an Int
as first parameter but x is M Int
?