
3 Dec
2009
3 Dec
'09
6:34 a.m.
Duncan Coutts
Nice.
I agree this is needed (or rather, would be nice to standardise). Although I don't care for the cutesy naming suggested in the 'Train' datatype, failable-list could be made more general. Why is there a specific constructor 'Done', instead of just allowing the user to select a value of type 'e' (using 'Maybe b' if nothing else works)? Perhaps we could also consider an infix notation, like: data TerminatedList a e = Then a (TerminatedList a e) | Finally e (So you could do e.g: 4 `Then` 5 `Then` 1 `Finally` "success!". Of course, you might prefer symbols instead.) -k -- If I haven't seen further, it is by standing in the footprints of giants