A definition like
mergeLists :: Ord a => [a] -> [a] -> [a]
mergeLists [] = id
mergeLists l [] = l
mergeLists (x:xs) (y:ys) = if y < x
then y : mergeLists (x:xs) ys
else x : mergeLists xs (y:ys)
leads to the error
MergeLists.hs:3:1: error:
Equations for ‘mergeLists’ have different numbers of arguments
MergeLists.hs:3:1-18
MergeLists.hs:4:1-19
|
3 | mergeLists [] = id
| ^^^^^^^^^^^^^^^^^^...
With the line in question rewritten as mergeLists [] l = l
the error is gone.
Does Haskell prohibit the mixture of point-free and non-point-free clauses in a single function definition?