Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
(
$| ) :: (a -> b) -> Strategy a -> a -> bparallel Control.Parallel.Strategies Sequential function application. The argument is evaluated using the given strategy before it is given to the function.
(
$|| ) :: (a -> b) -> Strategy a -> a -> bparallel Control.Parallel.Strategies Parallel function application. The argument is evaluated using the given strategy, in parallel with the function application.
-
rio RIO.Prelude 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.
(
$!! ) :: NFData a => (a -> b) -> a -> brio RIO.Prelude the deep analogue of $!. In the expression f $!! x, x is fully evaluated before the function f is applied to it.
(
$> ) :: Functor f => f a -> b -> f brio RIO.Prelude Flipped version of <$.
Examples
Replace the contents of a Maybe Int with a constant String:>>> Nothing $> "foo" Nothing
>>> Just 90210 $> "foo" Just "foo"
Replace the contents of an Either Int Int with a constant String, resulting in an Either Int String:>>> Left 8675309 $> "foo" Left 8675309
>>> Right 8675309 $> "foo" Right "foo"
Replace each element of a list with a constant String:>>> [1,2,3] $> "foo" ["foo","foo","foo"]
Replace the second element of a pair with a constant String:>>> (1,2) $> "foo" (1,"foo")
-
Cabal-syntax Distribution.Compat.Prelude No documentation available.
(
$< ) :: ArrowList a => (c -> a b d) -> a b c -> a b dhxt Control.Arrow.ArrowList compute the parameter for an arrow with extra parameters from the input and apply the arrow for all parameter values to the input a kind of "function call" for arrows, useful for joining arrows
infixl 2 ($<)
definition:g $< f = applyA (f >>> arr g)
if f fails, the whole arrow fails, e.g. g $< none == none if f computes n values and g is deterministic, the whole arrow computes n values examples with simple list arrows with stringsprefixString :: String -> a String String prefixString s = arr (s++) runLA ( prefixString $< none ) "x" == [] runLA ( prefixString $< constA "y" ) "x" == ["yx"] runLA ( prefixString $< this ) "x" == ["xx"] runLA ( prefixString $< constA "y" <+> constA "z" ) "x" == ["yx","zx"] runLA ( prefixString $< constA "y" <+> this <+> constA "z" ) "x" == ["yx","xx","zx"]
see also: applyA, $<<, $<<<, $<<<<, $<$(
$<$ ) :: ArrowList a => (c -> a b b) -> a b c -> a b bhxt Control.Arrow.ArrowList compute the parameter for an arrow f with an extra parameter by an arrow g and apply all the results from g sequentially to the input
infixl 2 ($<$)
typical usage:g :: a b c g = ... f :: c -> a b b f x = ... x ... f $<$ g
f computes the extra parameters for g from the input of type b and g is applied with this parameter to the input. This allows programming in a point wise style in g, which becomes neccessary, when a value is needed more than once. this combinator is useful, when transforming a single value (document) step by step, with g for collecting the data for all steps, and f for transforming the input step by step if g is deterministic (computes exactly one result), g $<$ f == g $< f holds if g fails, f $<$ g == this if g computes more than one result, f is applied sequentially to the input for every result from g examples with simple list arrows with stringsprefixString :: String -> a String String prefixString s = arr (s++) runLA ( prefixString $<$ none ) "x" == ["x"] runLA ( prefixString $<$ constA "y" ) "x" == ["yx"] runLA ( prefixString $<$ constA "y" <+> constA "z" ) "x" == ["zyx"] runLA ( prefixString $<$ constA "y" <+> this <+> constA "z" ) "x" == ["zxyx"]
example with two extra parameterg1 :: a b c1 g2 :: a b c2 f :: (c1, c2) -> a b b f (x1, x2) = ... x1 ... x2 ... f $<$ g1 &&& g2
see also: applyA, $<(
$<< ) :: ArrowList a => (c1 -> c2 -> a b d) -> a b (c1, c2) -> a b dhxt Control.Arrow.ArrowList binary version of $< example with simple list arrows with strings
infixString :: String -> String -> a String String infixString s1 s2 = arr (\ s -> s1 ++ s ++ s2) runLA ( infixString $<< constA "y" &&& constA "z" ) "x" = ["yxz"] runLA ( infixString $<< this &&& this ) "x" = ["xxx"] runLA ( infixString $<< constA "y" &&& (constA "z" <+> this) ) "x" = ["yxz", "yxx"]
(
$<<< ) :: ArrowList a => (c1 -> c2 -> c3 -> a b d) -> a b (c1, (c2, c3)) -> a b dhxt Control.Arrow.ArrowList version of $< for arrows with 3 extra parameters typical usage
f $<<< g1 &&& g2 &&& g3