Duncan Coutts <[email protected]> writes:
>> [1] http://hackage.haskell.org/package/failable-list
> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe