これでもエラーが発生する理由を誰かが知っていますか?
main = do
print $ check [4,3,2] 0 1
-- output expected [3,4,2], means just once check and swap not more
check ( modXs, []) _ _ = modXs
check ( modXs, [x]) _ _ = x : modXs
check ( modXs, (x1:x2:xs)) counter limit
| x1 > x2 && counter < limit = x2:check (x1 : xs) (counter+1) limit
| otherwise = x1 : check (x2 : xs) counter limit
ここのエラーメッセージは、私がそれを理解していないタイプについて何かを言っています:
Couldn't match expected type `([a1], [a1])' with actual type `[a1]'
In the first argument of `check', namely `(x1 : xs)'
In the second argument of `(:)', namely
`check (x1 : xs) (counter + 1) limit'
In the expression: x2 : check (x1 : xs) (counter + 1) limit