Slide 25
Slide 25 text
Applicative Functor (2)
Applicative Functor can contain functions.
And contained functions apply other objects contained by each functor.
array_plus = [:+.to_proc]
array_plus.ap([2, 3], [4]) # => [6, 7]
array_plus.ap([2, 3], [5, 6, 7]) # => [7, 8, 9, 8, 9, 10]
array_plus.ap([2, 3], []) # => []