When reading the original Wadler Monads for Functional Programming paper (1992), I feel like I get it, but in the non-monadic description of the State handler, it shows a proto-monadic description of the state:
type M a = State -> (a, State) eval :: Term -> M Int eval (Con a) x = (a, x)
And that again ceased to make sense. How should I read this? As I understand it, this means that eval takes int and state and returns a function that takes state and returns a new pair (Int, State)
But ... like (a, x), which, if I read this right, is a tuple of value and state, is-a "that takes state and returns a new pair (Int, State)"?
source share