Search results
traverse :: forall t a b m. Traversable t => Applicative m => (a -> m b) -> t a -> m (t b)
traverse1 :: forall t a b f. Traversable1 t => Apply f => (a -> f b) -> t a -> f (t b)
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
.
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
.
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
collect :: forall f a b g. Distributive f => Functor g => (a -> f b) -> g a -> f (g b)
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
.
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.
crosswalk :: forall f t a b. Crosswalk f => Alignable t => (a -> t b) -> f a -> t (f b)
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
.
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
traverse :: forall t m b a. HasTraverse t => HasApply m => HasMap m => HasPure m => (a -> m b) -> t a -> m (t 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.
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
chain :: forall a c b. HasChain a => (b -> a c) -> a b -> a c
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.
iterateM :: forall b a m. Monad m => (a -> m a) -> m a -> m b
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
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
squigglyMap :: forall f a b. Functor f => (a -> b) -> f a -> f b
transCataTM :: forall t f m. Recursive t f => Corecursive t f => Monad m => Traversable f => (t -> m t) -> t -> m t
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
.
defaultFilter :: forall a h f. BooleanEq h => Applicative f => Foldable f => Monoid (f a) => (a -> h) -> f a -> f a
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
filter :: forall f h a. Filterable f => BooleanEq h => (a -> h) -> f a -> f a
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
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
mkM :: forall a b m. Typeable a => Typeable b => Typeable (m a) => Typeable (m b) => Applicative m => (b -> m b) -> a -> m a
cmap :: forall f a b. Contravariant f => (b -> a) -> f a -> f b
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
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.
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2
Get a value which depends on the environment.
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.
map :: forall f xs ys fproxy kproxy lproxy. Map f xs ys => fproxy f -> kproxy xs -> lproxy ys
withCtx :: forall ctx html a. AskCtx ctx html => (ctx -> html a) -> html a
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
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]
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 List
s) or
types with truncating Unfoldable1
instances (like Maybe
).
liftF :: forall b a f. Applicative f => (a -> b) -> a -> f b
applyFirst :: forall a b f. Apply f => f a -> f b -> f a
Combine two effectful actions, keeping only the result of the first.
applySecond :: forall a b f. Apply f => f a -> f b -> f b
Combine two effectful actions, keeping only the result of the second.
voidRight :: forall f a b. Functor f => a -> f b -> f a
Ignore the return value of a computation, using the specified return value instead.
alt :: forall f a. Alt f => f a -> f a -> f a
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.
seek :: forall s a w. ComonadStore s w => s -> w a -> w a
Reposition the focus at the specified position.
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
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.
sampleOn_ :: forall b a event. 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.
applyFirst :: forall v1 v0 f c. HasApply c f => HasConst c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v0) => f v0 -> f v1 -> f v0
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
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
filled :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction
with the given fillStyle, resetting it to the
previous value after
putCtx :: forall a html ctx. Ctx ctx html => ctx -> html a -> html a
stroked :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction
with the given strokeStyle, resetting it to the
previous value after
take :: forall n xs ys lproxy iproxy. Take n xs ys => iproxy n -> lproxy xs -> lproxy ys
tellAccum :: forall acc html a. TellAccum acc html => acc -> html a -> html a
zip :: forall x y z lproxy. Zip x y z => lproxy x -> lproxy y -> lproxy z
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
scalarMul :: forall f k. VectorField f k => k -> f k -> f k
- ∀v in V: one * v == v
- ∀a b in K, v in V: a * (b .* v) = (a * b) .* v
- ∀a b in K, v in V:
- a .* (u + v) = a .* u + a .* v
- (a + b) .* v = a .* v + b .* v
alt :: forall f a. Alternative f => f a -> f a -> f a
cons :: forall t a. Consable t => a -> t a -> t a
cons :: forall f a. Container f => a -> f a -> f a
dappend :: forall cnt a. Diff cnt => cnt a -> cnt a -> cnt a
functorDecorate :: forall b a f. Functor f => Decorate a b => a -> f b -> f a
insert :: forall f a. Container f => Ord a => a -> f a -> f a
interleave :: forall m a. MonadLogic m => m a -> m a -> m a
option :: forall a m. Alternative m => a -> m a -> m a
replaceInArray :: forall a f. HasUuid a => Functor f => a -> f a -> f a