3 ms·
"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 som
by UncleMeat 6y ago
"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.
- codesnik 6y agowhen bottom is actually reached that point of evaluation, does haskell provide any indication on where it came from? stacktrace or something?
- cies 6y ago> 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.