3 ms·
That only works because Haskell can't really express it. That is, if you could write Haskell code that checked that equality, that equality wouldn't be enough,
by tsimionescu 6y ago
That only works because Haskell can't really express it. That is, if you could write Haskell code that checked that equality, that equality wouldn't be enough, because you could write a function `mapStrange foo [x]` that is equal to `map` if `foo = id` and is something else otherwise.
But since you can't compare 2 functions for equality, and you can't compare two arbitrary values for equality, then yes - your informal requirement is enough togethet with the type to force the function to be `map`.