News for hackers. Stuff that matters.
Re:Haskell: The Bad Parts, part 2 (2020) by UncleMeat on Tuesday February 09, 2021 @10:23AM (#26078479)
"Partial function" is an overloaded term. In this context it means "a function which does not map its entire domain to an output". This means that there are some inputs which return "Bottom", which happily gets propagated through the system until it is needed as input to some function and then your application explodes.

The downside here is that rather than blowing up your application immediately upon a bug it blows up your application somewhere else depending on your logic.

This can be a useful thing. You can write powerful and elegant algorithms that avoid error management because the bottom values never actually get used. But most people aren't doing that and instead these are time bombs.

Re:Haskell: The Bad Parts, part 2 (2020) by cies on Tuesday February 09, 2021 @12:40PM (#26080351)
> This can be a useful thing. You can write powerful and elegant algorithms that avoid error management because the bottom values never actually get used.

Agreed. This would be with some escape hatch function, maybe even from Unsafe.

But having head in Prelude, without huge warning in the docs, without deprecation warnings, it just, well, not very Haskelly, I'd say.

Re:Haskell: The Bad Parts, part 2 (2020) by codesnik on Tuesday February 09, 2021 @12:09PM (#26079922)
when bottom is actually reached that point of evaluation, does haskell provide any indication on where it came from? stacktrace or something?