Prelude
Classes
class Applicative[m: Type -> Type] with Functor[m]
SourceA type class for functors that support application, i.e. allow to:
- Make an applicative value out of a normal value (embed it into a default context), e.g. embed
5
intoSome(5)
. - Apply a function-type applicative to a matching argument-type applicative, resulting in an applicative of the function's result type.
The meaning of the application realized by the ap
function is defined by the respective instance.
Conceptually this can be understood as applying functions "contained" in the first applicative to arguments
in the second applicative, where the possible quantity of functions/arguments depends on the type m
.
For example, an Option[a -> b]
can be None
, or contain a function of type a -> b
, and only in the
latter case a function is applied. A List[a -> b]
is an applicative that contains a list of functions,
which are all to be applied to all arguments contained in the arguments list.
A minimal implementation must define point
and at least one of ap
and map2
(if map2
is implemented,
ap
can be defined based on map2
as shown below). If both ap
and map2
are defined,
they must be equivalent to their default definitions:
ap(f: m[a -> b \ e], x: m[a]): m[b] \ ef = map2(identity, f, x)
map2(f: a -> b -> c \ e, x: m[a], y: m[b]): m[c] \ ef = ap(Functor.map(f, x), y)
Definitions
def map2(f: t1 -> (t2 -> r \ ef), x1: m[t1], x2: m[t2]): m[r] \ ef
Sourcedef map3(f: t1 -> (t2 -> (t3 -> r \ ef)), x1: m[t1], x2: m[t2], x3: m[t3]): m[r] \ ef
SourceLift a ternary function to work on Applicative
s.
Instances can define more efficient implementations than the default implementation
(which is Applicative.ap(Applicative.map2(f, x1, x2), x3)
).
def map4(f: t1 -> (t2 -> (t3 -> (t4 -> r \ ef))), x1: m[t1], x2: m[t2], x3: m[t3], x4: m[t4]): m[r] \ ef
SourceLift a 4-ary function to work on Applicative
s.
Instances can define more efficient implementations than the default implementation
(which is Applicative.ap(Applicative.map3(f, x1, x2, x3), x4)
).
def map5(f: t1 -> (t2 -> (t3 -> (t4 -> (t5 -> r \ ef)))), x1: m[t1], x2: m[t2], x3: m[t3], x4: m[t4], x5: m[t5]): m[r] \ ef
SourceLift a 5-ary function to work on Applicative
s.
Instances can define more efficient implementations than the default implementation
(which is Applicative.ap(Applicative.map3(f, x1, x2, x3), x4)
).
class Collectable[m: Type -> Type]
SourceA class representing collections that can be produced from an Iterator.
class CommutativeGroup[a: Type] with Group[a], CommutativeMonoid[a]
SourceA type class for types that form a commutative group (abelian group)
i.e. groups where the combine
function is commutative.
The default instances for number define the additive inverse in the real numbers.
Instances
instance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance (a1, a2) with CommutativeGroup[a1], CommutativeGroup[a2]
Sourceinstance (a1, a2, a3) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3]
Sourceinstance (a1, a2, a3, a4) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4]
Sourceinstance (a1, a2, a3, a4, a5) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6], CommutativeGroup[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6], CommutativeGroup[a7], CommutativeGroup[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6], CommutativeGroup[a7], CommutativeGroup[a8], CommutativeGroup[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6], CommutativeGroup[a7], CommutativeGroup[a8], CommutativeGroup[a9], CommutativeGroup[a10]
Sourceclass CommutativeMonoid[a: Type] with Monoid[a]
SourceA type class for types that form a commutative monoid.
Definitions
def combine(x: a, y: a): a
SourceAn associative & commutative binary operation on a
.
def empty(_unit: Unit): a
SourceInstances
instance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance (a1, a2) with CommutativeMonoid[a1], CommutativeMonoid[a2]
Sourceinstance (a1, a2, a3) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3]
Sourceinstance (a1, a2, a3, a4) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4]
Sourceinstance (a1, a2, a3, a4, a5) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6], CommutativeMonoid[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6], CommutativeMonoid[a7], CommutativeMonoid[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6], CommutativeMonoid[a7], CommutativeMonoid[a8], CommutativeMonoid[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6], CommutativeMonoid[a7], CommutativeMonoid[a8], CommutativeMonoid[a9], CommutativeMonoid[a10]
Sourceinstance Map[k, v] with Order[k], CommutativeMonoid[v]
Sourceinstance MultiMap[k, v] with Order[k], Order[v]
Sourceinstance Option[a] with CommutativeMonoid[a]
Sourceinstance Any
Sourceinstance All
Sourceinstance Set[a] with Order[a]
Sourceclass CommutativeSemiGroup[a: Type] with SemiGroup[a]
SourceA type class for types that form a commutative semigroup.
Instances
instance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance (a1, a2) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2]
Sourceinstance (a1, a2, a3) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3]
Sourceinstance (a1, a2, a3, a4) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4]
Sourceinstance (a1, a2, a3, a4, a5) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6], CommutativeSemiGroup[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6], CommutativeSemiGroup[a7], CommutativeSemiGroup[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6], CommutativeSemiGroup[a7], CommutativeSemiGroup[a8], CommutativeSemiGroup[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6], CommutativeSemiGroup[a7], CommutativeSemiGroup[a8], CommutativeSemiGroup[a9], CommutativeSemiGroup[a10]
Sourceinstance Map[k, v] with Order[k], CommutativeSemiGroup[v]
Sourceinstance MultiMap[k, v] with Order[k], Order[v]
Sourceinstance Option[a] with CommutativeSemiGroup[a]
Sourceinstance Set[a] with Order[a]
Sourceclass Eq[a: Type]
SourceInstances
instance Boxed
Sourceinstance Chain[a] with Eq[a]
Sourceinstance ViewLeft[t] with Eq[t]
Sourceinstance ViewRight[t] with Eq[t]
Sourceinstance Comparison
Sourceinstance DelayList[a] with Eq[a]
Sourceinstance DelayMap[k, v] with Eq[k], Eq[v]
Sourceinstance Down[a] with Eq[a]
Sourceinstance Unit
Sourceinstance Bool
Sourceinstance Char
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance String
Sourceinstance (a1, a2) with Eq[a1], Eq[a2]
Sourceinstance (a1, a2, a3) with Eq[a1], Eq[a2], Eq[a3]
Sourceinstance (a1, a2, a3, a4) with Eq[a1], Eq[a2], Eq[a3], Eq[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10], Eq[a11]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10], Eq[a11], Eq[a12]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10], Eq[a11], Eq[a12], Eq[a13]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10], Eq[a11], Eq[a12], Eq[a13], Eq[a14]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7], Eq[a8], Eq[a9], Eq[a10], Eq[a11], Eq[a12], Eq[a13], Eq[a14], Eq[a15]
Sourceinstance FileType
Sourceinstance PrecedenceEdge
Sourceinstance VarSym
Sourceinstance RamSym[v]
Sourceinstance RowVar
Sourceinstance PredSym
Sourceinstance Identity[a] with Eq[a]
Sourceinstance List[a] with Eq[a]
Sourceinstance Map[k, v] with Eq[k], Eq[v]
Sourceinstance MultiMap[k, v] with Eq[k], Eq[v]
Sourceinstance Nec[a] with Eq[a]
Sourceinstance ViewLeft[a] with Eq[a]
Sourceinstance ViewRight[a] with Eq[a]
Sourceinstance Nel[a] with Eq[a]
Sourceinstance Option[t] with Eq[t]
Sourceinstance RedBlackTree[k, v] with Eq[k], Eq[v]
Sourceinstance Flag
Sourceinstance Result[e, t] with Eq[e], Eq[t]
Sourceinstance Set[a] with Eq[a]
Sourceinstance Validation[e, t] with Eq[e], Eq[t]
Sourceinstance Vector[a] with Eq[a]
Sourceclass Filterable[m: Type -> Type] with Functor[m]
SourceA type class for filtering container functors.
class Foldable[t: Type -> Type]
SourceA type class for data structures that can be folded.
Signatures
def foldLeft(f: b -> (a -> b \ ef), s: b, t: t[a]): b \ ef
Sourcedef foldRight(f: a -> (b -> b \ ef), s: b, t: t[a]): b \ ef
Sourcedef foldRightWithCont(f: a -> ((Unit -> b \ ef) -> b \ ef), s: b, t: t[a]): b \ ef
SourceDefinitions
def count(f: a -> Bool \ ef, t: t[a]): Int32 \ ef
SourceReturns the number of elements in t
that satisfy the predicate f
.
def dropWhile(f: a -> Bool, t: t[a]): List[a]
SourceReturns t
without the longest prefix that satisfies the predicate f
.
Returns an immutable list.
def exists(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if at least one element in t
satisfies the predicate f
.
Returns false
if t
is empty.
def filter(f: a -> Bool, t: t[a]): List[a]
SourceReturns an immutable list of all the elements in t
that satisfy the predicate f
.
def findLeft(f: a -> Bool \ ef, t: t[a]): Option[a] \ ef
SourceOptionally returns the first element of t
that satisfies the predicate f
when searching from left to right.
Returns None
if t
is empty.
def findRight(f: a -> Bool, t: t[a]): Option[a]
SourceOptionally returns the first element of t
that satisfies the predicate f
when searching from right to left.
Returns None
if t
is empty.
def foldLeftM(f: b -> (a -> m[b] \ ef), s: b, t: t[a]): m[b] \ ef
SourceA monadic version of foldLeft
.
Applies the monadic f
to a start value s
and all elements in t
going
from left to right.
def foldMap(f: a -> b \ ef, t: t[a]): b \ ef
SourceReturns the result of mapping each element and combining the results.
def foldRightM(f: a -> (b -> m[b] \ ef), s: b, t: t[a]): m[b] \ ef
SourceA monadic version of foldRight
.
Applies the monadic f
to a start value s
and all elements in t
going
from right to left.
def forAll(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if all elements in t
satisfy the predicate f
.
Returns true
if t
is empty.
def forEach(f: a -> Unit \ ef, t: t[a]): Unit \ ef
SourceApplies f
to each element in t
.
def forEachM(f: a -> m[b] \ ef, t: t[a]): m[Unit] \ ef
SourceA monadic version of forEach
.
Apply f
to every value in t
. f
is applied for its monadic effect,
the answer it produces is discarded.
def head(t: t[a]): Option[a]
SourceOptionally returns the first element of t
.
Returns None
if t
is empty.
def isEmpty(t: t[a]): Bool
SourceReturns true if and only if t
is empty.
def join(sep: String, t: t[a]): String
SourceReturns the concatenation of the string representation
of each element in t
with sep
inserted between each element.
def joinWith(f: a -> String \ ef, sep: String, t: t[a]): String \ ef
SourceReturns the concatenation of the string representation
of each element in t
according to f
with sep
inserted between each element.
def last(t: t[a]): Option[a]
SourceOptionally returns the last element of t
.
Returns None
if t
is empty.
def length(t: t[a]): Int32
Sourcedef maximum(t: t[a]): Option[a]
SourceOptionally finds the largest element of t
according to the Order
on a
.
Returns None
if t
is empty.
def maximumBy(cmp: a -> (a -> Comparison), t: t[a]): Option[a]
SourceOptionally finds the largest element of t
according to the given comparator cmp
.
Returns None
if t
is empty.
def memberOf(x: a, t: t[a]): Bool
SourceReturns true
if and only if the element x
is in t
.
def minimum(t: t[a]): Option[a]
SourceOptionally finds the smallest element of t
according to the Order
on a
.
Returns None
if t
is empty.
def minimumBy(cmp: a -> (a -> Comparison), t: t[a]): Option[a]
SourceOptionally finds the smallest element of t
according to the given comparator cmp
.
Returns None
if t
is empty.
def reduceLeft(f: a -> (a -> a \ ef), t: t[a]): Option[a] \ ef
SourceOptionally applies f
to all elements in t
going from left to right until a single value is obtained.
Returns None
if t
is empty.
def reduceRight(f: a -> (a -> a \ ef), t: t[a]): Option[a] \ ef
SourceOptionally applies f
to all elements in t
going from right to left until a single value is obtained.
Returns None
if t
is empty.
def sum(t: t[Int32]): Int32
SourceReturns the sum of all elements in t
.
def sumWith(f: a -> Int32 \ ef, t: t[a]): Int32 \ ef
SourceReturns the sum of all elements in t
according to the function f
.
def takeWhile(f: a -> Bool, t: t[a]): List[a]
SourceReturns the longest prefix of t
that satisfies the predicate f
.
Returns an immutable list.
def toArray(rc: Region[r], t: t[a]): Array[a, r] \ r
SourceReturns t
as an array.
def toChain(t: t[a]): Chain[a]
SourceReturns t
as a chain.
def toDelayList(t: t[a]): DelayList[a]
SourceReturns t
as a DelayList
.
def toDelayMap(t: t[(k, v)]): DelayMap[k, v]
SourceReturns t
as a DelayMap
def toList(t: t[a]): List[a]
SourceReturns t
as an immutable list.
def toMap(t: t[(k, v)]): Map[k, v]
SourceReturns t
as a map.
def toMapWith(f: a -> b, s: t[a]): Map[a, b]
SourceReturns a map with elements of s
as keys and f
applied as values.
def toMutDeque(rc: Region[r], t: t[a]): MutDeque[a, r] \ r
SourceReturns t
as a MutDeque
.
def toMutList(rc: Region[r], t: t[a]): MutList[a, r] \ r
SourceReturns t
as a mutable list.
def toMutMap(rc: Region[r], t: t[(k, v)]): MutMap[k, v, r] \ r
SourceReturns t
as a MutMap
.
def toMutSet(rc: Region[r], t: t[a]): MutSet[a, r] \ r
SourceReturns the set s
as a MutSet
.
def toNec(t: t[a]): Option[Nec[a]]
SourceOptionally returns t
as a non empty chain.
def toNel(t: t[a]): Option[Nel[a]]
SourceOptionally returns t
as a non empty list.
def toSet(t: t[a]): Set[a]
SourceReturns t
as a set.
def toVector(t: t[a]): Vector[a]
SourceReturns t
as a vector.
class Functor[m: Type -> Type]
SourceA type class for types that can be mapped over.
Instances
instance Chain
Sourceinstance DelayList
Sourceinstance DelayMap[k]
Sourceinstance Identity
Sourceinstance List
Sourceinstance Map[k]
Sourceinstance Nec
Sourceinstance Nel
Sourceinstance Option
Sourceinstance RedBlackTree[k]
Sourceinstance Result[e]
Sourceinstance Validation[e]
Sourceinstance Vector
Sourceclass Group[a: Type] with Monoid[a]
SourceA type class for types that form a group.
The default instances for numbers define the additive inverse in the real numbers.
Definitions
def combine(x: a, y: a): a
Sourcedef empty(_unit: Unit): a
Sourcedef remove(x: a, y: a): a
SourceReturns y
removed from x
.
Equivalent to Group.combine(x, Group.inverse(y))
Instances
instance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance (a1, a2) with Group[a1], Group[a2]
Sourceinstance (a1, a2, a3) with Group[a1], Group[a2], Group[a3]
Sourceinstance (a1, a2, a3, a4) with Group[a1], Group[a2], Group[a3], Group[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8], Group[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7], Group[a8], Group[a9], Group[a10]
Sourceclass Hash[a: Type]
SourceA type class for types that can be hashed.
Instances
instance Unit
Sourceinstance Bool
Sourceinstance Char
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance String
Sourceinstance BigInt
Sourceinstance (a1, a2) with Hash[a1], Hash[a2]
Sourceinstance (a1, a2, a3) with Hash[a1], Hash[a2], Hash[a3]
Sourceinstance (a1, a2, a3, a4) with Hash[a1], Hash[a2], Hash[a3], Hash[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6], Hash[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6], Hash[a7], Hash[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6], Hash[a7], Hash[a8], Hash[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6], Hash[a7], Hash[a8], Hash[a9], Hash[a10]
Sourceinstance Identity[a] with Hash[a]
Sourceinstance List[a] with Hash[a]
Sourceinstance Map[k, v] with Hash[k], Hash[v]
Sourceinstance MultiMap[k, v] with Hash[k], Hash[v]
Sourceinstance Nec[a] with Hash[a]
Sourceinstance Nel[a] with Hash[a]
Sourceinstance Option[a] with Hash[a]
Sourceinstance Result[e, t] with Hash[e], Hash[t]
Sourceinstance Set[a] with Hash[a]
Sourceinstance Validation[e, t] with Hash[e], Hash[t]
Sourceinstance Vector[a] with Hash[a]
Sourceclass Iterable[t: Type -> Type]
SourceA type class for immutable data structures that can be iterated.
class JoinLattice[a: Type] with PartialOrder[a]
SourceInstances
instance Down[a] with MeetLattice[a]
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance (a1, a2) with JoinLattice[a1], JoinLattice[a2]
Sourceinstance (a1, a2, a3) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3]
Sourceinstance (a1, a2, a3, a4) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4]
Sourceinstance (a1, a2, a3, a4, a5) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6], JoinLattice[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6], JoinLattice[a7], JoinLattice[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6], JoinLattice[a7], JoinLattice[a8], JoinLattice[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6], JoinLattice[a7], JoinLattice[a8], JoinLattice[a9], JoinLattice[a10]
Sourceinstance Map[k, v] with Order[k], Eq[v], JoinLattice[v]
Sourceinstance Option[t] with JoinLattice[t]
Sourceinstance Set[a] with Order[a]
Sourceclass LowerBound[a: Type]
SourceA type class for partially ordered types that have a lower bound.
Instances
instance Bool
Sourceinstance Char
Sourceinstance Down[a] with UpperBound[a]
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance Int8
Sourceinstance (a1, a2) with LowerBound[a1], LowerBound[a2]
Sourceinstance (a1, a2, a3) with LowerBound[a1], LowerBound[a2], LowerBound[a3]
Sourceinstance (a1, a2, a3, a4) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4]
Sourceinstance (a1, a2, a3, a4, a5) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6], LowerBound[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6], LowerBound[a7], LowerBound[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6], LowerBound[a7], LowerBound[a8], LowerBound[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6], LowerBound[a7], LowerBound[a8], LowerBound[a9], LowerBound[a10]
Sourceinstance Unit
Sourceinstance Map[k, v]
Sourceinstance Option[t]
Sourceinstance Set[a]
Sourceclass MeetLattice[a: Type] with PartialOrder[a]
SourceInstances
instance Down[a] with JoinLattice[a]
Sourceinstance Map[k, v] with Order[k], Eq[v], MeetLattice[v]
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance (a1, a2) with MeetLattice[a1], MeetLattice[a2]
Sourceinstance (a1, a2, a3) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3]
Sourceinstance (a1, a2, a3, a4) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4]
Sourceinstance (a1, a2, a3, a4, a5) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6], MeetLattice[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6], MeetLattice[a7], MeetLattice[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6], MeetLattice[a7], MeetLattice[a8], MeetLattice[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6], MeetLattice[a7], MeetLattice[a8], MeetLattice[a9], MeetLattice[a10]
Sourceinstance Option[t] with MeetLattice[t]
Sourceinstance Set[a] with Order[a]
Sourceclass Monad[m: Type -> Type] with Applicative[m]
SourceA type class for applicatives that support monadic bind (flatMap
), i.e., allow to apply a function
that takes a normal value and produces a monadic value to a monadic value. That is, the bind mechanism
supports extraction of monadic values, or, viewed differently, allows to combine (flatten) nested
monadic values (flapMap
can be understood as a Functor.map
followed by a flatten
).
class MonadZero[m: Type -> Type] with Monad[m]
SourceA type class for Monads that have a zero element.
class MonadZip[m: Type -> Type] with Monad[m]
SourceA type class for zipping Monads, typically container monads like List
.
A minimal implementation must define zipWith
and zipWithA
.
Signatures
def zipWith(f: a -> (b -> c \ ef), ma: m[a], mb: m[b]): m[c] \ ef
Sourcedef zipWithA(f: a -> (b -> f[c] \ ef), ma: m[a], mb: m[b]): f[m[c]] \ ef
SourceGeneralized version of zipWith
where f
zips an applicative functor across the
(monadic) containers ma
and mb
.
class Monoid[a: Type] with SemiGroup[a]
SourceA type class for Monoids, objects that support an associative binary
operation combine
and neutral element empty
.
Instances
instance Chain[a]
Sourceinstance DelayList[a]
Sourceinstance PrecedenceGraph
Sourceinstance Identity[a] with Monoid[a]
Sourceinstance List[a]
Sourceinstance Map[k, v] with Order[k], Monoid[v]
Sourceinstance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance String
Sourceinstance (a1, a2) with Monoid[a1], Monoid[a2]
Sourceinstance (a1, a2, a3) with Monoid[a1], Monoid[a2], Monoid[a3]
Sourceinstance (a1, a2, a3, a4) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6], Monoid[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6], Monoid[a7], Monoid[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6], Monoid[a7], Monoid[a8], Monoid[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6], Monoid[a7], Monoid[a8], Monoid[a9], Monoid[a10]
Sourceinstance MultiMap[k, v] with Order[k], Order[v]
Sourceinstance Option[a] with Monoid[a]
Sourceinstance Any
Sourceinstance All
Sourceinstance Set[a] with Order[a]
Sourceinstance Validation[e, t] with Monoid[t]
Sourceinstance Vector[a]
Sourceclass Order[a: Type] with Eq[a]
SourceDefinitions
def greater(x: a, y: a): Bool
SourceReturns true
if and only if x > y
.
def greaterEqual(x: a, y: a): Bool
SourceReturns true
if and only if x >= y
.
def less(x: a, y: a): Bool
Sourcedef lessEqual(x: a, y: a): Bool
SourceReturns true
if and only if x <= y
.
def max(x: a, y: a): a
SourceReturns the maximum of x
and y
.
def min(x: a, y: a): a
SourceReturns the minimum of x
and y
.
Instances
instance Boxed
Sourceinstance Chain[a] with Order[a]
Sourceinstance DelayList[a] with Order[a]
Sourceinstance DelayMap[k, v] with Order[k], Order[v]
Sourceinstance Down[a] with Order[a]
Sourceinstance FileType
Sourceinstance PrecedenceEdge
Sourceinstance VarSym
Sourceinstance RamSym[v]
Sourceinstance RowVar
Sourceinstance PredSym
Sourceinstance Identity[a] with Order[a]
Sourceinstance List[a] with Order[a]
Sourceinstance Map[k, v] with Order[k], Order[v]
Sourceinstance MultiMap[k, v] with Order[k], Order[v]
Sourceinstance Nec[a] with Order[a]
Sourceinstance Nel[a] with Order[a]
Sourceinstance Option[t] with Order[t]
Sourceinstance Unit
Sourceinstance Bool
Sourceinstance Char
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance String
Sourceinstance (a1, a2) with Order[a1], Order[a2]
Sourceinstance (a1, a2, a3) with Order[a1], Order[a2], Order[a3]
Sourceinstance (a1, a2, a3, a4) with Order[a1], Order[a2], Order[a3], Order[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10], Order[a11]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10], Order[a11], Order[a12]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10], Order[a11], Order[a12], Order[a13]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10], Order[a11], Order[a12], Order[a13], Order[a14]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7], Order[a8], Order[a9], Order[a10], Order[a11], Order[a12], Order[a13], Order[a14], Order[a15]
Sourceinstance Flag
Sourceinstance Result[e, t] with Order[e], Order[t]
Sourceinstance Set[a] with Order[a]
Sourceinstance Validation[e, t] with Order[e], Order[t]
Sourceinstance Vector[a] with Order[a]
Sourceclass PartialOrder[a: Type]
SourceInstances
instance Down[a] with PartialOrder[a]
Sourceinstance Map[k, v] with Order[k], Eq[v]
Sourceinstance Option[t] with PartialOrder[t]
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance (a1, a2) with PartialOrder[a1], PartialOrder[a2]
Sourceinstance (a1, a2, a3) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3]
Sourceinstance (a1, a2, a3, a4) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4]
Sourceinstance (a1, a2, a3, a4, a5) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6], PartialOrder[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6], PartialOrder[a7], PartialOrder[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6], PartialOrder[a7], PartialOrder[a8], PartialOrder[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6], PartialOrder[a7], PartialOrder[a8], PartialOrder[a9], PartialOrder[a10]
Sourceinstance Set[a] with Order[a]
Sourceclass Reducible[t: Type -> Type]
SourceA type class for types that can be reduced to a summary value.
Reducible
is like a non-empty Foldable
and may only be implemented on non-empty data structures.
Signatures
def reduceLeftTo(f: b -> (a -> b \ ef1), g: a -> b \ ef2, t: t[a]): b \ ef1 + ef2
Sourcedef reduceRightTo(f: a -> (b -> b \ ef1), g: a -> b \ ef2, t: t[a]): b \ ef1 + ef2
SourceDefinitions
def count(f: a -> Bool \ ef, t: t[a]): Int32 \ ef
SourceReturns the number of elements in t
that satisfy the predicate f
.
def dropWhile(f: a -> Bool \ ef, t: t[a]): List[a] \ ef
SourceReturns t
as a list without the longest prefix that satisfies the predicate f
.
def exists(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if at least one element in t
satisfies the predicate f
.
def find(f: a -> Bool \ ef, t: t[a]): Option[a] \ ef
SourceAlias for findLeft
.
Optionally returns the first element of t
that satisfies the predicate f
when searching from left to right.
def findLeft(f: a -> Bool \ ef, t: t[a]): Option[a] \ ef
SourceOptionally returns the first element of t
that satisfies the predicate f
when searching from left to right.
def findRight(f: a -> Bool \ ef, t: t[a]): Option[a] \ ef
SourceOptionally returns the first element of t
that satisfies the predicate f
when searching from right to left.
def fold(t: t[a]): a
SourceAlias for reduce
.
Reduce t
using the derived SemiGroup
instance.
def foldLeft(f: b -> (a -> b \ ef), s: b, t: t[a]): b \ ef
SourceLeft-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from left to right.
def foldRight(f: a -> (b -> b \ ef), s: b, t: t[a]): b \ ef
SourceRight-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from right to left.
def foldRightWithCont(f: a -> ((Unit -> b \ ef) -> b \ ef), z: b, t: t[a]): b \ ef
SourceRight-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from right to left.
A foldRightWithCont
allows early termination by not calling the continuation.
def forAll(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if all elements in t
satisfy the predicate f
.
def forEach(f: a -> Unit \ ef, t: t[a]): Unit \ ef
SourceApplies f
to each element in t
.
def head(t: t[a]): a
SourceReturns the first element of t
.
def init(t: t[a]): List[a]
SourceReturns t
as a list without the last element.
def intersperse(a: a, t: t[a]): List[a]
SourceReturns t
as a list with a
inserted between every two adjacent elements.
def last(t: t[a]): a
SourceReturns the last element of t
.
def length(t: t[a]): Int32
SourceReturns the number of elements in t
.
def maximum(t: t[a]): a
SourceFinds the largest element of t
according to the Order
on a
.
def maximumBy(cmp: a -> (a -> Comparison), t: t[a]): a
SourceFinds the largest element of t
according to the given comparator cmp
.
def memberOf(a: a, t: t[a]): Bool
SourceReturns true
if and only if the element a
is in t
.
def minimum(t: t[a]): a
SourceFinds the smallest element of t
according to the Order
on a
.
def minimumBy(cmp: a -> (a -> Comparison), t: t[a]): a
SourceFinds the smallest element of t
according to the given comparator cmp
.
def reduce(t: t[a]): a
SourceReduce t
using the derived SemiGroup
instance.
def reduceLeft(f: a -> (a -> a \ ef), t: t[a]): a \ ef
Sourcedef reduceMap(f: a -> b \ ef, t: t[a]): b \ ef
SourceApplies f
to each element of t
and combines them using the derived SemiGroup
instance.
def reduceRight(f: a -> (a -> a \ ef), t: t[a]): a \ ef
SourceRight-associative reduction on t
using f
.
def reverse(t: t[a]): List[a]
SourceReturns the reverse of t
as a list.
def sum(t: t[Int32]): Int32
SourceReturns the sum of all elements in t
.
def sumWith(f: a -> Int32 \ ef, t: t[a]): Int32 \ ef
SourceReturns the sum of all elements in t
according to the function f
.
def tail(t: t[a]): List[a]
SourceReturns the tail of t
as a list.
def takeWhile(f: a -> Bool \ ef, t: t[a]): List[a] \ ef
SourceReturns the longest prefix of t
as a list that satisfies the predicate f
.
def toArray(rc: Region[r], t: t[a]): Array[a, r] \ r
SourceReturns t
as an array.
def toList(t: t[a]): List[a]
SourceReturns t
as a list.
def toMap(t: t[(k, v)]): Map[k, v]
SourceReturns t
as a map.
def toNel(t: t[a]): Nel[a]
SourceReturns t
as a non-empty list.
def toSet(t: t[a]): Set[a]
SourceReturns t
as a set.
def toVector(t: t[a]): Vector[a]
SourceReturns t
as a vector.
class SemiGroup[a: Type]
SourceA type class for types that form a semigroup.
Instances
instance Chain[a]
Sourceinstance DelayList[a]
Sourceinstance PrecedenceGraph
Sourceinstance Identity[a] with SemiGroup[a]
Sourceinstance List[a]
Sourceinstance Map[k, v] with Order[k], SemiGroup[v]
Sourceinstance MultiMap[k, v] with Order[k], Order[v]
Sourceinstance Nec[a]
Sourceinstance Nel[a]
Sourceinstance Option[a] with SemiGroup[a]
Sourceinstance Unit
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance String
Sourceinstance (a1, a2) with SemiGroup[a1], SemiGroup[a2]
Sourceinstance (a1, a2, a3) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3]
Sourceinstance (a1, a2, a3, a4) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4]
Sourceinstance (a1, a2, a3, a4, a5) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6], SemiGroup[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6], SemiGroup[a7], SemiGroup[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6], SemiGroup[a7], SemiGroup[a8], SemiGroup[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6], SemiGroup[a7], SemiGroup[a8], SemiGroup[a9], SemiGroup[a10]
Sourceinstance Any
Sourceinstance All
Sourceinstance Set[a] with Order[a]
Sourceinstance Validation[e, t] with SemiGroup[t]
Sourceinstance Vector[a]
Sourceclass Sendable[a: Type]
SourceA type class for types that can be passed to Channel.send
.
Instances
instance Boxed
Sourceinstance Chain[t] with Sendable[t]
Sourceinstance Comparison
Sourceinstance DelayList[a] with Sendable[a]
Sourceinstance DelayMap[k, v] with Sendable[k], Sendable[v]
Sourceinstance Down[a] with Sendable[a]
Sourceinstance Identity[a] with Sendable[a]
Sourceinstance List[t] with Sendable[t]
Sourceinstance Map[k, v] with Sendable[k], Sendable[v]
Sourceinstance MultiMap[k, v] with Sendable[k], Sendable[v]
Sourceinstance Nec[t] with Sendable[t]
Sourceinstance Nel[a] with Sendable[a]
Sourceinstance Option[t] with Sendable[t]
Sourceinstance RedBlackTree[k, v] with Sendable[k], Sendable[v]
Sourceinstance Result[e, t] with Sendable[e], Sendable[t]
Sourceinstance Unit
Sourceinstance Bool
Sourceinstance Char
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance BigDecimal
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance BigInt
Sourceinstance String
Sourceinstance (a1, a2) with Sendable[a1], Sendable[a2]
Sourceinstance (a1, a2, a3) with Sendable[a1], Sendable[a2], Sendable[a3]
Sourceinstance (a1, a2, a3, a4) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4]
Sourceinstance (a1, a2, a3, a4, a5) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10], Sendable[a11]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10], Sendable[a11], Sendable[a12]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10], Sendable[a11], Sendable[a12], Sendable[a13]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10], Sendable[a11], Sendable[a12], Sendable[a13], Sendable[a14]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7], Sendable[a8], Sendable[a9], Sendable[a10], Sendable[a11], Sendable[a12], Sendable[a13], Sendable[a14], Sendable[a15]
Sourceinstance Set[t] with Sendable[t]
Sourceinstance Validation[e, t] with Sendable[e], Sendable[t]
Sourceclass ToString[a: Type]
SourceA type class for types that can be converted to strings.
Instances
instance Boxed
Sourceinstance Chain[a] with ToString[a]
Sourceinstance Comparison
Sourceinstance DelayList[a] with ToString[a]
Sourceinstance DelayMap[k, v] with ToString[k], ToString[v]
Sourceinstance Down[a] with ToString[a]
Sourceinstance FileType
Sourceinstance BodyPredicate[v]
Sourceinstance BodyTerm[v]
Sourceinstance Constraint[v]
Sourceinstance Datalog[v]
Sourceinstance HeadPredicate[v]
Sourceinstance HeadTerm[v]
Sourceinstance VarSym
Sourceinstance BoolExp[v]
Sourceinstance RamStmt[v]
Sourceinstance RamSym[v]
Sourceinstance RamTerm[v]
Sourceinstance RelOp[v]
Sourceinstance RowVar
Sourceinstance PredSym
Sourceinstance Identity[a] with ToString[a]
Sourceinstance List[a] with ToString[a]
Sourceinstance Map[k, v] with ToString[k], ToString[v]
Sourceinstance MultiMap[k, v] with ToString[k], ToString[v]
Sourceinstance Nec[a] with ToString[a]
Sourceinstance Nel[a] with ToString[a]
Sourceinstance Option[t] with ToString[t]
Sourceinstance Flag
Sourceinstance Result[e, t] with ToString[e], ToString[t]
Sourceinstance Set[a] with ToString[a]
Sourceinstance Instant
Sourceinstance Unit
Sourceinstance Bool
Sourceinstance Char
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance Int8
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance String
Sourceinstance BigInt
Sourceinstance BigDecimal
Sourceinstance Regex
Sourceinstance (a1, a2) with ToString[a1], ToString[a2]
Sourceinstance (a1, a2, a3) with ToString[a1], ToString[a2], ToString[a3]
Sourceinstance (a1, a2, a3, a4) with ToString[a1], ToString[a2], ToString[a3], ToString[a4]
Sourceinstance (a1, a2, a3, a4, a5) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10], ToString[a11]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10], ToString[a11], ToString[a12]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10], ToString[a11], ToString[a12], ToString[a13]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10], ToString[a11], ToString[a12], ToString[a13], ToString[a14]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7], ToString[a8], ToString[a9], ToString[a10], ToString[a11], ToString[a12], ToString[a13], ToString[a14], ToString[a15]
Sourceinstance Validation[e, t] with ToString[e], ToString[t]
Sourceinstance Vector[a] with ToString[a]
SourceA Vector data type which is fundamentally like Array but is immutable.
class Traversable[t: Type -> Type] with Functor[t], Foldable[t]
SourceA type class for data structures that can be traversed in left-to-right order with an applicative functor.
Definitions
def sequence(t: t[m[a]]): m[t[a]]
SourceReturns the result of running all the actions in the data structure t
.
class UnorderedFoldable[t: Type -> Type]
SourceA type class for unordered data structures that can be folded.
Definitions
def count(f: a -> Bool \ ef, t: t[a]): Int32 \ ef
SourceReturns the number of elements in t
that satisfy the predicate f
.
def exists(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if at least one element in t
satisfies the predicate f
.
Returns false
if t
is empty.
def fold(t: t[a]): a
SourceReturns the result of applying CommutativeMonoid.combine
to all the elements in t
.
def forAll(f: a -> Bool \ ef, t: t[a]): Bool \ ef
SourceReturns true
if and only if all elements in t
satisfy the predicate f
.
Returns true
if t
is empty.
def isEmpty(t: t[a]): Bool
SourceReturns true if and only if t
is empty.
def memberOf(x: a, t: t[a]): Bool
SourceReturns true
if and only if the element x
is in t
.
def size(t: t[a]): Int32
SourceReturns the number of elements in t
.
class UpperBound[a: Type]
SourceA type class for partially ordered types that have an upper bound.
Instances
instance Bool
Sourceinstance Char
Sourceinstance Down[a] with LowerBound[a]
Sourceinstance Float32
Sourceinstance Float64
Sourceinstance Int16
Sourceinstance Int32
Sourceinstance Int64
Sourceinstance Int8
Sourceinstance (a1, a2) with UpperBound[a1], UpperBound[a2]
Sourceinstance (a1, a2, a3) with UpperBound[a1], UpperBound[a2], UpperBound[a3]
Sourceinstance (a1, a2, a3, a4) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4]
Sourceinstance (a1, a2, a3, a4, a5) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5]
Sourceinstance (a1, a2, a3, a4, a5, a6) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6], UpperBound[a7]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6], UpperBound[a7], UpperBound[a8]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6], UpperBound[a7], UpperBound[a8], UpperBound[a9]
Sourceinstance (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6], UpperBound[a7], UpperBound[a8], UpperBound[a9], UpperBound[a10]
Sourceinstance Unit
Sourceclass Witherable[t: Type -> Type] with Traversable[t], Filterable[t]
SourceA type class for data structures that can be traversed in left-to-right order with an applicative partial functor.
Effects
eff IO
SourceThe Generic IO Effect.
The IO
effect is the most general effect of any
operation that interacts with the environment.
eff NonDet
SourceEnums
enum Benchmark
Sourcecase Benchmark({ f = Unit -> Unit \ IO, name = String })
A benchmark has a name and a function to execute. The function is always impure since timing is considered a side-effect in this context.
enum Boxed with Sendable
Sourcecase BoxedBool(Bool)
case BoxedChar(Char)
case BoxedInt8(Int8)
case BoxedInt16(Int16)
case BoxedInt32(Int32)
case BoxedInt64(Int64)
case BoxedFloat32(Float32)
case BoxedFloat64(Float64)
case BoxedObject(Object, Object -> (Object -> Comparison))
Represents a boxed value.
enum Chain[t: Type] with Sendable
Sourcecase Empty(Unit)
case One(t)
case Chain(Chain[t], Chain[t])
The Chain type.
A chain is a list represented as an unbalanced binary tree. It supports efficient append and "snoc" - appending elements at the tail of the list.
Note - the constructors Empty
, One
and Chain
should not be used directly.
enum Comparison with Eq, ToString, Sendable
Sourcecase LessThan(Unit)
case EqualTo(Unit)
case GreaterThan(Unit)
enum DelayList[a: Type] with Sendable
Sourcecase ENil(Unit)
case ECons(a, DelayList[a])
case LCons(a, Lazy[DelayList[a]])
case LList(Lazy[DelayList[a]])
enum Down[a: Type] with Sendable
Sourcecase Down(a)
The Down
type allows you to reverse the sort order of a
conveniently.
enum Identity[a: Type] with Eq, Order, ToString, Hash, Sendable
Sourcecase Identity(a)
The Identity Functor / Monad.
enum List[t: Type] with Sendable
Sourcecase Nil(Unit)
case Cons(t, List[t])
The List type.
A list is either the empty list represented by Nil
, or
an element v
followed by a list vs
represented by v :: vs
.
enum Map[k: Type, v: Type] with Sendable
Sourcecase Map(RedBlackTree[k, v])
The Map type.
A map is currently represented internally as a red-black tree.
enum MultiMap[k: Type, v: Type] with Sendable
Sourcecase MultiMap(Map[k, Set[v]])
The MultiMap type.
A MultiMap is a Map that allows multiple values for a key. Multiple values are stored in a Set so duplicates are not allowed.
The key and value types must implement the Eq and Order type classes.
enum MutDeque[a: Type, r: Eff]
Sourcecase MutDeque(Region[r], Ref[Array[a, r], r], Ref[Int32, r], Ref[Int32, r])
Represents a mutable deque.
Explanation of component types (from left to right): The 1st component is a reference the backing array. The 2nd component is a reference to the front index. The 3rd component is a reference to the back index.
If front == back then the deque is empty. Otherwise, the front index always points to an element (going counter-clockwise) and the back index always points to the first empty index (going clockwise).
enum MutList[a: Type, r: Eff]
Sourcecase MutList(Region[r], Ref[Array[a, r], r], Ref[Int32, r])
Represents a mutable list.
Invariant - The length is always higher than the total capacity of the array. - The capacity of the array is always 8 or more.
enum MutMap[k: Type, v: Type, r: Eff]
Sourcecase MutMap(Region[r], Ref[Map[k, v], r])
The Mutable Map type.
enum MutPriorityQueue[a: Type, r: Eff]
Sourcecase MutPriorityQueue(Region[r], Ref[Array[a, r], r], Ref[Int32, r])
Represents a mutable priority queue. Explanation of component types (left to right): Component 1: The region capability the queue is associated with. Component 2: A reference to the backing array. Component 3: A reference to the number of elements in the mutable priority queue.
The maximum element (if it exists) can always be accessed in constant time.
enum Nec[t: Type] with Sendable
Sourcecase NecOne(t)
case Nec(Nec[t], Nec[t])
The NonEmpty Chain type.
A chain is a list represented as an unbalanced binary tree. It supports efficient append and "snoc" - appending elements at the tail of the list.
Note - the constructors NecOne
and Nec
should not be used directly.
enum Option[t: Type] with Eq, Order, ToString, Sendable
Sourcecase None(Unit)
case Some(t)
The Option type.
An option represents an optional value.
The constructor None
represents an absent value,
whereas the constructor Some(v)
represents the value v
.
enum RedBlackTree[k: Type, v: Type] with Sendable
Sourcecase Leaf(Unit)
case DoubleBlackLeaf(Unit)
case Node(Color, RedBlackTree[k, v], k, v, RedBlackTree[k, v])
An immutable red-black tree implementation with keys
of type k
and values of type v
.
A red-black tree is a self-balancing binary search tree. Each node is either red or black, although a transitory color double-black is allowed during deletion. The red-black tree satisfy the following invariants.
- For all nodes with key
x
, the left subtree contains only nodes with keysy
< `x` and the right subtree contains only nodes with keys `z` >x
. - No red node has a red parent.
- Every path from the root to a leaf contains the same number of black nodes.
@MustUse
enum Result[e: Type, t: Type] with Eq, Order, ToString, Sendable
Sourcecase Ok(t)
case Err(e)
The Result type.
A result represents a successful value or an error value.
The constructor Ok(v)
represents the successful value v
,
whereas the constructor Err(v)
represents the error value v
.
enum Set[t: Type] with Sendable
Sourcecase Set(RedBlackTree[t, Unit])
The Set type.
A set is currently represented internally as a red-black tree.
@MustUse
enum Validation[e: Type, t: Type] with Eq, Order, ToString, Sendable
Sourcecase Success(t)
case Failure(Nec[e])
The Validation type.
Type Aliases
Definitions
def !>(x: a, f: a -> Unit \ ef): a \ ef
SourcePipes the given value x
into the function f
.
Given a value x
and a function f
returns x
.
def >>(f: a -> b \ ef1, g: b -> c \ ef2): a -> c \ ef1 + ef2
SourceForwards function composition. Applies the function on the left first.
Given the functions f: a -> b
and g: b -> c
returns a function a -> c
def debug(x: a): a
SourcePrints the stringified representation of x
.
WARNING: The debug function is pure hence if the result is unused it may be removed by the compiler!
def debug!(x: a): a
SourcePrints the stringified representation of x
.
WARNING: The debug function is pure hence if the result is unused it may be removed by the compiler!
def debug!!(x: a): a
SourcePrints the stringified representation of x
.
WARNING: The debug function is pure hence if the result is unused it may be removed by the compiler!
def flip(f: a -> (b -> c \ ef)): b -> (a -> c \ ef)
SourceReturns the function f
with input arguments swapped.
That is, given the function f: (a, b) -> c
, returns a function (b, a) -> c
def identity(x: a): a \ ef
Sourcedef on(f: b -> (b -> c \ ef1), g: a -> b \ ef2, x: a, y: a): c \ ef1 + ef2
SourcePartially applying this function in the form f `on` g
lifts the binary function f
to work on
inputs transformed by g
.
def println(x: a): Unit \ IO
SourceConverts x
to a string and prints it to standard out followed by a new line.
def swap(p: (a, b)): (b, a)
SourceReturns the pair p
with the components swapped.
That is, returns (y, x)
if p = (x, y)
.
def |>(x: a, f: a -> b \ ef): b \ ef
SourcePipes the given value x
into the function f
.
Given a value x
and a function f
returns f(x)
.
def ||>(x: (a, b), f: a -> (b -> c \ ef)): c \ ef
SourcePipes the given pair x
into the function f
.
Given a pair x
and a function f
returns f(x)
.