Re:Grain: A strongly-typed functional programming language f...
by masklinn on Tuesday July 31, 2018 @11:17AM
(#17653844)
I think it's because they weren't very clear on how they wanted to handle partial functions / error reporting, and historically functions like head are partial.
Making them total makes them a bit heavier for the best case, and furthermore can seem unnecessary (as you could just pattern-match the list itself).
You can also see this oddity in Haskell allowing non-exhaustive case, and allowing refutable patterns in bindings.
Making them total makes them a bit heavier for the best case, and furthermore can seem unnecessary (as you could just pattern-match the list itself).
You can also see this oddity in Haskell allowing non-exhaustive case, and allowing refutable patterns in bindings.