|
|
|
|
|
by yakubin
988 days ago
|
|
In cases when head is used though, you clearly just want to unpack the first element of a list. So if you replace head with a function that returns a Maybe, all you’re going to do is pattern match on its result to check if it’s a Just. So I don’t see a benefit over matching x::_ against the list straight away. (I do see how a function like that is useful, but I don’t think it’s a good replacement for head.) |
|
Something is eventually going to pattern match on it. But it might well be some handler way way up at the top of my program, and all I want to do right now is `map` and `bind` as normal.