Doing this in psci
:
> filter (\[a,b] -> a > 1) [[1,2],[3,4]]
results in a compile error:
A case expression could not be determined to cover all inputs.
due to [a,b]
possibly failing to match, which makes sense.
I know I can do this:
> :p
… let f [a, b] = a > 1
… f _ = false
…
> filter f [[1,2],[3,4]]
[[3,4]]
but this is quite long for doing simple filters in psci
repl. Is there a solution that involves less typing (including not using Array
, etc.)?