
24 Jun
2011
24 Jun
'11
10:50 p.m.
I'd like to carry around some state when rewriting. It seems like CheckingFuelMonad, etc. are set up to use with other monads but I can't get the types to agree. Using MTL I've managed to come up with these types:
newtype RewriteOnce a = R (State Bool a) deriving (Monad)
instance MonadState s (CheckingFuelMonad RewriteOnce) where get = undefined put = undefined
But I cannot write the definitions for get and put. Is this possible or am I misundersanding CheckingFuelMonad? Is there a better approach altogether? Thanks in advance for any help! Justin