Like functors, applicative functors are a sort of container, and they define two operations:
(defprotocol Applicative (pure [av v]) (fapply [ag av]))
The pure function is a generic way to put a value inside of an applicative functor. So far, we have been using the option helper function for this purpose. We will be using it a little later.
The fapply function will unwrap the function contained in the applicative ag, and will apply it to the value contained in the applicative av.
The purpose of both of the functions will become clear with an example, but first, we need to promote our option functor to an applicative functor, as follows:
(extend-protocol fkp/Applicative Some (pure [_ v] (Some. v)) (fapply [ag av] (if-let [v (:v av)] (Some. ((:v ag) v)) (None.))) None (pure [_ v] (Some. v)) (fapply [ag...