
14 May
2017
14 May
'17
1:40 p.m.
Dear list On a class, we recently discussed the join function for a (State s) value (we where implementation Monad passing through Functor) join :: State s (State s a) -> State s a join outstate = State $ \s0 -> let (innerstate, s1) = runState outstate s0 in runState innerstate s1 On this, we eta-expand outstate to in a sense "pattern match" on what we know about it. We were thinking on the cost of the extra wrapping we do here for this "pattern matching". Because eta-expanding is one a of the 3 primitive operations on lambda calculus, we concluded it should be free (modulo presence of seq). Is this true on ghc? -- -- Ruben