
10 Jan
2007
10 Jan
'07
1:45 p.m.
Wow! Now we are talking! Josef Svenningsson wrote:
So instead of: newtype State s a = State { runState :: (s -> (a, s)) } we have: newtype StateP p s a = StateP { runStateP :: (s -> p a s) } Now, instantiating this with different pair types with different strictness properties will give us total control over strictness for state and value.
Beautiful! Iavor Diatchki wrote:
The state transformer inherits its behavior from the underlying monad. For example: StateT Int IO is strict, but StateT Int Id is lazy.
Fantastic! I'm drooling. When can we get stuff like this into MTL? And maybe it is finally time for me to bite the bullet and try out monadLib again (is it still CPS? gulp). Now let's attack Data.* libraries... -Yitzchak