:: a -> (a -> b) -> b -package:diagrams-lib -package:quaalude -package:lens-family-core -package:flow -package:ghci-hexcalc -package:funcmp
base Data.Function,
lens Control.Lens.Lens Control.Lens.Operators,
microlens Lens.Micro,
base-compat Data.Function.Compat,
protolude Protolude,
relude Relude.Function,
rio RIO.Prelude,
base-prelude BasePrelude BasePrelude.Operators,
optics-core Optics.Optic,
turtle Turtle,
composition-prelude Control.Composition,
universum Universum.Function,
numhask NumHask.Prelude,
conferer Conferer.Config,
config-ini Data.Ini.Config.Bidir,
rebase Rebase.Prelude,
configuration-tools Configuration.Utils.Internal,
stack Stack.Prelude,
incipit-base Incipit.Base,
ansi-terminal-game Terminal.Game,
ap-normalize ApNormalize,
loc Data.Loc.Internal.Prelude,
vivid Vivid.NoPluginsNoGlobalState,
termonad Termonad.Prelude & is a reverse application operator. This provides
notational convenience. Its precedence is one higher than that of the
forward application operator
$, which allows
& to be
nested in
$.
>>> 5 & (+1) & show
"6"
Helper to make code using records of clients more readable.
Can be mixed with (/:) for supplying arguments.
Example:
type Api = NamedRoutes RootApi
data RootApi mode = RootApi
{ subApi :: mode :- NamedRoutes SubApi
, …
} deriving Generic
data SubApi mode = SubApi
{ endpoint :: mode :- Get '[JSON] Person
, …
} deriving Generic
api :: Proxy API
api = Proxy
rootClient :: RootApi (AsClientT ClientM)
rootClient = client api
endpointClient :: ClientM Person
endpointClient = client // subApi // endpoint
& is a reverse application operator
Reverse function application which binds tighter than
<$>
and
<*>. Useful for refining grammar specification.
<*> monoidalFieldAla "extensions" (alaList' FSep MQuoted) oldExtensions
^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
Field access, inspired by the lens library. This is merely reverse
application, but allows us to write things like (1, 2)^._1
which is likely to be familiar to most Haskell programmers out there.
Note that this is precisely equivalent to _1 (1, 2), but
perhaps it reads a little nicer.
The
#-operator is the Haskell analog to the
.-operator in JavaScript. Example:
grd # addColorStop(0, "#8ED6FF");
This can be seen as equivalent of
grd.addColorStop(0,
"#8ED6FF").
Hang on function application, a.k.a. non-operator version of
&.
onApp = (&)
postfix function application (flip ($))
A flipped version of ($).
An operator that allows you to write C-style ternary conditionals of
the form:
p ? t ?? f
Note that parentheses are required in order to chain sequences of
conditionals together. This is probably a good thing.
Application operator. This operator is redundant, since ordinary
application
(f x) means the same as
(f $ x).
However,
$ has low, right-associative binding precedence, so it
sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
map
($ 0) xs, or
zipWith ($) fs xs.
Note that
($) is representation-polymorphic in its
result type, so that
foo $ True where
foo :: Bool
-> Int# is well-typed.
Strict (call-by-value) application operator. It takes a function and
an argument, evaluates the argument to weak head normal form (WHNF),
then calls the function with that value.
Delay inlining a function until late in the game (simplifier phase 0).
The
oneShot function can be used to give a hint to the compiler
that its argument will be called at most once, which may (or may not)
enable certain optimizations. It can be useful to improve the
performance of code in continuation passing style.
If
oneShot is used wrongly, then it may be that computations
whose result that would otherwise be shared are re-evaluated every
time they are used. Otherwise, the use of
oneShot is safe.
oneShot is representation-polymorphic: the type variables may
refer to lifted or unlifted types.
hedgehog Hedgehog.Internal.Prelude,
base-compat Prelude.Compat,
protolude Protolude,
relude Relude.Function,
rio RIO.Prelude,
base-prelude BasePrelude BasePrelude.Operators,
classy-prelude ClassyPrelude,
numeric-prelude NumericPrelude NumericPrelude.Base,
universum Universum.Function,
Cabal-syntax Distribution.Compat.Prelude,
github GitHub.Internal.Prelude,
numhask NumHask.Prelude NumHask.Prelude,
basement Basement.Compat.Base Basement.Imports,
foundation Foundation Application operator. This operator is redundant, since ordinary
application
(f x) means the same as
(f $ x).
However,
$ has low, right-associative binding precedence, so it
sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
map
($ 0) xs, or
zipWith ($) fs xs.
Note that
($) is levity-polymorphic in its result
type, so that
foo $ True where
foo :: Bool ->
Int# is well-typed.
hedgehog Hedgehog.Internal.Prelude,
ghc GHC.Prelude.Basic,
base-compat Prelude.Compat,
relude Relude.Base,
rio RIO.Prelude,
base-prelude BasePrelude BasePrelude.Operators,
classy-prelude ClassyPrelude,
numeric-prelude NumericPrelude NumericPrelude.Base,
Cabal-syntax Distribution.Compat.Prelude,
github GitHub.Internal.Prelude,
numhask NumHask.Prelude,
basement Basement.Compat.Base Basement.Imports Strict (call-by-value) application operator. It takes a function and
an argument, evaluates the argument to weak head normal form (WHNF),
then calls the function with that value.
Application operator. This operator is redundant, since ordinary
application
(f x) means the same as
(f $ x).
However,
$ has low, right-associative binding precedence, so it
sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
map
($ 0) xs, or
zipWith ($) fs xs.
Note that
($) is representation-polymorphic in its
result type, so that
foo $ True where
foo :: Bool
-> Int# is well-typed.
Application operator. This operator is redundant, since ordinary
application
(f x) means the same as
(f $ x).
However,
$ has low, right-associative binding precedence, so it
sometimes allows parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
map
($ 0) xs, or
zipWith ($) fs xs.
Strict (call-by-value) application operator. It takes a function and
an argument, evaluates the argument to weak head normal form (WHNF),
then calls the function with that value.
Stricter version of
$ operator. Default Prelude defines this at
the toplevel module, so we do as well.
>>> const 3 $ Prelude.undefined
3
>>> const 3 $! Prelude.undefined
*** Exception: Prelude.undefined
...