News for hackers. Stuff that matters.
Re:Haskell: The Bad Parts, part 2 (2020) by the_af on Tuesday February 09, 2021 @03:11PM (#26081897)
The "right" way for division by zero is controversial, though maybe that would be a solution.

It's clearer for partial function "head :: [a] -> a", which takes the first of a list if it exists, and explodes without dignity if the list is empty (this is what makes head partial).

A proposal is "head :: [a] -> Maybe a", so head returns Nothing when the list is empty.

Re:Haskell: The Bad Parts, part 2 (2020) by cies on Wednesday February 10, 2021 @06:04AM (#26087721)