[Haskell-beginners] comment on this debugging trick?
dennis.raddle at gmail.com
Fri Nov 27 20:51:02 UTC 2015
On Fri, Nov 27, 2015 at 10:31 AM, Jeffrey Brown <jeffbrown.the at gmail.com>
> Elliot Cameron, very smart guy, once advised me to make illegal state
> invalid. Jake Brownson, another, recommended trying to use Maybes and
> Eithers instead of throwing exceptions. I'm having trouble coming up with
> examples but I think they're both helpful.
I think I know roughly what you are talking about, but there are places
where unexpected input might result in something like an empty list.
Suppose I need the head of that list under normal conditions. Maybe the
list is produced by library code so I can't alter the data structures.
That's the kind of situation I want to identify precisely and immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners