ap is:exact
In many situations, the
liftM operations can be replaced by
uses of
ap, which promotes function application.
return f `ap` x1 `ap` ... `ap` xn
is equivalent to
liftM<n> f x1 x2 ... xn
Examples
>>> pure (\x y z -> x + y * z) `ap` Just 1 `ap` Just 5 `ap` Just 10
Just 51
base-compat Control.Monad.Compat,
protolude Protolude.Monad,
base-prelude BasePrelude,
classy-prelude ClassyPrelude,
streamly Streamly.Data.Stream.MkType Streamly.Internal.Data.Stream.MkType,
Cabal-syntax Distribution.Compat.Prelude,
universum Universum.Monad.Reexport,
ihaskell IHaskellPrelude,
base-compat-batteries Control.Monad.Compat,
rebase Rebase.Prelude,
massiv-test Test.Massiv.Utils,
LambdaHack Game.LambdaHack.Core.Prelude,
cabal-install-solver Distribution.Solver.Compat.Prelude,
faktory Faktory.Prelude,
can-i-haz Control.Monad.Except.CoHas Control.Monad.Reader.Has,
yesod-paginator Yesod.Paginator.Prelude,
distribution-opensuse OpenSuse.Prelude In many situations, the
liftM operations can be replaced by
uses of
ap, which promotes function application.
return f `ap` x1 `ap` ... `ap` xn
is equivalent to
liftMn f x1 x2 ... xn
Finds the articulation points for a connected undirected graph, by
using the low numbers criteria:
a) The root node is an articulation point iff it has two or more
children.
b) An non-root node v is an articulation point iff there exists at
least one child w of v such that lowNumber(w) >= dfsNumber(v).
Sequential application.
Equivalent to Control.Applicative.
<*>.
Like
ap, but evaluating the function and its argument in
parallel.
Alphabetical synonym for
<*>
An adjective phrase. Transitive (fond of Mary, interested in an
account) or intransitive (correct, green, valid).
In many situations, the
liftM operations can be replaced by
uses of
ap, which promotes function application.
return f `ap` x1 `ap` ... `ap` xn
is equivalent to
liftMn f x1 x2 ... xn