Search results

compose2Flipped :: forall a b x y. (x -> y -> a) -> (a -> b) -> x -> y -> b
P purescript-point-free M PointFree
composeSecond :: forall a b x y. (x -> b -> a) -> (y -> b) -> x -> y -> a

\f g x y -> f x (g y)

P purescript-point-free M PointFree
goldfinch :: forall d c b a. (b -> c -> d) -> (a -> c) -> a -> b -> d

G combinator - goldfinch

BBC

Λ a b c d . (b → c → d) → (a → c) → a → b → d

λ f g x y . f y (g x)

P purescript-birds M Aviary.Birds
on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c

The on function is used to change the domain of a binary operator.

For example, we can create a function which compares two records based on the values of their x properties:

compareX :: forall r. { x :: Number | r } -> { x :: Number | r } -> Ordering
compareX = compare `on` _.x
P purescript-prelude M Data.Function
on :: forall c b a. (b -> b -> c) -> (a -> b) -> a -> a -> c

Psi combinator - psi bird - on

Λ a b . (b → b → c) → (a → b) → a → a → c

λ f g . λ x y . f (g x) (g y)

P purescript-birds M Aviary.Birds
on :: forall c b a. (a -> a -> b) -> (c -> a) -> c -> c -> b
P purescript-combinators M Data.Combinators
psi :: forall c b a. (a -> a -> b) -> (c -> a) -> (c -> c -> b)
P purescript-combinators M Data.Combinators
antitransitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-colehaus-properties M Control.Algebra.Properties
intransitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-colehaus-properties M Control.Algebra.Properties
transitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-colehaus-properties M Control.Algebra.Properties
antitransitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-properties M Control.Algebra.Properties
intransitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-properties M Control.Algebra.Properties
transitive :: forall b a. HeytingAlgebra b => (a -> a -> b) -> a -> a -> a -> b
P purescript-properties M Control.Algebra.Properties
splay1 :: forall a b c. (a -> b -> c) -> (a -> b) -> a -> c
P purescript-reactix M Reactix.Utils

s

s :: forall c b a. (a -> b -> c) -> (a -> b) -> (a -> c)
P purescript-combinators M Data.Combinators
monotonic :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a -> a
P purescript-colehaus-properties M Control.Algebra.Properties
monotonic :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a -> a
P purescript-properties M Control.Algebra.Properties
everything :: forall a r. Data a => (r -> r -> r) -> (forall b. Data b => b -> r) -> a -> r

Summarise all nodes in top-down, left-to-right

P purescript-ajnsit-typeable M Data.Data
jay :: forall b a. (a -> b -> b) -> a -> b -> a -> b

J combinator - Jay

B(BC)(W(BC(B(BBB))))

Λ a b c d . (a → b → b) → a → b → a → b

λ f x y z . f x (f z y)

P purescript-birds M Aviary.Birds
fold :: forall event b a. IsEvent event => (a -> b -> b) -> event a -> b -> event b
P purescript-event M FRP.Event.Class
flip :: forall a b c. (a -> b -> c) -> b -> a -> c

Given a function that takes two arguments, applies the arguments to the function in a swapped order.

flip append "1" "2" == append "2" "1" == "21"

const 1 "two" == 1

flip const 1 "two" == const "two" 1 == "two"
P purescript-prelude M Data.Function
under :: forall t a s b. Newtype t a => Newtype s b => (a -> t) -> (t -> s) -> a -> b

The opposite of over: lowers a function that operates on Newtyped values to operate on the wrapped value instead.

newtype Degrees = Degrees Number
derive instance newtypeDegrees :: Newtype Degrees _

newtype NormalDegrees = NormalDegrees Number
derive instance newtypeNormalDegrees :: Newtype NormalDegrees _

normaliseDegrees :: Degrees -> NormalDegrees
normaliseDegrees (Degrees deg) = NormalDegrees (deg % 360.0)

asNormalDegrees :: Number -> Number
asNormalDegrees = under Degrees normaliseDegrees

As with over the Newtype is polymorphic, as illustrated in the example above - both Degrees and NormalDegrees are instances of Newtype, so even though normaliseDegrees changes the result type we can still put a Number in and get a Number out via under.

P purescript-newtype M Data.Newtype
applySecond :: forall x y a. (y -> x -> a) -> x -> y -> a

\f x y -> f y x

(flip)

P purescript-point-free M PointFree
cardinal :: forall c b a. (a -> b -> c) -> b -> a -> c

C combinator - cardinal

S(BBS)(KK)

Λ a b c . (a → b → c) → b → a → c

λ f x y . f y x

P purescript-birds M Aviary.Birds
flip :: forall c b a. (a -> b -> c) -> (b -> a -> c)

Flips the first two arguments of a function.

"a" :add "b" -- "ab"
"a" :flip add "b" -- "ba"
P purescript-neon M Neon.Primitive.Function
memoCompose :: forall a b c. (a -> b) -> (b -> c) -> a -> c

Memoize the composition of two functions

P purescript-pha M Pha.Util
vireostar :: forall c b a. (a -> b -> c) -> b -> a -> c

V* combinator - vireo once removed

CF

Λ a b c d . (b → a → b → d) → a → b → b → d

λ f x y z . f y x z

P purescript-birds M Aviary.Birds
over :: forall t a s b. Newtype t a => Newtype s b => (a -> t) -> (a -> b) -> t -> s

Lifts a function operate over newtypes. This can be used to lift a function to manipulate the contents of a single newtype, somewhat like map does for a Functor:

newtype Label = Label String
derive instance newtypeLabel :: Newtype Label _

toUpperLabel :: Label -> Label
toUpperLabel = over Label String.toUpper

But the result newtype is polymorphic, meaning the result can be returned as an alternative newtype:

newtype UppercaseLabel = UppercaseLabel String
derive instance newtypeUppercaseLabel :: Newtype UppercaseLabel _

toUpperLabel' :: Label -> UppercaseLabel
toUpperLabel' = over Label String.toUpper
P purescript-newtype M Data.Newtype
memoize2 :: forall a b c. Tabulate a => Tabulate b => (a -> b -> c) -> a -> b -> c

Memoize a function of two arguments

P purescript-open-memoize M Data.Function.Memoize
memoize2 :: forall c b a. Tabulate a => Tabulate b => (a -> b -> c) -> a -> b -> c

Memoize a function of two arguments

P purescript-memoize M Data.Function.Memoize
idstarstar :: forall c b a. (a -> b -> c) -> a -> b -> c

I** combinator - id bird twice removed

Λ a b c . (a → b → c) → a → b → c

λ f x y . f x y

P purescript-birds M Aviary.Birds
moldl :: forall t e m. Moldable t e => (m -> e -> m) -> m -> t -> m
P purescript-moldy M Data.Moldy
moldlDefault :: forall m e t. Moldable t e => (m -> e -> m) -> m -> t -> m

A default implementation of moldl based on moldMap

P purescript-moldy M Data.Moldy
moldr :: forall t e m. Moldable t e => (e -> m -> m) -> m -> t -> m
P purescript-moldy M Data.Moldy
moldrDefault :: forall m e t. Moldable t e => (e -> m -> m) -> m -> t -> m

A default implementation of moldr based on moldMap

P purescript-moldy M Data.Moldy
falsehoodPreserving :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a
P purescript-colehaus-properties M Control.Algebra.Properties
truthPreserving :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a
P purescript-colehaus-properties M Control.Algebra.Properties
falsehoodPreserving :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a
P purescript-properties M Control.Algebra.Properties
truthPreserving :: forall a. HeytingAlgebra a => Eq a => (a -> a -> a) -> a -> a -> a
P purescript-properties M Control.Algebra.Properties
compose :: forall c b a. (b -> c) -> (a -> b) -> (a -> c)

Returns a new function that calls the first function with the result of calling the second.

let addTwo x = x + 2
let double x = x * 2
let addTwoThenDouble x = addTwo :compose double
addTwoThenDouble 3 -- 10

This is function composition.

P purescript-neon M Neon.Primitive.Function
allWithIndex :: forall i a b f. FoldableWithIndex i f => HeytingAlgebra b => (i -> a -> b) -> f a -> b

allWithIndex f is the same as and <<< mapWithIndex f; map a function over the structure, and then get the conjunction of the results.

P purescript-foldable-traversable M Data.FoldableWithIndex
anyWithIndex :: forall i a b f. FoldableWithIndex i f => HeytingAlgebra b => (i -> a -> b) -> f a -> b

anyWithIndex f is the same as or <<< mapWithIndex f; map a function over the structure, and then get the disjunction of the results.

P purescript-foldable-traversable M Data.FoldableWithIndex
foldMapWithIndex :: forall i f a m. FoldableWithIndex i f => Monoid m => (i -> a -> m) -> f a -> m
P purescript-foldable-traversable M Data.FoldableWithIndex
foldMapWithIndexDefaultL :: forall i f a m. FoldableWithIndex i f => Monoid m => (i -> a -> m) -> f a -> m

A default implementation of foldMapWithIndex using foldlWithIndex.

Note: when defining a FoldableWithIndex instance, this function is unsafe to use in combination with foldlWithIndexDefault.

P purescript-foldable-traversable M Data.FoldableWithIndex
foldMapWithIndexDefaultR :: forall i f a m. FoldableWithIndex i f => Monoid m => (i -> a -> m) -> f a -> m

A default implementation of foldMapWithIndex using foldrWithIndex.

Note: when defining a FoldableWithIndex instance, this function is unsafe to use in combination with foldrWithIndexDefault.

P purescript-foldable-traversable M Data.FoldableWithIndex
mapWithIndex :: forall i f a b. FunctorWithIndex i f => (i -> a -> b) -> f a -> f b
P purescript-foldable-traversable M Data.FunctorWithIndex
foldl1 :: forall t a. Foldable1 t => (a -> a -> a) -> t a -> a
P purescript-foldable-traversable M Data.Semigroup.Foldable
foldl1Default :: forall t a. Foldable1 t => (a -> a -> a) -> t a -> a

A default implementation of foldl1 using foldMap1.

Note: when defining a Foldable1 instance, this function is unsafe to use in combination with foldMap1DefaultL.

P purescript-foldable-traversable M Data.Semigroup.Foldable
foldr1 :: forall t a. Foldable1 t => (a -> a -> a) -> t a -> a
P purescript-foldable-traversable M Data.Semigroup.Foldable
foldr1Default :: forall t a. Foldable1 t => (a -> a -> a) -> t a -> a

A default implementation of foldr1 using foldMap1.

Note: when defining a Foldable1 instance, this function is unsafe to use in combination with foldMap1DefaultR.

P purescript-foldable-traversable M Data.Semigroup.Foldable
foldingWithIndex :: forall f i x y z. FoldingWithIndex f i x y z => f -> i -> x -> y -> z
P purescript-heterogeneous M Heterogeneous.Folding
mmapFlipped :: forall a b f g. Functor f => Functor g => f (g a) -> (a -> b) -> f (g b)
P purescript-mason-prelude M MasonPrelude.Functor.Nested
foldingWithIndex :: forall f i x y z. FoldingWithIndex f i x y z => f -> i -> x -> y -> z
P purescript-heterogenous M Heterogenous.Folding
mkQ :: forall a b r. Typeable a => Typeable b => r -> (b -> r) -> a -> r
P purescript-ajnsit-typeable M Data.Data
new3 :: forall b a3 a2 a1 o. o -> a1 -> a2 -> a3 -> b
P purescript-ffi-utils M FFI.Util
antireflexive :: forall b a. HeytingAlgebra b => Eq b => (a -> a -> b) -> a -> b
P purescript-colehaus-properties M Control.Algebra.Properties
reflexive :: forall b a. HeytingAlgebra b => Eq b => (a -> a -> b) -> a -> b
P purescript-colehaus-properties M Control.Algebra.Properties
antireflexive :: forall b a. HeytingAlgebra b => Eq b => (a -> a -> b) -> a -> b
P purescript-properties M Control.Algebra.Properties
reflexive :: forall b a. HeytingAlgebra b => Eq b => (a -> a -> b) -> a -> b
P purescript-properties M Control.Algebra.Properties
transParaT :: forall t f. Recursive t f => Corecursive t f => (t -> t -> t) -> t -> t
P purescript-matryoshka M Matryoshka.Fold
traverse :: forall t a b m. Traversable t => Applicative m => (a -> m b) -> t a -> m (t b)
P purescript-foldable-traversable M Data.Traversable
traverse1 :: forall t a b f. Traversable1 t => Apply f => (a -> f b) -> t a -> f (t b)
P purescript-foldable-traversable M Data.Semigroup.Traversable
traverse1Default :: forall t a b m. Traversable1 t => Apply m => (a -> m b) -> t a -> m (t b)

A default implementation of traverse1 using sequence1.

P purescript-foldable-traversable M Data.Semigroup.Traversable
traverseDefault :: forall t a b m. Traversable t => Applicative m => (a -> m b) -> t a -> m (t b)

A default implementation of traverse using sequence and map.

P purescript-foldable-traversable M Data.Traversable
traverseDefault :: forall i t a b m. TraversableWithIndex i t => Applicative m => (a -> m b) -> t a -> m (t b)

A default implementation of traverse in terms of traverseWithIndex

P purescript-foldable-traversable M Data.TraversableWithIndex
collect :: forall f a b g. Distributive f => Functor g => (a -> f b) -> g a -> f (g b)
P purescript-distributive M Data.Distributive
collectDefault :: forall a b f g. Distributive f => Functor g => (a -> f b) -> g a -> f (g b)

A default implementation of collect, based on distribute.

P purescript-distributive M Data.Distributive
parTraverse :: forall f m t a b. Parallel f m => Applicative f => Traversable t => (a -> m b) -> t a -> m (t b)

Traverse a collection in parallel.

P purescript-parallel M Control.Parallel
crosswalk :: forall f t a b. Crosswalk f => Alignable t => (a -> t b) -> f a -> t (f b)
P purescript-these M Data.Align
traverseByWither :: forall t m a b. Witherable t => Applicative m => (a -> m b) -> t a -> m (t b)

A default implementation of traverse given a Witherable.

P purescript-filterable M Data.Witherable
traverse :: forall m p q a b. Dissect p q => MonadRec m => (a -> m b) -> p a -> m (p b)

A tail-recursive traverse operation, implemented in terms of Dissect.

Derived from: https://blog.functorial.com/posts/2017-06-18-Stack-Safe-Traversals-via-Dissection.html

P purescript-dissect M Dissect.Class
traverse :: forall t m b a. HasTraverse t => HasApply m => HasMap m => HasPure m => (a -> m b) -> t a -> m (t b)
P purescript-neon M Neon.Class.HasTraverse
ap :: forall m a b. Monad m => m (a -> b) -> m a -> m b

ap provides a default implementation of (<*>) for any Monad, without using (<*>) as provided by the Apply-Monad superclass relationship.

ap can therefore be used to write Apply instances as follows:

instance applyF :: Apply F where
  apply = ap
P purescript-prelude M Control.Monad
apply :: forall f a b. Apply f => f (a -> b) -> f a -> f b
P purescript-prelude M Control.Apply
bindFlipped :: forall m a b. Bind m => (a -> m b) -> m a -> m b

bindFlipped is bind with its arguments reversed. For example:

print =<< random
P purescript-prelude M Control.Bind
oneOfMap :: forall f g a b. Foldable f => Plus g => (a -> g b) -> f a -> g b

Folds a structure into some Plus.

P purescript-foldable-traversable M Data.Foldable
experiment :: forall f a w s. ComonadStore s w => Functor f => (s -> f s) -> w a -> f a

Extract a collection of values from positions which depend on the current position.

P purescript-transformers M Control.Comonad.Store.Class
parApply :: forall f m a b. Parallel f m => m (a -> b) -> m a -> m b

Apply a function to an argument under a type constructor in parallel.

P purescript-parallel M Control.Parallel
parOneOfMap :: forall a b t m f. Parallel f m => Alternative f => Foldable t => Functor t => (a -> m b) -> t a -> m b

Race a collection in parallel while mapping to some effect.

P purescript-parallel M Control.Parallel
squigglyApply :: forall f a b. Apply f => f (a -> b) -> f a -> f b
P purescript-signal M Signal
sampleOnLeftOp :: forall event a b. IsEvent event => event (a -> b) -> event a -> event b
P purescript-hyrule M FRP.Event.Class
sampleOnRightOp :: forall event a b. IsEvent event => event (a -> b) -> event a -> event b
P purescript-hyrule M FRP.Event.Class
apply :: forall f a b. Semigroupal Function Tuple Tuple f => Functor f => f (a -> b) -> f a -> f b
P purescript-monoidal M Data.Functor.ApplicativeDo
apply :: forall a c b. HasApply a => a (b -> c) -> a b -> a c
P purescript-neon M Neon.Class.HasApply
apply :: forall f m a b. Parallel f m => m (a -> b) -> m a -> m b
P purescript-qualified-do M QualifiedDo.ParApply
applyS :: forall @f @a @b. Select f => f (a -> b) -> f a -> f b

apply implemented in terms of select

P purescript-selective-functors M Control.Select
chain :: forall a c b. HasChain a => (b -> a c) -> a b -> a c
P purescript-neon M Neon.Class.HasChain
starling :: forall b a m. Monad m => m (a -> b) -> m a -> m b

S combinator - starling

S

Λ a b c . (a → b → c) → (a → b) → a → c

λ f g x . f x (g x)

P purescript-birds M Aviary.Birds
iterateM :: forall b a m. Monad m => (a -> m a) -> m a -> m b
P purescript-game M Game.Util
applyFlipped :: forall a b. a -> (a -> b) -> b

Applies an argument to a function. This is primarily used as the (#) operator, which allows parentheses to be omitted in some cases, or as a natural way to apply a value to a chain of composed functions.

P purescript-prelude M Data.Function
flap :: forall f a b. Functor f => f (a -> b) -> a -> f b

Apply a value in a computational context to a value in no context.

Generalizes flip.

longEnough :: String -> Bool
hasSymbol :: String -> Bool
hasDigit :: String -> Bool
password :: String

validate :: String -> Array Bool
validate = flap [longEnough, hasSymbol, hasDigit]
flap (-) 3 4 == 1
threeve <$> Just 1 <@> 'a' <*> Just true == Just (threeve 1 'a' true)
P purescript-prelude M Data.Functor
mapFlipped :: forall f a b. Functor f => f a -> (a -> b) -> f b

mapFlipped is map with its arguments reversed. For example:

[1, 2, 3] <#> \n -> n * n
P purescript-prelude M Data.Functor
cmap :: forall f a b. Contravariant f => (b -> a) -> f a -> f b
P purescript-contravariant M Data.Functor.Contravariant
cmapFlipped :: forall a b f. Contravariant f => f a -> (b -> a) -> f b

cmapFlipped is cmap with its arguments reversed.

P purescript-contravariant M Data.Functor.Contravariant
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2

Get a value which depends on the environment.

P purescript-transformers M Control.Comonad.Env.Class
censor :: forall w m a. MonadWriter w m => (w -> w) -> m a -> m a

Modify the final accumulator value by applying a function.

P purescript-transformers M Control.Monad.Writer.Class
local :: forall e w a. ComonadEnv e w => (e -> e) -> w a -> w a
P purescript-transformers M Control.Comonad.Env.Class
local :: forall r m a. MonadReader r m => (r -> r) -> m a -> m a
P purescript-transformers M Control.Monad.Reader.Class
peeks :: forall s a w. ComonadStore s w => (s -> s) -> w a -> a

Extract a value from a position which depends on the current position.

P purescript-transformers M Control.Comonad.Store.Class
seeks :: forall s a w. ComonadStore s w => (s -> s) -> w a -> w a

Reposition the focus at the specified position, which depends on the current position.

P purescript-transformers M Control.Comonad.Store.Class
flippedMap :: forall f a b. Functor f => f a -> (a -> b) -> f b
P purescript-signal M Signal
buildNode :: forall e f p v. ElementBuilder e f p v => e -> f p -> v -> v
P purescript-concur-core M Concur.Core.ElementBuilder
censorAccum :: forall acc html a. Accum acc html => (acc -> acc) -> html a -> html a
P purescript-chameleon-transformers M Chameleon.Transformers.Accum.Class
setCtx :: forall ctx html a. Ctx ctx html => (ctx -> ctx) -> html a -> html a
P purescript-chameleon-transformers M Chameleon.Transformers.Ctx.Class
mapErr :: forall e m a. MonadError e m => (e -> e) -> m a -> m a
P purescript-ts-bridge M TsBridge.Types
_call :: forall b a. a -> (a -> b) -> b
P purescript-neon M Neon.Operator
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
P purescript-eta-conversion M Data.ReaderTEtaConversionTransformer
intercept :: forall a e g f. ErrorControl f g e => f a -> (e -> a) -> g a
P purescript-errorcontrol M Error.Control
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb
P purescript-nested-functor M Data.Functor.Nested
oneOfMap :: forall f a b s. Convert s (Statements a) => Plus f => (a -> f b) -> s -> f b
P purescript-qualified-do M QualifiedDo.OneOfMap
parOneOfMap :: forall m f a b s. Convert s (Statements a) => Parallel f m => Alternative f => (a -> m b) -> s -> m b
P purescript-qualified-do M QualifiedDo.ParOneOfMap

t

t :: forall b a. a -> (a -> b) -> b

Reverse application which is probably exist inside Lens module

P purescript-birds M Aviary.Birds

t

t :: forall b a. a -> (a -> b) -> b
P purescript-combinators M Data.Combinators
thrush :: forall b a. a -> (a -> b) -> b

T combinator - thrush

CI

Λ a b . a → (a → b) → b

λ x f . f x

P purescript-birds M Aviary.Birds
liftA1 :: forall f a b. Applicative f => (a -> b) -> f a -> f b

liftA1 provides a default implementation of (<$>) for any Applicative functor, without using (<$>) as provided by the Functor-Applicative superclass relationship.

liftA1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftA1
P purescript-prelude M Control.Applicative
liftM1 :: forall m a b. Monad m => (a -> b) -> m a -> m b

liftM1 provides a default implementation of (<$>) for any Monad, without using (<$>) as provided by the Functor-Monad superclass relationship.

liftM1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftM1
P purescript-prelude M Control.Monad
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
P purescript-prelude M Data.Functor
all :: forall a b f. Foldable f => HeytingAlgebra b => (a -> b) -> f a -> b

all f is the same as and <<< map f; map a function over the structure, and then get the conjunction of the results.

P purescript-foldable-traversable M Data.Foldable
any :: forall a b f. Foldable f => HeytingAlgebra b => (a -> b) -> f a -> b

any f is the same as or <<< map f; map a function over the structure, and then get the disjunction of the results.

P purescript-foldable-traversable M Data.Foldable
foldMap :: forall f a m. Foldable f => Monoid m => (a -> m) -> f a -> m
P purescript-foldable-traversable M Data.Foldable
foldMap1 :: forall t a m. Foldable1 t => Semigroup m => (a -> m) -> t a -> m
P purescript-foldable-traversable M Data.Semigroup.Foldable
foldMap1DefaultL :: forall t m a. Foldable1 t => Functor t => Semigroup m => (a -> m) -> t a -> m

A default implementation of foldMap1 using foldl1.

Note: when defining a Foldable1 instance, this function is unsafe to use in combination with foldl1Default.

P purescript-foldable-traversable M Data.Semigroup.Foldable
foldMap1DefaultR :: forall t m a. Foldable1 t => Functor t => Semigroup m => (a -> m) -> t a -> m

A default implementation of foldMap1 using foldr1.

Note: when defining a Foldable1 instance, this function is unsafe to use in combination with foldr1Default.

P purescript-foldable-traversable M Data.Semigroup.Foldable
foldMapDefault :: forall i f a m. FoldableWithIndex i f => Monoid m => (a -> m) -> f a -> m

A default implementation of foldMap using foldMapWithIndex

P purescript-foldable-traversable M Data.FoldableWithIndex
foldMapDefaultL :: forall f a m. Foldable f => Monoid m => (a -> m) -> f a -> m

A default implementation of foldMap using foldl.

Note: when defining a Foldable instance, this function is unsafe to use in combination with foldlDefault.

P purescript-foldable-traversable M Data.Foldable
foldMapDefaultR :: forall f a m. Foldable f => Monoid m => (a -> m) -> f a -> m

A default implementation of foldMap using foldr.

Note: when defining a Foldable instance, this function is unsafe to use in combination with foldrDefault.

P purescript-foldable-traversable M Data.Foldable
mapDefault :: forall i f a b. FunctorWithIndex i f => (a -> b) -> f a -> f b

A default implementation of Functor's map in terms of mapWithIndex

P purescript-foldable-traversable M Data.FunctorWithIndex
enumFromThenTo :: forall f a. Unfoldable f => Functor f => BoundedEnum a => a -> a -> a -> f a

Returns a sequence of elements from the first value, taking steps according to the difference between the first and second value, up to (but not exceeding) the third value.

enumFromThenTo 0 2 6 = [0, 2, 4, 6]
enumFromThenTo 0 3 5 = [0, 3]

Note that there is no BoundedEnum instance for integers, they're just being used here for illustrative purposes to help clarify the behaviour.

The example shows Array return values, but the result can be any type with an Unfoldable1 instance.

P purescript-enums M Data.Enum
tracks :: forall w a t. ComonadTraced t w => (a -> t) -> w a -> a

Extracts a value at a relative position which depends on the current value.

P purescript-transformers M Control.Comonad.Traced.Class
squigglyMap :: forall f a b. Functor f => (a -> b) -> f a -> f b
P purescript-signal M Signal
transCataTM :: forall t f m. Recursive t f => Corecursive t f => Monad m => Traversable f => (t -> m t) -> t -> m t
P purescript-matryoshka M Matryoshka.Fold
map :: forall p q a b. Dissect p q => (a -> b) -> p a -> p b

A tail-recursive map operation, implemented in terms of Dissect.

P purescript-dissect M Dissect.Class
bind :: forall a. Semigroup a => a -> (a -> a) -> a
P purescript-qualified-do M QualifiedDo.Semigroup
defaultFilter :: forall a h f. BooleanEq h => Applicative f => Foldable f => Monoid (f a) => (a -> h) -> f a -> f a
P purescript-filterables M Data.Filterable
everywhereM :: forall m a. Monad m => Data a => (forall b. Data b => b -> m b) -> a -> m a

Apply a monadic transformation everywhere, bottom-up

P purescript-ajnsit-typeable M Data.Data
filter :: forall f h a. Filterable f => BooleanEq h => (a -> h) -> f a -> f a
P purescript-filterables M Data.Filterable
gmapM :: forall m a. Data a => Monad m => (forall d. Data d => d -> m d) -> a -> m a

A generic monadic transformation that maps over the immediate subterms

P purescript-ajnsit-typeable M Data.Data
gmapMo :: forall m a. Data a => MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

Transformation of one immediate subterm with success

P purescript-ajnsit-typeable M Data.Data
gmapMp :: forall m a. Data a => MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

Transformation of at least one immediate subterm does not fail

P purescript-ajnsit-typeable M Data.Data
map :: forall a c b. HasMap a => (b -> c) -> a b -> a c
P purescript-neon M Neon.Class.HasMap
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
P purescript-qualified-do M QualifiedDo.ParApply
mkM :: forall a b m. Typeable a => Typeable b => Typeable (m a) => Typeable (m b) => Applicative m => (b -> m b) -> a -> m a
P purescript-ajnsit-typeable M Data.Data
apply :: forall a b. (a -> b) -> a -> b

Applies a function to an argument. This is primarily used as the operator ($) which allows parentheses to be omitted in some cases, or as a natural way to apply a chain of composed functions to a value.

P purescript-prelude M Data.Function
clamp :: forall a. Ord a => a -> a -> a -> a

Clamp a value between a minimum and a maximum. For example:

let f = clamp 0 10
f (-5) == 0
f 5    == 5
f 15   == 10
P purescript-prelude M Data.Ord
modify :: forall t a. Newtype t a => (a -> a) -> t -> t

This combinator unwraps the newtype, applies a monomorphic function to the contained value and wraps the result back in the newtype

P purescript-newtype M Data.Newtype
un :: forall t a. Newtype t a => (a -> t) -> t -> a

Given a constructor for a Newtype, this returns the appropriate unwrap function.

P purescript-newtype M Data.Newtype
folding :: forall f x y z. Folding f x y z => f -> x -> y -> z
P purescript-heterogeneous M Heterogeneous.Folding
hfoldl :: forall f x a b. HFoldl f x a b => f -> x -> a -> b
P purescript-heterogeneous M Heterogeneous.Folding
hfoldlWithIndex :: forall f x a b. HFoldlWithIndex f x a b => f -> x -> a -> b
P purescript-heterogeneous M Heterogeneous.Folding
mappingWithIndex :: forall f i a b. MappingWithIndex f i a b => f -> i -> a -> b
P purescript-heterogeneous M Heterogeneous.Mapping