
3 Feb
2012
3 Feb
'12
10:30 p.m.
On 3 February 2012 20:16, David Frey
http://www.haskell.org/haskellwiki/Case
That link shows how to write a select function that offers functionality similar to a switch statement in C. Then you could use guards for the top-level switching and the select function for the second level.
Yikes - that idiom is rather horrible, vis packing cases into a list so they can be consumed by a function. To solve the problem, I'd seek a more "mathy" description of the algorithm i.e. one that doesn't use conditionals so heavily and work from that rather than translate existing code.