I'm trying to get a better understanding of monads. So I'm trying to write return, join, and bind implementations for several monads.
However when coming to two-kinded monads, I'm kind of confused
join :: m (m a) -> m a
m (m a) Implies monad wrapped inside of monad, but what value is implied if using two-kinded monads.
For example with the State Monad: s or a? What would the correct signature of join for the State Monad look like?
* -> *. - Rein Henrichstype Foo a b c dthen e.g.Foo Int Char Boolwould have kind* -> *and you could defineinstance Monad (Foo Int Char Bool). You can write types with redundant parens if you want, like:: (((Foo Int) Char) Bool) Baz- jberrymaninstance Monad State where ...sinceStatehas kind* -> * -> *. It isinstance Monad (State s) where ...- jberryman