Search results
padl :: Int -> Char -> String -> String
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
replicate :: forall f a. Unfoldable f => Int -> a -> f a
Replicate a value some natural number of times. For example:
replicate 2 "foo" == (["foo", "foo"] :: Array String)
replicate1 :: forall f a. Unfoldable1 f => Int -> a -> f a
Replicate a value n
times. At least one value will be produced, so values
n
less than 1 will be treated as 1.
replicate1 2 "foo" == (NEL.cons "foo" (NEL.singleton "foo") :: NEL.NonEmptyList String)
replicate1 0 "foo" == (NEL.singleton "foo" :: NEL.NonEmptyList String)
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
addLeadingZeros :: forall a. Elastic a => Int -> a -> a
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
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
new2 :: forall b a2 a1 o. o -> a1 -> a2 -> b
offset :: forall q sql. ToOffset q => Resume q (Offset E) sql => Int -> q -> sql
OFFSET statement
Note: OFFSET must always follow after LIMIT or ORDER BY
replicate :: forall f a. Container f => Int -> a -> f a
setUuid :: forall m. HasUuid m => Int -> m -> m
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
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.
create :: forall buf m. MutableBuffer buf m => Int -> m buf
Creates a new buffer of the specified size.
sans :: forall m a b. At m a b => a -> m -> m
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
fromInt :: forall a. IntLiftable a => Int -> a
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
.
join :: forall a. JoinSemilattice a => a -> a -> a
meet :: forall a. MeetSemilattice a => a -> a -> a
pathAppend :: forall m. XPathLike m => m -> m -> m
Put a path seperator between two XPaths and return the resulting XPath.
pathAppendNSx :: forall m. XPathLike m => m -> m -> m
Useful variant of pathAppend
needed for some XPath implementations;
insert a separator with a dummy namespace ("x") for the second XPath
fragment. For example:
root /? "record" /? "identifier" == "/x:record/x:identifier"
.