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