[Haskell-cafe] Grok Monad Transformers - some help needed

Steve Horne sh006d3592 at blueyonder.co.uk
Mon Jan 2 09:32:13 CET 2012


On 02/01/2012 06:12, Arseniy Alekseyev wrote:
>>   I don't know what to actually do with this after putting it in a *.lhs file.
> You can :load *.lhs into ghci the same way you load .hs-files.
I swear I tried this before, but now it suddenly works.

Must be the chaos of stupid random assumptions making me do stupid 
things - I go through this phase with anything new. I have no idea what 
I was doing to screw things up, but I'm pretty there's no conspiracy to 
drive me nuts. Though now I think of it... hmmm... I wonder...

The errors I was getting from GHC mostly referred to "the monomorphism 
restriction" - at least for test1 and test2. The errors for test3 were 
much longer and scarier.

I'll try to figure out what's different going from GHC to GHCi later - 
for the moment, I'm getting back to those transformers.

BTW - interesting how the signatures of test1 and test2 are reported - I 
hadn't realised monad transformers were relevant there. Of course it 
does seem a bit silly to implement both StateT and State when StateT can 
implement State for you.




More information about the Haskell-Cafe mailing list