This does sound interesting. Can you provide (at least some of) the code?<br><br><div class="gmail_quote">On Sat, Feb 28, 2009 at 9:36 PM, Tom Poliquin <span dir="ltr"><<a href="mailto:poliquin@softcomp.com">poliquin@softcomp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I'm working on a project (in Haskell) and was<br>
given some old Java code to indicate the required<br>
functionality for a particular function. It's a page of<br>
nested (4 deep) if statements. (That's probably<br>
why they gave me the code, no one could<br>
describe it).<br>
<br>
I would normally convert this to an FSM,<br>
..... but this is Haskell!<br>
<br>
So,<br>
<br>
1) Is there a nice (canonical) way of eliminating<br>
nested evil in Haskell? I thought that perhaps making<br>
a tuple of all the if's conditions and patterm matching<br>
on them might make a bit more comprehensible.<br>
Likely there's a better way.<br>
<br>
2) If an FSM is appropriate is there a 'standard'<br>
Haskell FSM implementation?<br>
I looked around and could find very little. One<br>
paper talked about Arrows but that seems like a bit<br>
of overkill ..<br>
<br>
It actually seems like a fun problem .. if I<br>
had the time ..<br>
<br>
Any thoughts greatly appreciated!<br>
<br>
<br>
Tom<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>