internalAnd :: Bool -> Bool -> Bool
internalAnd True True = True
internalAnd _ _ = False
(&&) :: Applicative m => m Bool -> m Bool -> m Bool
(&&) = liftA2 internalAnd
-- Usage
greaterThan x = (x <)
lessThan x = (x >)
validateAge = greaterThan 0 && lessThan 120 -- It's really useful with combinators.
I think it is useful to define all functions over Applicative
for many situation like making combinators. And applicative is abstraction of applicability that is corresponding to function's ability, so it seems not bad to do like this.
What is expected problems of defining all the functions over Applicative
?