I am trying to understand why do applicative functors work by default (no implementation needed) for some functors like Maybe
but for others don't:
Example:
Just (+3) <*> (Just 3)
works fine "out of the box"- > 6
Left (+3) <*> Left 3
does not work
Just (+3) <*> Left 4
does not work even if i declare an Either Int Int
.
I assume in 99% of cases when dealing with pairs of : (f (a->b) , f a)
you must implement the desired behaviour yourself (Cartesian Product (f (a->b)) X (f a)
) and the first example is just something simple out of the box.
Example
In the case of (Maybe (a->b) , Either c d)
we would need to cover all 4 cases:
Just - Left
Just - Right
Nothing - Left
Nothing -Right
Am i right in this assumption ?