Search results
fmapL :: forall r e' e. (e -> e') -> Either e r -> Either e' r
Map a function over the Left value of an Either
mapLeft :: forall l r l2. (l -> l2) -> Either l r -> Either l2 r
coerce1 :: forall n a. Coercible n a => (a -> n) -> Either DecodeError a -> Either DecodeError n
lmap :: forall f a b c. Bifunctor f => (a -> b) -> f a c -> f b c
Map a function over the first type argument of a Bifunctor.
lcmap :: forall a b c p. Profunctor p => (a -> b) -> p b c -> p a c
Map a function over the (contravariant) first type argument only.
throwLeftAs :: forall err m left right. MonadThrow err m => (left -> err) -> Either left right -> m right
Turns a Left a into an exception which reduces nesting
dlmap :: forall p c b a. Profunctor p => (a -> b) -> p b c -> p a c
throwLeftAs :: forall err m left right. MonadThrow err m => (left -> err) -> Either left right -> m right
Turns a Left a into an exception which reduces nesting
handleEither :: forall r e' e. (e -> Either e' r) -> Either e r -> Either e' r
catchEither with the arguments flipped
wrapIso :: forall p t a. Profunctor p => Newtype t a => (a -> t) -> p a a -> p t t
wrapIso :: forall v1 v0 p. HasDimap Function p => Newtype v0 v1 => ObjectOf Function v1 => ObjectOf Function v0 => (v0 -> v1) -> p v0 v0 -> p v1 v1
rmap :: forall f a b c. Bifunctor f => (b -> c) -> f a b -> f a c
Map a function over the second type arguments of a Bifunctor.
rmap :: forall a b c p. Profunctor p => (b -> c) -> p a b -> p a c
Map a function over the (covariant) second type argument only.
drmap :: forall p c b a. Profunctor p => (b -> c) -> p a b -> p a c
fromLeft' :: forall a b. (Unit -> a) -> Either a b -> a
Similar to fromLeft but for use in cases where the default value may be
expensive to compute. As PureScript is not lazy, the standard fromLeft
has to evaluate the default value before returning the result,
whereas here the value is only computed when the Either is known
to be Right.
throwLeftAsM :: forall err m left right. MonadThrow err m => (left -> m err) -> Either left right -> m right
Turns a Left a into an exception which reduces nesting
throwLeftAsM :: forall err m left right. MonadThrow err m => (left -> m err) -> Either left right -> m right
Turns a Left a into an exception which reduces nesting
contramapMaybe :: forall p a b x. Profunctor p => Semigroupal Function Either Either Either p => (a -> Maybe b) -> p b x -> p a x
eitherBool :: forall a. (a -> Boolean) -> a -> Either a a
Upgrade a boolean-style predicate to an either-style predicate mapping.
fromRight' :: forall a b. (Unit -> b) -> Either a b -> b
Similar to fromRight but for use in cases where the default value may be
expensive to compute. As PureScript is not lazy, the standard fromRight
has to evaluate the default value before returning the result,
whereas here the value is only computed when the Either is known
to be Left.
try :: forall b a. (a -> b) -> a -> Either Error b
subst :: forall t f a c. Bound t => Monad f => (a -> f c) -> t f a -> t f c
substDefault :: forall t f a c. MonadTrans t => Monad f => Monad (t f) => (a -> f c) -> t f a -> t f c
censor :: forall w m a. MonadWriter w m => (w -> w) -> m a -> m a
Modify the final accumulator value by applying a function.
local :: forall e w a. ComonadEnv e w => (e -> e) -> w a -> w a
local :: forall r m a. MonadReader r m => (r -> r) -> m a -> m a
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.
censorAccum :: forall acc html a. Accum acc html => (acc -> acc) -> html a -> html a
setCtx :: forall ctx html a. Ctx ctx html => (ctx -> ctx) -> html a -> html a
mapErr :: forall e m a. MonadError e m => (e -> e) -> m a -> m a
resize :: forall m a. MonadGen m => (Size -> Size) -> m a -> m a
Modifies the size state for a random generator.
modCompleter :: forall f a. HasCompleter f => (Completer -> Completer) -> f a -> f a
defaultFilter :: forall a h f. BooleanEq h => Applicative f => Foldable f => Monoid (f a) => (a -> h) -> f a -> f a
filter :: forall f h a. Filterable f => BooleanEq h => (a -> h) -> f a -> f a
filter :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
filterDefault :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
A default implementation of filter using filterMap.
filterDefaultPartition :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
A default implementation of filter using partition.
filterDefaultPartitionMap :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
A default implementation of filter using partitionMap.
iterateUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a
Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).
iterateUntil :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a
Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).
iterateWhile :: forall m a. Monad m => (a -> Boolean) -> m a -> m a
Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).
iterateWhile :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a
Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).
retryUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a
Repeat a computation until the value satisfies a predicate
dropWhile :: forall f a. Container f => (a -> Boolean) -> f a -> f a
filter :: forall a b. HasFilter a => (b -> Boolean) -> a b -> a b
until :: forall a m. Monad m => (a -> Boolean) -> m a -> m a
shouldNotSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
shouldSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
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
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
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
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
cmap :: forall f a b. Contravariant f => (b -> a) -> f a -> f b
squigglyMap :: forall f a b. Functor f => (a -> b) -> f a -> f b
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.
map :: forall a c b. HasMap a => (b -> c) -> a b -> a c
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
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.
mapFlipped :: forall v1 v0 f c. HasMap c f => ObjectOf c v0 => ObjectOf c v1 => f v0 -> c v0 v1 -> f v1
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2
Get a value which depends on the environment.
amodify_ :: forall m r s. MonadEffect m => Refer s r => (s -> s) -> r -> m Unit
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.
unfoldr1Default :: forall a b t. Unfoldable t => (b -> a /\ (Maybe b)) -> b -> t a
Provides a default implementation of unfoldr1 using unfoldr to satisfy
the superclass bound on Unfoldable.
unfoldrInf :: forall a b u. Unfoldable1 u => (b -> a /\ b) -> b -> u a
Unfold an infinite Unfoldable1.
Analogous to unfold1 and unfold, but with no way to signal termination;
unfoldInf f b consists of fst $ f b appended to unfoldInf f $ snd $ f b.
This should only be used to produce either lazy types (like lazy Lists) or
types with truncating Unfoldable1 instances (like Maybe).
amodify :: forall m r s. MonadEffect m => Refer s r => (s -> s) -> r -> m s
iterate :: forall a u. Unfoldable1 u => (a -> a) -> a -> u a
Create an infinite Unfoldable1 by repeated application of a function to a seed value.
Analogous to iterateN, but with no iteration limit.
This should only be used to produce either lazy types (like lazy Lists) or
types with truncating Unfoldable1 instances (like Maybe).
onChangeM :: forall a m t. MonadEffect m => EventTargetOp t => (Event -> Effect a) -> m t -> m t
Attach an event handler function to the event target when the target's value changes. The target is returned.
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.
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.
foldMap :: forall f a m. Foldable f => Monoid m => (a -> m) -> f a -> m
foldMap1 :: forall t a m. Foldable1 t => Semigroup m => (a -> m) -> t a -> m
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.
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.
foldMapDefault :: forall i f a m. FoldableWithIndex i f => Monoid m => (a -> m) -> f a -> m
A default implementation of foldMap using foldMapWithIndex
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.
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.
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.
areads :: forall m r s a. MonadEffect m => Refer s r => (s -> a) -> r -> m a
liftF :: forall b a f. Applicative f => (a -> b) -> a -> f b
embed :: forall t n m b. MMonad t => Monad n => (forall a. m a -> t n a) -> t m b -> t n b
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
extend :: forall w b a. Extend w => (w a -> b) -> w a -> w b
oneOfMap :: forall f g a b. Foldable f => Plus g => (a -> g b) -> f a -> g b
Folds a structure into some Plus.
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.
filterMap :: forall f a b. Filterable f => (a -> Maybe b) -> f a -> f b
filterMapByWither :: forall t a b. Witherable t => (a -> Maybe b) -> t a -> t b
A default implementation of filterMap given a Witherable.
filterMapDefault :: forall f a b. Filterable f => (a -> Maybe b) -> f a -> f b
A default implementation of filterMap using separate. Note that this is
almost certainly going to be suboptimal compared to direct implementations.
mapMaybe :: forall html msg1 msg2. MapMaybe html => (msg1 -> Maybe msg2) -> html msg1 -> html msg2
chain :: forall a c b. HasChain a => (b -> a c) -> a b -> a c
iterateM :: forall b a m. Monad m => (a -> m a) -> m a -> m b
lowerBy :: forall b a f. Rebuildable f => (a -> Maybe b) -> f a -> f b
rebuildBy :: forall f b a. Rebuildable f => (a -> Array b) -> f a -> f b
traverse1_ :: forall t f a b. Foldable1 t => Apply f => (a -> f b) -> t a -> f Unit
Traverse a data structure, performing some effects encoded by an
Apply instance at each value, ignoring the final result.
traverse_ :: forall a b f m. Applicative m => Foldable f => (a -> m b) -> f a -> m Unit
Traverse a data structure, performing some effects encoded by an
Applicative functor at each value, ignoring the final result.
For example:
traverse_ print [1, 2, 3]
parTraverse_ :: forall f m t a b. Parallel f m => Applicative f => Foldable t => (a -> m b) -> t a -> m Unit
Traverse a collection in parallel, discarding any results.
traverse_ :: forall f m a. Foldable f => MonadRec m => (a -> m Unit) -> f a -> m Unit
Safely traverse a foldable container.
allS :: forall @t @f @a. Selective f => Foldable t => (a -> f Boolean) -> t a -> f Boolean
Short-circuiting all
anyS :: forall @t @f @a. Selective f => Foldable t => (a -> f Boolean) -> t a -> f Boolean
Short-circuiting any
applySecond :: forall a b f. Apply f => f a -> f b -> f b
Combine two effectful actions, keeping only the result of the second.
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
fromLeft :: forall a b. a -> Either a b -> a
A function that extracts the value from the Left data constructor.
The first argument is a default value, which will be returned in the
case where a Right is passed to fromLeft.
fromRight :: forall a b. b -> Either a b -> b
A function that extracts the value from the Right data constructor.
The first argument is a default value, which will be returned in the
case where a Left is passed to fromRight.
sampleOnLeft_ :: forall event a b. IsEvent event => event a -> event b -> event b
transAnaT :: forall t f. Recursive t f => Corecursive t f => (t -> t) -> t -> t
transCataT :: forall t f. Recursive t f => Corecursive t f => (t -> t) -> t -> t
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
everywhere :: forall a. Data a => (forall b. Data b => b -> b) -> a -> a
Apply a transformation everywhere, bottom-up
everywhere' :: forall a. Data a => (forall b. Data b => b -> b) -> a -> a
Apply a transformation everywhere, top-down
gmapT :: forall a. Data a => (forall b. Data b => b -> b) -> a -> a
A generic transformation that maps over the immediate subterms
mkT :: forall a b. Typeable a => Typeable b => (b -> b) -> a -> a
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.
un :: forall t a. Newtype t a => (a -> t) -> t -> a
Given a constructor for a Newtype, this returns the appropriate unwrap
function.
gate :: forall a event. IsEvent event => event Boolean -> event a -> event a
Sample the events that are fired while a boolean event is true. Note that,
until the boolean event fires, it will be assumed to be false, and events
will be blocked.
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
memoize :: forall a b. Tabulate a => (a -> b) -> a -> b
Memoize a function of one argument
concat :: forall xs ys zs lproxy. Concat xs ys zs => lproxy xs -> lproxy ys -> lproxy zs
drop :: forall n xs ys lproxy iproxy. Drop n xs ys => iproxy n -> lproxy xs -> lproxy ys
gate :: forall event a. IsEvent event => event Boolean -> event a -> event a
Sample the events that are fired while a boolean event is true. Note that,
until the boolean event fires, it will be assumed to be false, and events
will be blocked.
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
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
memoize :: forall b a. Tabulate a => (a -> b) -> a -> b
Memoize a function of one argument
over :: forall s t a b @sym lenses. IsSymbol sym => ParseSymbol sym lenses => ConstructBarlow lenses Function s t a b => (a -> b) -> s -> t
addClassesM :: forall m n f. MonadEffect m => ElementOp n => Foldable f => f String -> m n -> m n
applicator :: forall b a. (a -> b) -> a -> b
A combinator - applicator
Λ a b . (a → b) → a → b
λ f x . f x
applySecond :: forall a d. Syntax d => d Unit -> d a -> d a
This variant of <*> ignores its left result. In contrast to its
counterpart derived from the Apply class, the ignored parts have type
d Unit rather than d b because otherwise information relevant for
pretty-printing would be lost.
chainM :: forall m a. Testable m => m Element -> m a -> m a
Used in its operator form >>, this function chains two DOM operations
together, taking the output of the first operation and making it context of
the second one. For example:
buttonInsideDiv <- find "div" >> find "button"
inputValue <- find "input" >> attr "value"
foldMap :: forall a b s. Convert s (Statements a) => Monoid b => (a -> b) -> s -> b
idstar :: forall b a. (a -> b) -> a -> b
I* combinator - id bird once removed
S(SK)
Λ a b . (a → b) → a → b
λ f x . f x
local :: forall a b r. (a -> b) -> (Ask b => r) -> (Ask a => r)
Run a function over an implicit parameter
Note: Be careful while using this to map over the value without updating the type.
-- evaluates to `1`, not `2` provide 1 (local ((*) 2) (ask @Int))
mapUndefined :: forall b a. (a -> b) -> a -> b
memoize :: forall a b. (a -> b) -> a -> b
Memoize the function f. If the argument of f differs from the previous call, then f is recomputed.
moldMap :: forall t e m. Moldable t e => Monoid m => (e -> m) -> t -> m
moldMapDefaultL :: forall m e t. Moldable t e => Monoid m => (e -> m) -> t -> m
moldMapDefaultR :: forall m e t. Moldable t e => Monoid m => (e -> m) -> t -> m
A default implementation of moldMap based on moldr
nmap :: forall fa fb a b. NestedFunctor fa fb a b => (a -> b) -> fa -> fb
rmCssM :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f String -> m n -> m n
setAttrsM :: forall e f m. Foldable f => ElementOp e => MonadEffect m => f (String /\ String) -> m e -> m e
Sets the attributes of an element. Existing attributes of the same names are overwritten. New names create new attributes. The element is returned.
setCssM :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f (String /\ String) -> m n -> m n
bind :: forall c m v1 v0. HasBind c m => ObjectOf c v0 => ObjectOf c (m v1) => m v0 -> c v0 (m v1) -> m v1
discard :: forall c a v f. Discard c a => HasBind c f => ObjectOf c a => ObjectOf c (f v) => f a -> c a (f v) -> f v
discard_ :: forall c f a v. Discard_ c f a => HasBind c f => ObjectOf c a => ObjectOf c (f v) => f a -> c a (f v) -> f v
applyTuple :: forall f a b. Apply f => f a -> f b -> f (a /\ b)
dt :: forall nt r. Newtype nt { o :: Number | r } => (Number -> Number) -> nt -> nt
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
foldMap :: forall barbie f a. Traversable barbie => Monoid a => (forall b. f b -> a) -> barbie f -> a
foldMap1 :: forall t f m. Foldable1 t => Monoid m => (forall a. f a -> m) -> t f -> m
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
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
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
mkM :: forall a b m. Typeable a => Typeable b => Typeable (m a) => Typeable (m b) => Applicative m => (b -> m b) -> a -> m a
oneOfMap :: forall f a b s. Convert s (Statements a) => Plus f => (a -> f b) -> s -> f b
parOneOfMap :: forall m f a b s. Convert s (Statements a) => Parallel f m => Alternative f => (a -> m b) -> s -> m b
shadow :: forall r a. Variadic Shadow r => (a -> ZDepth) -> a -> r
unlessM :: forall m. Monad m => m Boolean -> m Unit -> m Unit
Perform a monadic action unless a condition is true, where the conditional value is also in a monadic context.
whenM :: forall m. Monad m => m Boolean -> m Unit -> m Unit
Perform a monadic action when a condition is true, where the conditional value is also in a monadic context.
alt :: forall f a. Alt f => f a -> f a -> f a
mapWithIndex :: forall i f a b. FunctorWithIndex i f => (i -> a -> b) -> f a -> f b
choose :: forall m a. MonadGen m => m a -> m a -> m a
Creates a generator that outputs a value chosen from one of two existing existing generators with even probability.
listens :: forall w m a b. MonadWriter w m => (w -> b) -> m a -> m (Tuple a b)
Projects a value from modifications made to the accumulator during an action.
untilM_ :: forall a m. Monad m => m a -> m Boolean -> m Unit
Execute an action repeatedly until the condition expression returns true.
The condition is evaluated after the loop body.
Ignores the results of loop body execution.
untilM_ :: forall m a. MonadRec m => m a -> m Boolean -> m Unit
Execute an action repeatedly until the condition expression returns true.
The condition is evaluated after the loop body.
Ignores the results of loop body execution.
whileM_ :: forall m a. Monad m => m Boolean -> m a -> m Unit
Execute an action repeatedly as long as the given boolean expression
returns true. The condition is evaluated before the loop body.
Ignores the results of loop body execution.
whileM_ :: forall m a. MonadRec m => m Boolean -> m a -> m Unit
Execute an action repeatedly as long as the given boolean expression
returns true. The condition is evaluated before the loop body.
Ignores the results of loop body execution.
addU :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
Add two values with the same unit
addUnitOp :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
subU :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
Subtract two values with the same unit
subUnitOp :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
max1 :: forall f a. Ord1 f => f a -> f a -> f a
min1 :: forall f a. Ord1 f => f a -> f a -> f a
onIntegrityError :: forall m a. MonadError PGError m => m a -> m a -> m a
add :: forall f a. Additive f => Semiring a => f a -> f a -> f a
Vector addition
alt :: forall f a. Alternative f => f a -> f a -> f a
dappend :: forall cnt a. Diff cnt => cnt a -> cnt a -> cnt a
diff :: forall p d a. Affine p d => Ring a => p a -> p a -> d a
The vector from the first point to the second.
fromFoldableL :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldl.
fromFoldableL [] [1,2,3,4] == [4,3,2,1]
fromFoldableL [0] [1,2,3,4] == [4,3,2,1,0]
fromFoldableR :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldr.
fromFoldableR [] [1,2,3,4] == [1,2,3,4]
fromFoldableR [5] [1,2,3,4] == [1,2,3,4,5]
interleave :: forall m a. MonadLogic m => m a -> m a -> m a
moveBy :: forall p d a. Affine p d => Semiring a => p a -> d a -> p a
Add a vector to a point.
moveByNeg :: forall p d a. Affine p d => Ring a => p a -> d a -> p a
Subtract a vector from a point.
onChange :: forall a m t. MonadEffect m => EventTargetOp t => (Event -> Effect a) -> t -> m t
Attach an event handler function to the event target when the target's value changes. The target is returned.
shouldNotSatisfyMFlipped :: forall m a. MonadThrow Error m => Show a => (a -> m Boolean) -> a -> m Unit
shouldSatisfyMFlipped :: forall m a. MonadThrow Error m => Show a => (a -> m Boolean) -> a -> m Unit
sub :: forall f a. Additive f => Ring a => f a -> f a -> f a
Vector subtraction
unlessS :: forall @f. Select f => f Boolean -> f Unit -> f Unit
Execute the second action if the first action returns false
whenS :: forall f. Selective f => f Boolean -> f Unit -> f Unit
whenS :: forall @f. Select f => f Boolean -> f Unit -> f Unit
Execute the second action if the first action returns true
with :: forall a m. MonadThrow Error m => (a -> m Unit) -> a -> m Unit
yup :: forall m a. MonadNope m => m a -> m a -> m a
applyFirst :: forall a b f. Apply f => f a -> f b -> f a
Combine two effectful actions, keeping only the result of the first.
ltraverse :: forall t b c a f. Bitraversable t => Applicative f => (a -> f c) -> t a b -> f (t c b)
try :: forall e m a. MonadError e m => m a -> m (Either e a)
Return Right if the given action succeeds, Left if it throws.
sampleOnRight_ :: forall event a b. IsEvent event => event a -> event b -> event a
Create an Event which samples the latest values from the first event
at the times when the second event fires, ignoring the values produced by
the second event.
filterA :: forall repr a. DataDSL repr => (a -> Boolean) -> repr (Array a) -> repr (Array a)
Filter array by predicate
In D3: .data(arr.filter(d => d.value > 0))
In spreadsheet: =FILTER(A1:A10, x => x > 0)
mapA :: forall repr a b. DataDSL repr => (a -> b) -> repr (Array a) -> repr (Array b)
Map over array - the heart of D3 data joins
In D3: The template function in .join("rect").attr("height", d => d.value)
In spreadsheet: =MAP(A1:A10, x => x * 2)