checkPermuを無くすと、内包表記の条件式を書いてないのと同じ動作になるので、checkPermuを追い出して、さらに自由度をあげてみた


allPattern 0 _ = [[]]
allPattern _ [] = [[]]
allPattern n ns = [x:xs | x <- ns, xs <- allPattern (n-1) ns]

permutations n xs = filter checkPermu $ allPattern n xs



各要素(リスト)から先頭要素が偶数のもののみ抽出

filter (\x -> (even.head) x) $ allPattern 3 [1..3]

各要素のリストが昇順になっているもののみ抽出

filter (\(x:y:z:[]) -> x <= y && y <= z) $ allPattern 3 [1..3]