[Haskell-beginners] mayBe stuck
byorgey at seas.upenn.edu
Fri Aug 6 08:38:56 EDT 2010
On Fri, Aug 06, 2010 at 11:15:52AM +0100, Colin Paul Adams wrote:
> >>>>> "Brent" == Brent Yorgey <byorgey at seas.upenn.edu> writes:
> >> Since Haskell allows programming with partial functions, you
> >> always have this burden at present.
> Brent> Yes. But that doesn't mean there isn't value in the
> Brent> discipline of avoiding them. The burden of making sure you
> Brent> never use fromJust (or head, or ...) is much lighter than the
> Brent> burden of proving that every such use is safe.
> The burden is knowing whether or not a function is partial. It's that or
> ... that is the problem. This isn't flagged anywhere.
That's a very good point. But it's the sort of thing you pick up
pretty quickly, I think. Here are some off the top of my head, for
beginners reading this who might not already know:
For a fuller list, take a look at the 'safe' package on Hackage ,
which also provides many different safe alternatives.
More information about the Beginners