Elementary programming

from blog Terms and Truth-Conditions, | ↗ original
What’s the difference between this program mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b] mapMaybe f [] = Just [] mapMaybe f (a:as) = (:) f a mapMaybe f as and this one? mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b] mapMaybe = traverse The second one is certainly shorter, but I believe it would also be considered to be better by many Haskell...