applicative programming examples: map, reduce and filter