
1 Aug
2017
1 Aug
'17
7:16 p.m.
Ahoy Haskellers, In the section "Getting and Setting State" (http://learnyouahaskell.com/for-a-few-monads-more#state) in LYH get is defined as get = state $ \s -> (s, s) How does does get determine the type s, is considering that it has no argument as per the definition given above? Or is the definition written in some sort of point-free notation where an argument has been dropped? I find the line stackNow <- get in the the function(?) stackyStack confusing for the same reason. I guess my difficulty is that state $ \s ->(s , s) has a generic type (s) whereas the stackyStack has a concrete type. Is the type of s determined from the type of the stateful computation/do notation? Regards, - Olumide