Hello list,
still playing with monads and states, I have the following question:
Given:
import Control.Monad.State.Lazy
data MyData = MyData { content :: String }
foobar :: State MyData String
foobar = do
gets content
Ok, that looks nice and tidy. But:
foobar2 :: State MyData ()
foobar2 = do
modify $ \x -> x { content = "hello haskell"}
...looks not so nice.
Exists there a way to write this cleaner without writing countless
"set_xyz" helper functions?
Michael
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe