
17 Jun
2016
17 Jun
'16
3:04 p.m.
Am 06/15/2016 um 07:10 PM schrieb Albert Y. C. Lai:
On 2016-06-15 11:54 AM, martin wrote:
Paticularly I am having difficulties with the *->* instances. E.g. why is the state "s" in the state monad the fixed type and the "a" the type parameter? When I am writing state code without the State monad the two look like equal candidates. Why not have "State a" monad, which threads an a-typed value and spits out states?
You mean like this?
newtype MyState a s = Mk {unMk :: a -> (s, a)}
No, I meant newtype MyState a s = Mk {unMk :: s -> (s, a)}