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
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.
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
un :: forall t a. Newtype t a => (a -> t) -> t -> a
Given a constructor for a Newtype
, this returns the appropriate unwrap
function.
intercalate :: forall f m. Foldable f => Monoid m => m -> f m -> m
Fold a data structure, accumulating values in some Monoid
,
combining adjacent elements using the specified separator.
For example:
> intercalate ", " ["Lorem", "ipsum", "dolor"]
= "Lorem, ipsum, dolor"
> intercalate "*" ["a", "b", "c"]
= "a*b*c"
> intercalate [1] [[2, 3], [4, 5], [6, 7]]
= [2, 3, 1, 4, 5, 1, 6, 7]
intercalate :: forall f m. Foldable1 f => Semigroup m => m -> f m -> m
Fold a data structure using a Semigroup
instance,
combining adjacent elements using the specified separator.
surround :: forall f m. Foldable f => Semigroup m => m -> f m -> m
fold
but with each element surrounded by some fixed value.
For example:
> surround "*" []
= "*"
> surround "*" ["1"]
= "*1*"
> surround "*" ["1", "2"]
= "*1*2*"
> surround "*" ["1", "2", "3"]
= "*1*2*3*"
peek :: forall s w a. ComonadStore s w => s -> w a -> a
track :: forall t w a. ComonadTraced t w => t -> w a -> a
memoize :: forall a b. Tabulate a => (a -> b) -> a -> b
Memoize a function of one argument
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
askRunInBase :: forall b m a. MonadUnlift b m => m (m a -> b a)
A monomorphic version of askUnlift which can be more convenient when you only want to use the resulting runner function once with a concrete type.
If you run into type issues using this, try using askUnlit
instead.
buildLeaf :: forall e f p v. ElementBuilder e f p v => e -> f p -> v
get :: forall v s r' r l g f. Cons s v r' r => RGet f g s l r => RowToList r l => g s -> f r -> v
match :: forall v r1 r0 l1 l0 g f. RMatch f g v l0 r0 l1 r1 => RowToList r0 l0 => RowToList r1 l1 => f r0 -> g r1 -> 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
applicator :: forall b a. (a -> b) -> a -> b
A combinator - applicator
Λ a b . (a → b) → a → b
λ f x . f x
askRunBase :: forall a stM m base. MonadBaseUnlift base m stM => Applicative base => m (m a -> base a)
consMax :: forall a f. Foldable f => Ord a => a -> f a -> a
consMin :: forall a f. Foldable f => Ord a => a -> f a -> a
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
foldMap :: forall a b s. Convert s (Statements a) => Monoid b => (a -> b) -> s -> b
gmapT :: forall a. Data a => (forall b. Data b => b -> b) -> a -> a
A generic transformation that maps over the immediate subterms
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.
mkT :: forall a b. Typeable a => Typeable b => (b -> b) -> a -> a
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
sequence :: forall t a m. Traversable t => Applicative m => t (m a) -> m (t a)
sequence1 :: forall t b f. Traversable1 t => Apply f => t (f b) -> f (t b)
sequence1Default :: forall t a m. Traversable1 t => Apply m => t (m a) -> m (t a)
A default implementation of sequence1
using traverse1
.
sequenceDefault :: forall t a m. Traversable t => Applicative m => t (m a) -> m (t a)
A default implementation of sequence
using traverse
.
distribute :: forall f a g. Distributive f => Functor g => g (f a) -> f (g a)
distributeDefault :: forall a f g. Distributive f => Functor g => g (f a) -> f (g a)
A default implementation of distribute
, based on collect
.
parSequence :: forall a t m f. Parallel f m => Applicative f => Traversable t => t (m a) -> m (t a)
sequence :: forall m p q a. Dissect p q => MonadRec m => p (m a) -> m (p a)
A tail-recursive sequence
operation, implemented in terms of Dissect
.
sequence :: forall c b a. HasApply b => HasMap b => HasTraverse a => HasPure b => a (b c) -> b (a c)
Sequences actions and collects the results.
sequence [Just 1, Just 2] -- Just [1, 2]
join :: forall a m. Bind m => m (m a) -> m a
Collapse two applications of a monadic type constructor into one.
voidLeft :: forall f a b. Functor f => f a -> b -> f b
A version of voidRight
with its arguments flipped.
fix :: forall l. Lazy l => (l -> l) -> l
fix
defines a value as the fixed point of a function.
The Lazy
instance allows us to generate the result lazily.
oneOf :: forall f g a. Foldable f => Plus g => f (g a) -> g a
Combines a collection of elements using the Alt
operation.
oneOf :: forall m f a. MonadGen m => Foldable1 f => f (m a) -> m a
Creates a generator that outputs a value chosen from a selection of existing generators with uniform probability.
enumFromTo :: forall a u. Enum a => Unfoldable1 u => a -> a -> u a
Returns a contiguous sequence of elements from the first value to the second value (inclusive).
enumFromTo 0 3 = [0, 1, 2, 3]
enumFromTo 'c' 'a' = ['c', 'b', 'a']
The example shows Array
return values, but the result can be any type
with an Unfoldable1
instance.
asks :: forall r m a. MonadAsk r m => (r -> a) -> m a
Projects a value from the global context in a MonadAsk
.
gets :: forall s m a. MonadState s m => (s -> a) -> m a
Get a value which depends on the current state.
modify :: forall s m. MonadState s m => (s -> s) -> m s
Modify the state by applying a function to the current state. The returned value is the new state value.
parOneOf :: forall a t m f. Parallel f m => Alternative f => Foldable t => Functor t => t (m a) -> m a
Race a collection in parallel.
wrapFree :: forall f m a. MonadFree f m => f (m a) -> m a
integrateM :: forall a stM m base. Applicative base => MonadBaseControl base m stM => m (stM a) -> m a
Pack a state belonging to m
back into it, instead of throwing it away
restoreM :: forall base m stM a. MonadBaseControl base m stM => base (stM a) -> m a
keepLatest :: forall event a. IsEvent event => event (event a) -> event a
keepLatest :: forall event a. IsEvent event => event (event a) -> event a
join :: forall v m c. HasBind c m => HasIdentity c => ObjectOf c (m v) => m (m v) -> m v
flipScalarMul :: forall k f. VectorField f k => f k -> k -> f k
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
choice :: forall a g f. Foldable f => Alt g => Plus g => f (g a) -> g a
fix :: forall a. (a -> a) -> a
Fixed point Y combinator
Λ a . (a → a) → a
λ f . (λ x. f (x x)) (λ x . f (x x))
fix :: forall a. (a -> a) -> a
flatten :: forall b a. HasChain a => a (a b) -> a b
Removes a level of nesting from a container.
flatten [[1, 2], [3, 4]] -- [1, 2, 3, 4]
foldEnum :: forall a b. BoundedEnum a => Semigroup b => (a -> b) -> b
Map each element of a BoundedEnum
into a semigroup,
and combine the results through refold1
.
functorDecorateFlipped :: forall b a f. Functor f => Decorate b a => f a -> b -> f b
invokeAction :: forall m res args ctrl act. RemoteAction act ctrl args res => MonadReader Visualforce m => MonadAff m => MonadError RemoteActionError m => IsSymbol ctrl => Encode args => Decode res => act -> args -> m res
Function that invoke the action defined by referring to contraints which holds details about the correct controller to invoke. Example:
data PCMRequests = ..
data CreatePCMRequests = CreatePCMRequests
instance remoteActionCreatePCMs :: RemoteAction CreatePCMRequests "PCMMassController.createRecords" PCMRequests Unit
createPCMRequest :: Visualforce -> PCMRequests -> Aff (Either RemoteActionError Unit)
createPCMRequest vf rec = runReaderT (runExceptT $ invokeAction CreatePCMRequests rec) vf
oneOf :: forall a m f. Foldable f => Alternative m => f (m a) -> m a
snoc :: forall f a. Container f => f a -> a -> f a
tabulate :: forall f a b. Representable f a => (a -> b) -> f b
warbler :: forall m a. Bind m => m (m a) -> m a
W combinator - warbler - omega
MM
Λ a b . (a → a → b) → a → b
λ f x . f x x
add :: forall a. Semiring a => a -> a -> a
append :: forall a. Semigroup a => a -> a -> a
conj :: forall a. HeytingAlgebra a => a -> a -> a
const :: forall a b. a -> b -> a
Returns its first argument and ignores its second.
const 1 "hello" = 1
It can also be thought of as creating a function that ignores its argument:
const 1 = \_ -> 1
disj :: forall a. HeytingAlgebra a => a -> a -> a
div :: forall a. EuclideanRing a => a -> a -> a
gcd :: forall a. Eq a => EuclideanRing a => a -> a -> a
The greatest common divisor of two values.
genericAdd :: forall a rep. Generic a rep => GenericSemiring rep => a -> a -> a
A Generic
implementation of the add
member from the Semiring
type class.
genericAdd' :: forall a. GenericSemiring a => a -> a -> a
genericAppend :: forall a rep. Generic a rep => GenericSemigroup rep => a -> a -> a
A Generic
implementation of the append
member from the Semigroup
type class.
genericAppend' :: forall a. GenericSemigroup a => a -> a -> a
genericConj :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic
implementation of the conj
member from the HeytingAlgebra
type class.
genericConj' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericDisj :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic
implementation of the disj
member from the HeytingAlgebra
type class.
genericDisj' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericImplies :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic
implementation of the implies
member from the HeytingAlgebra
type class.
genericImplies' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericMul :: forall a rep. Generic a rep => GenericSemiring rep => a -> a -> a
A Generic
implementation of the mul
member from the Semiring
type class.
genericMul' :: forall a. GenericSemiring a => a -> a -> a
genericSub :: forall a rep. Generic a rep => GenericRing rep => a -> a -> a
A Generic
implementation of the sub
member from the Ring
type class.
genericSub' :: forall a. GenericRing a => a -> a -> a
implies :: forall a. HeytingAlgebra a => a -> a -> a
lcm :: forall a. Eq a => EuclideanRing a => a -> a -> a
The least common multiple of two values.
leftDiv :: forall a. DivisionRing a => a -> a -> a
Left division, defined as leftDiv a b = recip b * a
. Left and right
division are distinct in this module because a DivisionRing
is not
necessarily commutative.
If the type a
is also a EuclideanRing
, then this function is
equivalent to div
from the EuclideanRing
class. When working
abstractly, div
should generally be preferred, unless you know that you
need your code to work with noncommutative rings.
max :: forall a. Ord a => a -> a -> a
Take the maximum of two values. If they are considered equal, the first argument is chosen.
min :: forall a. Ord a => a -> a -> a
Take the minimum of two values. If they are considered equal, the first argument is chosen.
mod :: forall a. EuclideanRing a => a -> a -> a
mul :: forall a. Semiring a => a -> a -> a
rightDiv :: forall a. DivisionRing a => a -> a -> a
Right division, defined as rightDiv a b = a * recip b
. Left and right
division are distinct in this module because a DivisionRing
is not
necessarily commutative.
If the type a
is also a EuclideanRing
, then this function is
equivalent to div
from the EuclideanRing
class. When working
abstractly, div
should generally be preferred, unless you know that you
need your code to work with noncommutative rings.
sub :: forall a. Ring a => a -> a -> a
duplicate :: forall a w. Extend w => w a -> w (w a)
Duplicate a comonadic context.
duplicate
is dual to Control.Bind.join
.
unfoldable :: forall m f a. MonadRec m => MonadGen m => Unfoldable f => m a -> m (f a)
Creates a generator that produces unfoldable structures based on an existing generator for the elements.
The size of the unfoldable will be determined by the current size state
for the generator. To generate an unfoldable structure of a particular
size, use the resize
function from the MonadGen
class first.
unwrapCofree :: forall f w a. ComonadCofree f w => w a -> f (w a)
sans :: forall m a b. At m a b => a -> m -> m
fork :: forall f m a. MonadFork f m => m a -> m (f a)
suspend :: forall f m a. MonadFork f m => m a -> m (f a)
add :: forall x y z. Add x y z => x -> y -> z
and :: forall b1 b2 b3. And b1 b2 b3 => b1 -> b2 -> b3
div :: forall x y z. Div x y z => x -> y -> z
eq :: forall b1 b2 b3. Eq b1 b2 b3 => b1 -> b2 -> b3
gcd :: forall x y z. GCD x y z => x -> y -> z
imp :: forall b1 b2 b3. Imp b1 b2 b3 => b1 -> b2 -> b3
max :: forall x y z. Max x y z => x -> y -> z
min :: forall x y z. Min x y z => x -> y -> z
mod :: forall x y r. Mod x y r => x -> y -> r
mul :: forall x y z. Mul x y z => x -> y -> z
or :: forall b1 b2 b3. Or b1 b2 b3 => b1 -> b2 -> b3
sub :: forall x y z. Sub x y z => x -> y -> z
trich :: forall x y r. Trich x y r => x -> y -> r
xor :: forall b1 b2 b3. Xor b1 b2 b3 => b1 -> b2 -> b3
hmap :: forall f a b. HMap f a b => f -> a -> b
hmapWithIndex :: forall f a b. HMapWithIndex f a b => f -> a -> b
mapping :: forall f a b. Mapping f a b => f -> a -> b
resulting :: forall f acc x. Resulting f acc x => f -> acc -> x
variadic :: forall f acc args. Variadic f acc args => f -> acc -> args
variadicWithIndex :: forall f acc args. VariadicWithIndex f acc args => f -> acc -> args
call :: forall s. IsString s => Monoid s => s -> s -> s
Syntax for CSS function call.
reduce :: forall f i o. Reducible f i o => f -> i -> o
lact :: forall g s. LeftAction g s => g -> s -> s
ract :: forall g s. RightAction g s => s -> g -> s
convertOptions :: forall t i o. ConvertOptions t i o => t -> i -> o
defaults :: forall defaults provided all. Defaults defaults provided all => defaults -> provided -> all
maddL :: forall x r. LeftModule x r => x -> x -> x
maddR :: forall x r. RightModule x r => x -> x -> x
mmulL :: forall x r. LeftModule x r => r -> x -> x
mmulR :: forall x r. RightModule x r => x -> r -> x
msubL :: forall x r. LeftModule x r => x -> x -> x
msubR :: forall x r. RightModule x r => x -> x -> x
bindTo :: forall f o. f -> o -> f
defaultUndef :: forall a. a -> a -> a
new :: forall f a o. f -> a -> o
Call new on the function with an array or pseudoarray of arguments
dot :: forall p n. ToPos n p => Semiring n => p -> p -> n
Get the dot product of two vectors
mapProduct :: forall mp a b. MapProduct mp a b => mp -> a -> b
putInsideMod :: forall r p n. ToRegion n r => AsPosEndo n p => EuclideanRing n => r -> p -> p
Put a position inside a region by using the modulus operator
act :: forall m s. Action m s => m -> s -> s
Convert a value of type @m@ to an action on @s@ values.
at :: forall c k r. Monoid r => Lookup c k r => c -> k -> r
This simple helper works on any Lookup
instance where the return type is
a Monoid
, and is the same as lookup
except that it returns a t
instead of a Maybe t
. If lookup
would return Nothing
, then at
returns mempty
.
at :: forall c k r. Monoid r => Lookup c k r => c -> k -> r
This simple helper works on any Lookup
instance where the return type is
a Monoid
, and is the same as lookup
except that it returns a t
instead of a Maybe t
. If lookup
would return Nothing
, then at
returns mempty
.
No further results.