Search results

withJust :: forall a b m. Applicative m => Maybe a -> (a -> m b) -> m Unit
assure :: forall a e g f. ErrorControl f g e => Monad f => g a -> (a -> Maybe e) -> f a
bind :: forall m a b. Bind m => m a -> (a -> m b) -> m b
discard :: forall a f b. Discard a => Bind f => f a -> (a -> f b) -> f b
bind' :: forall v1 v0 m c. HasBind c m => ObjectOf c v0 => ObjectOf c (m v1) => Restrictable Function c => m v0 -> (v0 -> (m v1)) -> m v1
bind :: forall c b a. HasChain a => a b -> (b -> a c) -> a c

A version of chain with the arguments flipped. This is provided only to support desugaring do notation. It is not recommended to use explicitly.

fairConjunction :: forall b a m. MonadLogic m => m a -> (a -> m b) -> m b
hummingbird :: forall m b a. Bind m => m a -> (a -> m b) -> m b

H combinator - hummingbird

BW(BC)

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

λ f x y . f x y x

when :: forall b a m. MonadLogic m => m a -> (a -> m b) -> m b
for1_ :: forall t f a b. Foldable1 t => Apply f => t a -> (a -> f b) -> f Unit

A version of traverse1_ with its arguments flipped.

This can be useful when running an action written using do notation for every element in a data structure:

for_ :: forall a b f m. Applicative m => Foldable f => f a -> (a -> m b) -> m Unit

A version of traverse_ with its arguments flipped.

This can be useful when running an action written using do notation for every element in a data structure:

For example:

for_ [1, 2, 3] \n -> do
  print n
  trace "squared is"
  print (n * n)
for_ :: forall f m a. Foldable f => MonadRec m => f a -> (a -> m Unit) -> m Unit

Safely traverse a foldable container.

discard :: forall a f. Apply f => f Unit -> (Unit -> f a) -> f a
forM_ :: forall f m a. MonadRec m => Foldable f => f a -> (a -> m Unit) -> m Unit
catchError :: forall e m a. MonadError e m => m a -> (e -> m a) -> m a
controlError :: forall f g e a. ErrorControl f g e => f a -> (e -> g a) -> g a
alt :: forall f a. Alt f => f a -> (Unit -> f a) -> f a
discard :: forall f a. Alt f => f a -> (Unit -> f a) -> f a
discard :: forall f m a. Parallel f m => Alt f => m a -> (Unit -> m a) -> m a
when :: forall a m. Monad m => m Boolean -> (Unit -> m a) -> m Unit

Run a given computation when a monadic boolean is true.

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
flippedMap :: forall f a b. Functor f => f a -> (a -> b) -> f b
delay :: forall m a b. Delay m => a -> (a -> m b) -> m b
for :: forall a b m t. Applicative m => Traversable t => t a -> (a -> m b) -> m (t b)

A version of traverse with its arguments flipped.

This can be useful when running an action written using do notation for every element in a data structure:

For example:

for [1, 2, 3] \n -> do
  print n
  return (n * n)
bindMaybe :: forall m a b. Bind m => Compactable m => m a -> (a -> m (Maybe b)) -> m b
forkAction :: forall m a b. MonadEffect m => MonadAff m => Plus m => m a -> (m a -> m b) -> m b

A common pattern - running a long running action and keeping the GUI responsive Because the action can't be restarted on every gui event, we must fork it off in the beginning

fromMaybeS :: forall a f. Selective f => f a -> f (Maybe a) -> f a
fromMaybeS :: forall @f @a. Select f => f a -> f (Maybe a) -> f a

If the second action is Nothing, run and return the first

shouldNotSatisfyM :: forall m a. MonadThrow Error m => Show a => a -> (a -> m Boolean) -> m Unit
shouldSatisfyM :: forall m a. MonadThrow Error m => Show a => a -> (a -> m Boolean) -> m Unit
cmapFlipped :: forall a b f. Contravariant f => f a -> (b -> a) -> f b

cmapFlipped is cmap with its arguments reversed.

whileJust_ :: forall m b a. Monad m => m (Maybe a) -> (a -> m b) -> m Unit

As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are discarded.

whileJust_ :: forall m b a. MonadRec m => m (Maybe a) -> (a -> m b) -> m Unit

As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are discarded.

intercept :: forall a e g f. ErrorControl f g e => f a -> (e -> a) -> g a
bind :: forall f a. Alt f => f a -> (f a -> f a) -> f a
bind :: forall f m a. Parallel f m => Alt f => m a -> (m a -> m a) -> m a
freads :: forall m r s a. MonadEffect m => Refer s r => r -> (s -> a) -> m a
fmodify_ :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m Unit
pCompare1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Ordering
pGreaterThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pGreaterThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pLessThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pLessThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
extendFlipped :: forall b a w. Extend w => w a -> (w a -> b) -> w b

A version of extend with its arguments flipped.

fmodify :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m s
whileJust :: forall m b a. Monad m => m (Maybe a) -> (a -> m b) -> m (Array b)

As long as the supplied Maybe expression returns Just, the loop body will be called and passed the value contained in the 'Just'. Results are collected into an array.

whileJust :: forall m b a. MonadRec m => m (Maybe a) -> (a -> m b) -> m (Array b)

As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are collected into an array.

whileJust' :: forall b f a m. Monad m => Applicative f => Monoid (f b) => m (Maybe a) -> (a -> m b) -> m (f b)

As long as the supplied Maybe expression returns Just, the loop body will be called and passed the value contained in the Just. Results are collected into an arbitrary Applicative monoidal structure.

whileJust' :: forall m f b a. MonadRec m => Applicative f => Monoid (f b) => m (Maybe a) -> (a -> m b) -> m (f b)

As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are collected into an arbitrary MonadPlus container.

div :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLDivElement
span :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLSpanElement
table :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableElement
td :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableCellElement
th :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableCellElement
tr :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableRowElement
appendsNodesM :: forall m p f. NodeOp p => Foldable f => MonadEffect m => m p -> f (m Node) -> m p
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.

applySecond :: forall a b f. Apply f => f a -> f b -> f b

Combine two effectful actions, keeping only the result of the second.

voidLeft :: forall f a b. Functor f => f a -> b -> f b

A version of voidRight with its arguments flipped.

mulNat :: forall proxy a b c. ProductNat a b c => proxy a -> proxy b -> proxy c
plus :: forall proxy a b c. SumInt a b c => proxy a -> proxy b -> proxy c
plusNat :: forall proxy a b c. SumNat a b c => proxy a -> proxy b -> proxy c
powNat :: forall proxy a b c. ExponentiationNat a b c => proxy a -> proxy b -> proxy c
> powNat d2 d3
8 -- : NProxy D8

a raised to the power of b a^b = c

prod :: forall proxy a b c. ProductInt a b c => proxy a -> proxy b -> proxy c
sampleOnLeft_ :: forall event a b. IsEvent event => event a -> event b -> event b
fromMaybe' :: forall a. Maybe a -> a -> a

An infix form of fromMaybe with arguments flipped.

divides :: forall a. Divisible a => a -> a -> Maybe a
concat :: forall xs ys zs lproxy. Concat xs ys zs => lproxy xs -> lproxy ys -> lproxy zs
downcast :: forall ctor from to. ctor -> from -> Maybe to

Attempt to cast to a type given a constructor for it

drop :: forall n xs ys lproxy iproxy. Drop n xs ys => iproxy n -> lproxy xs -> lproxy ys
map :: forall f xs ys fproxy kproxy lproxy. Map f xs ys => fproxy f -> kproxy xs -> lproxy ys
take :: forall n xs ys lproxy iproxy. Take n xs ys => iproxy n -> lproxy xs -> lproxy ys
zip :: forall x y z lproxy. Zip x y z => lproxy x -> lproxy y -> lproxy z
applySecond :: forall v1 v0 f c. HasApply c f => HasConst c => HasIdentity c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v1) => ObjectOf c (c v0 (c v1 v1)) => ObjectOf c (c (c v1 v1) (c v0 (c v1 v1))) => f v0 -> f v1 -> f v1
downcast :: forall ctor from to. ctor -> from -> Maybe to

Attempt to cast to a type given a constructor for it

lookup :: forall c k r. Lookup c k r => c -> k -> Maybe r

Given some type and a key on that type, extract some value that corresponds to that key.

lookup :: forall c k r. Lookup c k r => c -> k -> Maybe r

Given some type and a key on that type, extract some value that corresponds to that key.

getOrAlt :: forall v s r' r l h g f. Alternative h => Cons s v r' r => RowToList r l => RGetOrAlt f g s l r => g s -> f r -> h v
max :: forall a. PartialOrd a => a -> a -> Maybe a
min :: forall a. PartialOrd a => a -> a -> Maybe a
pMax :: forall a. PartialOrd a => a -> a -> Maybe a
pMin :: forall a. PartialOrd a => a -> a -> Maybe a
rsingleton :: forall f g s v r. RSingleton f g s => Cons s v () r => Lacks s () => g s -> v -> f r
singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
_call :: forall b a. a -> (a -> b) -> b
after :: forall k f. Eq k => Foldable f => k -> f k -> Maybe k
always_ :: forall a i. i -> a -> Maybe i
before :: forall k f. Eq k => Foldable f => k -> f k -> Maybe k
bind :: forall a. Semigroup a => a -> (a -> a) -> a
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
functorDecorateFlipped :: forall b a f. Functor f => Decorate b a => f a -> b -> f b
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb

t

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

Reverse application which is probably exist inside Lens module

t

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

T combinator - thrush

CI

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

λ x f . f x

shouldContain :: forall m f a. MonadThrow Error m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldNotContain :: forall m f a. MonadThrow Error m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldNotReturn :: forall m t. MonadThrow Error m => Eq t => Show t => m t -> t -> m Unit

Asserts that m t does not return t

shouldReturn :: forall m t. MonadThrow Error m => Eq t => Show t => m t -> t -> m Unit

Asserts that m t returns t

trace :: forall a b. DebugWarning => a -> (Unit -> b) -> b

Log any PureScript value to the console for debugging purposes and then return a value. This will log the value's underlying representation for low-level debugging, so it may be desireable to show the value first.

The return value is thunked so it is not evaluated until after the message has been printed, to preserve a predictable console output.

For example:

doSomething = trace "Hello" \_ -> ... some value or computation ...