« first day (139 days earlier)      last day (1824 days later) » 

BMO
2:31 PM
!!/type mapM
 
@BMO Monad m => (a1 -> m a2) -> [a1] -> m [a2]
@BMO (Monad m, Traversable t) => (a -> m b) -> t a -> m (t b)
 
BMO
@Potato44: \f xs -> sequence $ map f xs is the same as mapM and equivalently with sequence_ and mapM_. So you could just use interpret' = mapM_ step ;)
And do you really dislike syntactic sugar or is there another reason you use StateT $ \tape -> return ((), f tape) over modify f?
Apart from the Control.Monad.State implementation itself I don't think I've ever seen this notation being used.
 
 
5 hours later…
7:19 PM
@BMO It felt funny, but I couldn't think of the name of the function that does that.
 
 
2 hours later…
BMO
9:17 PM
Well, it's correct and probably the right way to think about state monads :)
But I imagine it would get quite tedious, I'll stay with modify, get and put (or lenses ;P)
Oh, I see you changed it.. It's much more readable now.
 
 
2 hours later…
11:34 PM
@BMO I meant what I was doing before didn't feel right, I forgot about modify, and get & put...
 

« first day (139 days earlier)      last day (1824 days later) »