I wrote the following
split function. It takes a
element and an
Ordering (LT, GT, EQ). For
LT, the list will filter out all items that are >= the element argument.
split' :: (Ord a) => [a] -> a -> Ordering -> [a] split'  _ _ =  split' (x:xs) a LT | x < a = x : split' xs a LT | otherwise = split' xs a LT split' (x:xs) a GT | x > a = x : split' xs a GT | otherwise = split' xs a GT -- non-exhaustive, unacceptable
*Main> split' [1,2,3] 2 LT 
Note that this function can result in an exception if the
Ordering argument is
EQ. Of course this is terrible.
However, please review the above code, offering suggestions on how to improve it.