[Haskell-cafe] Stuck on design problem

2013-05-20 Thread Nicolas Trangez
All, Since I'm stuck on a coding problem and can't figure out how to proceed, I decided to call for help. I'm unable to get some code to typecheck, so maybe I'm missing something obvious on the implementation side, or more likely the design is completely wrong. Here's the idea: I have some code

Re: [Haskell-cafe] Stuck on design problem

2013-05-20 Thread Miguel Mitrofanov
:t runMemLog (runTransitionT $ demo 1) runMemLog (runTransitionT $ demo 1) :: MonadLog (MemLog a) () = Log a - ((), [Command ()]) That means, that foo, if you manage to compile it, would have type MonadLog (MemLog a) () = ((), [Command ()]). That means that in each call for foo it would be

Re: [Haskell-cafe] Stuck on design problem

2013-05-20 Thread Adam Gundry
Hi Nicolas, Your design doesn't look too unreasonable, though I haven't looked at in detail. I do have a quick observation regarding the implementation that I hope might help. Your gist defines class MonadLog m a where getEntry :: Index - m (Entry a) instance MonadLog (MemLog a) a and

Re: [Haskell-cafe] Stuck on design problem

2013-05-20 Thread Nicolas Trangez
Miguel, On Mon, 2013-05-20 at 16:38 +0400, Miguel Mitrofanov wrote: :t runMemLog (runTransitionT $ demo 1) runMemLog (runTransitionT $ demo 1) :: MonadLog (MemLog a) () = Log a - ((), [Command ()]) That means, that foo, if you manage to compile it, would have type MonadLog (MemLog a) ()

Re: [Haskell-cafe] Stuck on design problem

2013-05-20 Thread Nicolas Trangez
Adam, On Mon, 2013-05-20 at 13:37 +0100, Adam Gundry wrote: Hi Nicolas, Your design doesn't look too unreasonable, though I haven't looked at in detail. I do have a quick observation regarding the implementation that I hope might help. Your gist defines class MonadLog m a where