[Haskell-beginners] How to solve this using State Monad?

Henry Lockyer henry.lockyer at ntlworld.com
Thu May 31 18:23:08 CEST 2012


+ I think I already said it, but, in case it was not clear: Me too.
 Even as a participating person I feel helped!  ;-)
I just haven't taken it onboard yet and need that quiet free morning
to read more about it...

+ I think this is clearly identifying the point where the State monad(s) 
can become confusing at first, in my (limited) experience:
                                          "The problem of the state monad is a
very fundamental one.  As soon as your automaton is parametric it
becomes a function:

   dfaWith :: DfaInput -> State DfaState DfaOutput"

But I need more time to assimilate the following
"Functions in Haskell are opaque.  For every composition of automata you
would have to write an individual loop, because you would have to force
the two individual states to be combined somehow.  This gets more
inconvenient as your automaton library grows."

best/Henry
 
On 31 May 2012, at 16:46, Miguel Negrao wrote:

> 
> A 31/05/2012, às 16:25, Michael Alan Dorman escreveu:
> 
>> Ertugrul Söylemez <es at ertes.de> writes:
>>> I almost feel stupid writing these long explanations, just to see them
>>> getting ignored ultimately.  The automaton arrow is one of the most
>>> useful and most underappreciated concepts for state in Haskell.
>> 
>> While I'm not sure I have a need for it right now, I definitely haven't
>> ignored this exchange---I've read the individual emails, and a link to
>> the archive is filed away for future use.
>> 
>> So it's been very helpful, even if those being helped aren't
>> participating per se.
> 
> +1
> 
> Because of those posts I spent my morning reading about arrows which seems a quite interesting concept, although couldn’t yet see what is best for ( I would be curious to learn it in order to try out Yampa).  I have to say that the resources I found to learn about arrows on the net were a bit disorganized. This page is really well done  http://en.wikibooks.org/wiki/Haskell/Understanding_arrows but then because I don’t know much about parsers I couldn’t really progress through the second half.
> 
> best,
> Miguel Negrão
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners




More information about the Beginners mailing list