List comprehension
List comprehension
It filters out items, where fn returns Nothing and extracts the value from Just ... (like catMaybes):
> let fn n = if n > 10 then Just (n*100) else Nothing > [(k,v)|v <- [11,1,2,3,4,10,12,13], Just k <- [fn v]] [(1100,11),(1200,12),(1300,13)]