[Haskell-cafe] The State Monad
J. Garrett Morris
J.Garrett.Morris at Dartmouth.EDU
Thu Oct 7 19:03:48 EDT 2004
--- John Goerzen wrote:
tick :: Int -> State Int Int
tick newval = do put newval
return newval
Or this:
tick :: State Int Int
tick = do n <- get
return n
That is even more incomprehensible to me -- why would removing a line
before the return cause a type error?
--- end of quote ---
I can run both of those without a problem - could you post more of your code? It's probably somewhere else. /gXm
More information about the Haskell-Cafe
mailing list