Search results
imap :: forall f a b. Invariant f => (a -> b) -> (b -> a) -> f a -> f b
imapF :: forall f a b. Functor f => (a -> b) -> (b -> a) -> f a -> f b
As all Functors are also trivially Invariant, this function can be
used as the imap implementation for any types that has an existing
Functor instance.
imapC :: forall f a b. Contravariant f => (a -> b) -> (b -> a) -> f a -> f b
As all Contravariant functors are also trivially Invariant, this function can be used as the imap implementation for any types that have an existing Contravariant instance.
under :: forall t a s b. Newtype t a => Newtype s b => (a -> t) -> (t -> s) -> a -> b
The opposite of over: lowers a function that operates on Newtyped
values to operate on the wrapped value instead.
newtype Degrees = Degrees Number
derive instance newtypeDegrees :: Newtype Degrees _
newtype NormalDegrees = NormalDegrees Number
derive instance newtypeNormalDegrees :: Newtype NormalDegrees _
normaliseDegrees :: Degrees -> NormalDegrees
normaliseDegrees (Degrees deg) = NormalDegrees (deg % 360.0)
asNormalDegrees :: Number -> Number
asNormalDegrees = under Degrees normaliseDegrees
As with over the Newtype is polymorphic, as illustrated in the example
above - both Degrees and NormalDegrees are instances of Newtype,
so even though normaliseDegrees changes the result type we can still put
a Number in and get a Number out via under.
compose :: forall c b a. (b -> c) -> (a -> b) -> (a -> c)
Returns a new function that calls the first function with the result of calling the second.
let addTwo x = x + 2
let double x = x * 2
let addTwoThenDouble x = addTwo :compose double
addTwoThenDouble 3 -- 10
This is function composition.
memoCompose :: forall a b c. (a -> b) -> (b -> c) -> a -> c
Memoize the composition of two functions
fold :: forall f z xs r fproxy kproxy lproxy. Fold f z xs r => fproxy f -> kproxy z -> lproxy xs -> kproxy r
foldr :: forall f z xs r fproxy kproxy lproxy. Foldr f z xs r => fproxy f -> kproxy z -> lproxy xs -> kproxy r
clamp1 :: forall f a. Ord1 f => f a -> f a -> f a -> f a
rgetOrAlt :: forall f g s l r v r' i h. RGetOrAlt f g s l r => Alternative h => Cons s v r' r => RLProxying i l => i l -> g s -> f r -> h v
over :: forall t a s b. Newtype t a => Newtype s b => (a -> t) -> (a -> b) -> t -> s
Lifts a function operate over newtypes. This can be used to lift a
function to manipulate the contents of a single newtype, somewhat like
map does for a Functor:
newtype Label = Label String
derive instance newtypeLabel :: Newtype Label _
toUpperLabel :: Label -> Label
toUpperLabel = over Label String.toUpper
But the result newtype is polymorphic, meaning the result can be returned as an alternative newtype:
newtype UppercaseLabel = UppercaseLabel String
derive instance newtypeUppercaseLabel :: Newtype UppercaseLabel _
toUpperLabel' :: Label -> UppercaseLabel
toUpperLabel' = over Label String.toUpper
between :: forall a close open m. Apply m => m open -> m close -> m a -> m a
on :: forall @sym f1 f2 a b r1 r2. Newtype f2 (Variant r2) => Newtype f1 (Variant r1) => Cons sym a r1 r2 => IsSymbol sym => (a -> b) -> (f1 -> b) -> f2 -> b
intercalateMap :: forall f m a. Foldable1 f => Semigroup m => m -> (a -> m) -> f a -> m
Fold a data structure, accumulating values in some Semigroup,
combining adjacent elements using the specified separator.
surroundMap :: forall f a m. Foldable f => Semigroup m => m -> (a -> m) -> f a -> m
foldMap but with each element surrounded by some fixed value.
For example:
> surroundMap "*" show []
= "*"
> surroundMap "*" show [1]
= "*1*"
> surroundMap "*" show [1, 2]
= "*1*2*"
> surroundMap "*" show [1, 2, 3]
= "*1*2*3*"
lerp :: forall f a. Additive f => Ring a => a -> f a -> f a -> f a
Linear interpolation: lerp t a b = a + t * (b - a)
lerp 0.0 a b = alerp 1.0 a b = b
substitute :: forall f a. Monad f => Eq a => a -> f a -> f a -> f a
rget :: forall f g s l r v r' h. RGet f g s l r => Cons s v r' r => RLProxying h l => h l -> g s -> f r -> v
substituteVar :: forall f a. Functor f => Eq a => a -> a -> f a -> f a
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
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
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.
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
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.
flippedMap :: forall f a b. Functor f => f a -> (a -> b) -> 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.
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
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
mkQ :: forall a b r. Typeable a => Typeable b => r -> (b -> r) -> a -> r
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2
Get a value which depends on the environment.
cmap :: forall f a b. Contravariant f => (b -> a) -> f a -> f b
cmapFlipped :: forall a b f. Contravariant f => f a -> (b -> a) -> f b
cmapFlipped is cmap with its arguments reversed.
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
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.
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
intercept :: forall a e g f. ErrorControl f g e => f a -> (e -> a) -> g 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.
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.
un :: forall t a. Newtype t a => (a -> t) -> t -> a
Given a constructor for a Newtype, this returns the appropriate unwrap
function.
enumFromThenTo :: forall f a. Unfoldable f => Functor f => BoundedEnum a => a -> a -> a -> f a
Returns a sequence of elements from the first value, taking steps according to the difference between the first and second value, up to (but not exceeding) the third value.
enumFromThenTo 0 2 6 = [0, 2, 4, 6]
enumFromThenTo 0 3 5 = [0, 3]
Note that there is no BoundedEnum instance for integers, they're just
being used here for illustrative purposes to help clarify the behaviour.
The example shows Array return values, but the result can be any type
with an Unfoldable1 instance.
areads :: forall m r s a. MonadEffect m => Refer s r => (s -> a) -> r -> m a
freads :: forall m r s a. MonadEffect m => Refer s r => r -> (s -> a) -> m a
memoize :: forall a b. Tabulate a => (a -> b) -> a -> b
Memoize a function of one argument
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
_call :: forall b a. a -> (a -> b) -> b
applicator :: forall b a. (a -> b) -> a -> b
A combinator - applicator
Λ a b . (a → b) → a → b
λ f x . f x
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
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
liftF :: forall b a f. Applicative f => (a -> b) -> a -> f b
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
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb
t :: forall b a. a -> (a -> b) -> b
Reverse application which is
probably exist inside Lens module
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
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
amodify :: forall m r s. MonadEffect m => Refer s r => (s -> s) -> r -> m s
fmodify :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m s
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
bind :: forall a. Semigroup a => a -> (a -> 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
gmapT :: forall a. Data a => (forall b. Data b => b -> b) -> a -> a
A generic transformation that maps over the immediate subterms
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).
mkT :: forall a b. Typeable a => Typeable b => (b -> b) -> a -> 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.
applySecond :: forall a b f. Apply f => f a -> f b -> f b
Combine two effectful actions, keeping only the result of the second.
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.
mreads :: forall m s a. ReferM s m => (s -> a) -> m a
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.
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
map :: forall f xs ys fproxy kproxy lproxy. Map f xs ys => fproxy f -> kproxy xs -> lproxy ys
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.
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
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
buildNode :: forall e f p v. ElementBuilder e f p v => e -> f p -> v -> 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
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
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
curryN :: forall args result curried. CurryN args result curried => (args -> result) -> curried
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.
on :: forall evt obj callback out proxy. On evt obj callback out => proxy evt -> obj -> callback -> out
tabulate :: forall f a b. Representable f a => (a -> b) -> f b
alt :: forall f a. Alt f => f a -> f a -> f a
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.
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.
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.
mmodify :: forall m s. ReferM s m => (s -> s) -> m s
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.
dot :: forall f a. Metric f => Semiring a => f a -> f a -> a
The inner (dot) product of two vectors.
dot (V2 1.0 2.0) (V2 3.0 4.0) = 11.0 -- 1*3 + 2*4
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
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.
qd :: forall f a. Metric f => Ring a => f a -> f a -> a
The squared distance between two vectors.
qd (V2 0.0 0.0) (V2 3.0 4.0) = 25.0
sub :: forall f a. Additive f => Ring a => f a -> f a -> f a
Vector subtraction
yup :: forall m a. MonadNope m => m a -> m a -> m a
clamp :: forall a. Ord a => a -> a -> a -> a
Clamp a value between a minimum and a maximum. For example:
let f = clamp 0 10
f (-5) == 0
f 5 == 5
f 15 == 10
voidLeft :: forall f a b. Functor f => f a -> b -> f b
A version of voidRight with its arguments flipped.
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.
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
seek :: forall s a w. ComonadStore s w => s -> w a -> w a
Reposition the focus at the specified position.
track :: forall t w a. ComonadTraced t w => t -> w a -> a
folding :: forall f x y z. Folding f x y z => f -> x -> y -> z
hfoldl :: forall f x a b. HFoldl f x a b => f -> x -> a -> b
hfoldlWithIndex :: forall f x a b. HFoldlWithIndex f x a b => f -> x -> a -> b
mappingWithIndex :: forall f i a b. MappingWithIndex f i a b => f -> i -> a -> b
resultingWithLength :: forall f n acc x. ResultingWithLength f n acc x => f -> n -> acc -> x
convertOptionsWithDefaults :: forall t defaults provided all. ConvertOptionsWithDefaults t defaults provided all => t -> defaults -> provided -> all
applyTo :: forall f this a b. f -> this -> a -> b
Apply a function to a this object with the given arguments
convertOption :: forall field from to sproxy. ConvertOption field from to => sproxy field -> from -> to
buildLeaf :: forall e f p v. ElementBuilder e f p v => e -> f p -> v
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
tellAccum :: forall acc html a. TellAccum acc html => acc -> html a -> html a
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
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
singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
clamp :: forall a. HasGreater a => HasLess a => a -> a -> a -> a
Clamps a value between some bounds. If the lower bound is greater than the upper bound, they will be swapped.
2 :clamp 3 5 -- 3
4 :clamp 3 5 -- 4
6 :clamp 3 5 -- 5
6 :clamp 5 3 -- 5
cons :: forall t a. Consable t => a -> t a -> t a
cons :: forall f a. Container f => a -> f a -> f 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
folding :: forall f x y z. Folding f x y z => f -> x -> y -> z
functorDecorate :: forall b a f. Functor f => Decorate a b => a -> f b -> f a
functorDecorateFlipped :: forall b a f. Functor f => Decorate b a => f a -> b -> f b
hfoldl :: forall f x a b. HFoldl f x a b => f -> x -> a -> b
hfoldlWithIndex :: forall f x a b. HFoldlWithIndex f x a b => f -> x -> a -> b
index :: forall f a b. Representable f a => f b -> (a -> b)
insert :: forall f a. Container f => Ord a => a -> f a -> f a
mappingWithIndex :: forall f i a b. MappingWithIndex f i a b => f -> i -> a -> b
new2 :: forall b a2 a1 o. o -> a1 -> a2 -> b
option :: forall a m. Alternative m => a -> m a -> m a
replaceInArray :: forall a f. HasUuid a => Functor f => a -> f a -> f a
scalarDiv :: forall f a. Functor f => EuclideanRing a => f a -> a -> f a
Right scalar division
V2 6.0 9.0 ^/ 3.0 = V2 2.0 3.0
scalarL :: forall f a. Functor f => Semiring a => a -> f a -> f a
Left scalar multiplication
3.0 *^ V2 1.0 2.0 = V2 3.0 6.0
scalarR :: forall f a. Functor f => Semiring a => f a -> a -> f a
Right scalar multiplication
V2 1.0 2.0 ^* 3.0 = V2 3.0 6.0
setValM :: forall m el v. MonadEffect m => HTMLValueContainerOp el v => v -> m el -> m el
snoc :: forall f a. Container f => f a -> a -> f a
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.