Hoopl: Combining CheckingFuelMonad with State?

Antoine Latter aslatter at gmail.com
Sat Jun 25 02:56:40 CEST 2011


Hi Justin, this message might be better on the haskell-cafe list (or
the excellent beginers list!).

When you tried to write the get/put implementations, what problems
were you running into?

Antoine

On Sat, Jun 25, 2011 at 7:50 AM, Justin Bailey <jgbailey at gmail.com> wrote:
> 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
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>



More information about the Glasgow-haskell-users mailing list