tailor [] _ = [] truths f [] = [] truths f (x:xs) = if f x then True : truths f xs else [] main = do let xs = [1..10] pd (-1) pd 0 pd 1 pd 20 pw (< 0) pw (< 5) pw (< 15)
Standard input is empty
[1,2,3,4,5,6,7,8,9,10] [1,2,3,4,5,6,7,8,9,10] [2,3,4,5,6,7,8,9,10] [] [1,2,3,4,5,6,7,8,9,10] [5,6,7,8,9,10] []