[Haskell-beginners] Finite State Machine ..

Andrew Wagner wagner.andrew at gmail.com
Sat Feb 28 22:17:36 EST 2009


This does sound interesting. Can you provide (at least some of) the code?

On Sat, Feb 28, 2009 at 9:36 PM, Tom Poliquin <poliquin at softcomp.com> wrote:

>
> I'm working on a project (in Haskell) and was
> given some old Java code to indicate the required
> functionality for a particular function. It's a page of
> nested (4 deep) if statements. (That's probably
> why they gave me the code, no one could
> describe it).
>
> I would normally convert this to an FSM,
> ..... but this is Haskell!
>
> So,
>
> 1) Is there a nice (canonical) way of eliminating
>  nested evil in Haskell?  I thought that perhaps making
>  a tuple of all the if's conditions and patterm matching
>  on them might make a bit more comprehensible.
>  Likely there's a better way.
>
> 2) If an FSM is appropriate is there a 'standard'
>  Haskell  FSM implementation?
>  I looked around and could find very little. One
>  paper talked about Arrows but that seems like a bit
>  of overkill ..
>
> It actually seems like a fun problem  .. if I
> had the time ..
>
> Any thoughts greatly appreciated!
>
>
> Tom
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090228/4b918e51/attachment.htm


More information about the Beginners mailing list