Re:Lisp and Haskell (2015)
by dunefox on Thursday October 08, 2020 @10:36AM
(#24719427)
`Either` would be much better, no?
[ Parent
| on HN ]
No, because `Either` is a `Foldable`, too.
I know, not what you meant. But a custom sum type would not only allow you to return multiple different failure cases, you also wouldn't give it a `Foldable` instance with surprising semantics.
Plain old data types are seriously underrated these days.