With a list of Maybe a, how to filter and take only the elements of the list which are not Nothing?
-- input
pas = [Just 3, Just 1, Just 5, Just 9, Nothing, Just 10, Nothing] :: [Maybe Int]
-- expected output
new_pas = [3, 1, 5, 9, 10]
I've tried different ways of using map and looked at mapMaybe but can't find the right combination.