This problem explores the definition of higher-order functions on lists.
Use function insert, in order to define function insertionSort :: (Int -> Int -> Bool) -> [Int] -> [Int] that orders a list according to the given relation.
Scoring
Each item scores 20 points.
Input
countIf (>5) [1..10] pam [1,2,3] [(+1),(*2),(^2)] pam2 [1,2,3] [(+1),(*2),(^2)] filterFoldl even (*) 1 [4,7,2,4,9,3] insert (<) [1,4,6,9,12] 8 insertionSort (>) [4,5,2,3,1,3]
Output
5 [[2,3,4],[2,4,6],[1,4,9]] [[2,2,1],[3,4,4],[4,6,9]] 32 [1,4,6,8,9,12] [5,4,3,3,2,1]