I understand that in previous versions of Arrow-Kt was an instance of the Applicative typeclass. In the current version 1.0.x, most typeclasses are no longer present/visible (to make the library more accessible, I presume?).
There are some excellent explanations why an error accumulating Validation data type can't be a Monad, for instance Haskell 1 and Haskell 2 and also Scalaz, Cats or arrow-kt. Hoogle also states that
Furthermore, the Monad and Applicative operations should relate as follows:
pure = return
m1 <*> m2 = m1 >>= (x1 -> m2 >>= (x2 -> return (x1 x2)))
My problem is that I can't see an instance of the Applicative Functor instance in the current implementation of Validated in arrow-kt. More precisely, I don't see an ap
function anywhere:
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
my intuition tells me that the zip
function behaves somewhat similar to a map
/ap
composition
Haskell/Purescript:
Person <$> validateName first <*> validateName last <*> validateAge age
Kotlin with arrow-kt:
validateName(first).zip(validateName(last), validateAge(age), ::Person)
is zip
an ap
in disguise? Anything else I might be missing in my reasoning?