
On 2004-10-07, J. Garrett Morris
I can run both of those without a problem - could you post more of your code? It's probably somewhere else. /gXm
You're right; I must have goofed somewhere. But I don't have real code yet, since I can't figure out the basic way of doing things. Here was my latest attempt: getOrSet :: Maybe Int -> State Int Int getOrSet m = case m of Nothing -> do n <- get return n Just x -> do put x return x But it doesn't seem to really be useful. When I try execState/evalState, it just return my argument when I call it with Nothing, or the thing passed to Just when I call it with that.