Prelude

Classes

class Add[a: Type]Source

A type class for addition.

Signatures

def add(x: a, y: a): aSource

Instances

instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
instance Down[a] with Add[a]Source
instance Identity[a] with Add[a]Source
class Applicative[m: Type -> Type] with Functor[m]Source

A 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 into Some(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)

Signatures

def ap(f: m[a -> b \ ef], x: m[a]): m[b] \ efSource
def point(x: a): m[a]Source

Definitions

def map2(f: t1 -> (t2 -> r \ ef), x1: m[t1], x2: m[t2]): m[r] \ efSource
def map3(f: t1 -> (t2 -> (t3 -> r \ ef)), x1: m[t1], x2: m[t2], x3: m[t3]): m[r] \ efSource

Lift a ternary function to work on Applicatives. 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] \ efSource

Lift a 4-ary function to work on Applicatives. 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] \ efSource

Lift a 5-ary function to work on Applicatives. Instances can define more efficient implementations than the default implementation (which is Applicative.ap(Applicative.map3(f, x1, x2, x3), x4)).

Instances

instance ChainSource
instance DelayListSource
instance IdentitySource
instance ListSource
instance NecSource
instance NelSource
instance OptionSource
instance Result[e]Source
instance Validation[e]Source
instance VectorSource
class Closeable[a: Type]Source

A type class for types that can be closed.

Signatures

def close(x: a): Unit \ IOSource
class Collectable[m: Type -> Type]Source

A class representing collections that can be produced from an Iterator.

Signatures

def collect(iter: Iterator[a, ef, r]): m[a] \ ef + rSource

Instances

instance ChainSource
instance ListSource
instance SetSource
instance VectorSource
class CommutativeGroup[a: Type] with Group[a], CommutativeMonoid[a]Source

A 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 UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance (a1, a2) with CommutativeGroup[a1], CommutativeGroup[a2]Source
instance (a1, a2, a3) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3]Source
instance (a1, a2, a3, a4) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4]Source
instance (a1, a2, a3, a4, a5) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5]Source
instance (a1, a2, a3, a4, a5, a6) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with CommutativeGroup[a1], CommutativeGroup[a2], CommutativeGroup[a3], CommutativeGroup[a4], CommutativeGroup[a5], CommutativeGroup[a6], CommutativeGroup[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
class CommutativeMonoid[a: Type] with Monoid[a]Source

A type class for types that form a commutative monoid.

Definitions

def combine(x: a, y: a): aSource

An associative & commutative binary operation on a.

def empty(_unit: Unit): aSource

Instances

instance UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance (a1, a2) with CommutativeMonoid[a1], CommutativeMonoid[a2]Source
instance (a1, a2, a3) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3]Source
instance (a1, a2, a3, a4) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4]Source
instance (a1, a2, a3, a4, a5) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5]Source
instance (a1, a2, a3, a4, a5, a6) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with CommutativeMonoid[a1], CommutativeMonoid[a2], CommutativeMonoid[a3], CommutativeMonoid[a4], CommutativeMonoid[a5], CommutativeMonoid[a6], CommutativeMonoid[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Map[k, v] with Order[k], CommutativeMonoid[v]Source
instance MultiMap[k, v] with Order[k], Order[v]Source
instance Option[a] with CommutativeMonoid[a]Source
instance AnySource
instance AllSource
instance Set[a] with Order[a]Source
class CommutativeSemiGroup[a: Type] with SemiGroup[a]Source

A type class for types that form a commutative semigroup.

Definitions

def combine(x: a, y: a): aSource

Instances

instance UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance (a1, a2) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2]Source
instance (a1, a2, a3) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3]Source
instance (a1, a2, a3, a4) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4]Source
instance (a1, a2, a3, a4, a5) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5]Source
instance (a1, a2, a3, a4, a5, a6) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with CommutativeSemiGroup[a1], CommutativeSemiGroup[a2], CommutativeSemiGroup[a3], CommutativeSemiGroup[a4], CommutativeSemiGroup[a5], CommutativeSemiGroup[a6], CommutativeSemiGroup[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Map[k, v] with Order[k], CommutativeSemiGroup[v]Source
instance MultiMap[k, v] with Order[k], Order[v]Source
instance Option[a] with CommutativeSemiGroup[a]Source
instance Set[a] with Order[a]Source
class Div[a: Type]Source

A type class for division.

Signatures

def div(x: a, y: a): aSource

Instances

instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
instance Identity[a] with Div[a]Source
class Eq[a: Type]Source

Signatures

def eq(x: a, y: a): BoolSource

Definitions

def neq(x: a, y: a): BoolSource

Instances

instance BoxedSource
instance Chain[a] with Eq[a]Source
instance ViewLeft[t] with Eq[t]Source
instance ViewRight[t] with Eq[t]Source
instance ComparisonSource
instance DelayList[a] with Eq[a]Source
instance DelayMap[k, v] with Eq[k], Eq[v]Source
instance Down[a] with Eq[a]Source
instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
instance (a1, a2) with Eq[a1], Eq[a2]Source
instance (a1, a2, a3) with Eq[a1], Eq[a2], Eq[a3]Source
instance (a1, a2, a3, a4) with Eq[a1], Eq[a2], Eq[a3], Eq[a4]Source
instance (a1, a2, a3, a4, a5) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Eq[a1], Eq[a2], Eq[a3], Eq[a4], Eq[a5], Eq[a6], Eq[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance FileTypeSource
instance PrecedenceEdgeSource
instance VarSymSource
instance RamSym[v]Source
instance RowVarSource
instance PredSymSource
instance Identity[a] with Eq[a]Source
instance List[a] with Eq[a]Source
instance Map[k, v] with Eq[k], Eq[v]Source
instance MultiMap[k, v] with Eq[k], Eq[v]Source
instance Nec[a] with Eq[a]Source
instance ViewLeft[a] with Eq[a]Source
instance ViewRight[a] with Eq[a]Source
instance Nel[a] with Eq[a]Source
instance Option[t] with Eq[t]Source
instance RedBlackTree[k, v] with Eq[k], Eq[v]Source
instance FlagSource
instance Result[e, t] with Eq[e], Eq[t]Source
instance Set[a] with Eq[a]Source
instance Validation[e, t] with Eq[e], Eq[t]Source
instance Vector[a] with Eq[a]Source
class Filterable[m: Type -> Type] with Functor[m]Source

A type class for filtering container functors.

Signatures

def filterMap(f: a -> Option[b] \ ef, t: m[a]): m[b] \ efSource

Definitions

def filter(f: a -> Bool \ ef, t: m[a]): m[a] \ efSource

Instances

instance ChainSource
instance DelayListSource
instance ListSource
instance Map[k] with Order[k]Source
instance OptionSource
instance RedBlackTree[k] with Order[k]Source
instance VectorSource
class Foldable[t: Type -> Type]Source

A type class for data structures that can be folded.

Signatures

def foldLeft(f: b -> (a -> b \ ef), s: b, t: t[a]): b \ efSource
def foldRight(f: a -> (b -> b \ ef), s: b, t: t[a]): b \ efSource
def foldRightWithCont(f: a -> ((Unit -> b \ ef) -> b \ ef), s: b, t: t[a]): b \ efSource

Definitions

def count(f: a -> Bool \ ef, t: t[a]): Int32 \ efSource

Returns the number of elements in t that satisfy the predicate f.

def dropWhile(f: a -> Bool, t: t[a]): List[a]Source

Returns t without the longest prefix that satisfies the predicate f.

Returns an immutable list.

def exists(f: a -> Bool \ ef, t: t[a]): Bool \ efSource

Returns 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]Source

Returns 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] \ efSource

Optionally 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]Source

Optionally 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] \ efSource

A 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 \ efSource

Returns 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] \ efSource

A 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 \ efSource

Returns 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 \ efSource

Applies f to each element in t.

def forEachM(f: a -> m[b] \ ef, t: t[a]): m[Unit] \ efSource

A 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]Source

Optionally returns the first element of t.

Returns None if t is empty.

def isEmpty(t: t[a]): BoolSource

Returns true if and only if t is empty.

def join(sep: String, t: t[a]): StringSource

Returns 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 \ efSource

Returns 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]Source

Optionally returns the last element of t.

Returns None if t is empty.

def length(t: t[a]): Int32Source
def maximum(t: t[a]): Option[a]Source

Optionally 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]Source

Optionally 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]): BoolSource

Returns true if and only if the element x is in t.

def minimum(t: t[a]): Option[a]Source

Optionally 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]Source

Optionally 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] \ efSource

Optionally 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] \ efSource

Optionally 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]): Int32Source

Returns the sum of all elements in t.

def sumWith(f: a -> Int32 \ ef, t: t[a]): Int32 \ efSource

Returns the sum of all elements in t according to the function f.

def takeWhile(f: a -> Bool, t: t[a]): List[a]Source

Returns 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] \ rSource

Returns t as an array.

def toChain(t: t[a]): Chain[a]Source

Returns t as a chain.

def toDelayList(t: t[a]): DelayList[a]Source

Returns t as a DelayList.

def toDelayMap(t: t[(k, v)]): DelayMap[k, v]Source

Returns t as a DelayMap

def toList(t: t[a]): List[a]Source

Returns t as an immutable list.

def toMap(t: t[(k, v)]): Map[k, v]Source

Returns t as a map.

def toMapWith(f: a -> b, s: t[a]): Map[a, b]Source

Returns a map with elements of s as keys and f applied as values.

def toMutDeque(rc: Region[r], t: t[a]): MutDeque[a, r] \ rSource

Returns t as a MutDeque.

def toMutList(rc: Region[r], t: t[a]): MutList[a, r] \ rSource

Returns t as a mutable list.

def toMutMap(rc: Region[r], t: t[(k, v)]): MutMap[k, v, r] \ rSource

Returns t as a MutMap.

def toMutSet(rc: Region[r], t: t[a]): MutSet[a, r] \ rSource

Returns the set s as a MutSet.

def toNec(t: t[a]): Option[Nec[a]]Source

Optionally returns t as a non empty chain.

def toNel(t: t[a]): Option[Nel[a]]Source

Optionally returns t as a non empty list.

def toSet(t: t[a]): Set[a]Source

Returns t as a set.

def toVector(t: t[a]): Vector[a]Source

Returns t as a vector.

Instances

instance ChainSource
instance DelayListSource
instance DelayMap[k]Source
instance IdentitySource
instance ListSource
instance Map[k]Source
instance MultiMap[k]Source
instance NecSource
instance NelSource
instance OptionSource
instance RedBlackTree[k]Source
instance SetSource
instance VectorSource
class FromString[a: Type]Source

A type class for types that can be constructed from strings.

Signatures

def fromString(x: String): Option[a]Source

Instances

instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
class Functor[m: Type -> Type]Source

A type class for types that can be mapped over.

Signatures

def map(f: a -> b \ ef, x: m[a]): m[b] \ efSource

Instances

instance ChainSource
instance DelayListSource
instance DelayMap[k]Source
instance IdentitySource
instance ListSource
instance Map[k]Source
instance NecSource
instance NelSource
instance OptionSource
instance RedBlackTree[k]Source
instance Result[e]Source
instance Validation[e]Source
instance VectorSource
class Group[a: Type] with Monoid[a]Source

A type class for types that form a group.

The default instances for numbers define the additive inverse in the real numbers.

Signatures

def inverse(x: a): aSource

Returns the inverse element of x.

Definitions

def combine(x: a, y: a): aSource
def empty(_unit: Unit): aSource
def remove(x: a, y: a): aSource

Returns y removed from x.

Equivalent to Group.combine(x, Group.inverse(y))

Instances

instance UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance (a1, a2) with Group[a1], Group[a2]Source
instance (a1, a2, a3) with Group[a1], Group[a2], Group[a3]Source
instance (a1, a2, a3, a4) with Group[a1], Group[a2], Group[a3], Group[a4]Source
instance (a1, a2, a3, a4, a5) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Group[a1], Group[a2], Group[a3], Group[a4], Group[a5], Group[a6], Group[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
class Hash[a: Type]Source

A type class for types that can be hashed.

Signatures

def hash(x: a): Int32Source

Instances

instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance StringSource
instance BigIntSource
instance (a1, a2) with Hash[a1], Hash[a2]Source
instance (a1, a2, a3) with Hash[a1], Hash[a2], Hash[a3]Source
instance (a1, a2, a3, a4) with Hash[a1], Hash[a2], Hash[a3], Hash[a4]Source
instance (a1, a2, a3, a4, a5) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Hash[a1], Hash[a2], Hash[a3], Hash[a4], Hash[a5], Hash[a6], Hash[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Identity[a] with Hash[a]Source
instance List[a] with Hash[a]Source
instance Map[k, v] with Hash[k], Hash[v]Source
instance MultiMap[k, v] with Hash[k], Hash[v]Source
instance Nec[a] with Hash[a]Source
instance Nel[a] with Hash[a]Source
instance Option[a] with Hash[a]Source
instance Result[e, t] with Hash[e], Hash[t]Source
instance Set[a] with Hash[a]Source
instance Validation[e, t] with Hash[e], Hash[t]Source
instance Vector[a] with Hash[a]Source
class Iterable[t: Type -> Type]Source

A type class for immutable data structures that can be iterated.

Signatures

def iterator(rc: Region[r], t: t[a]): Iterator[a, r, r] \ rSource

Definitions

def enumerator(rc: Region[r], t: t[a]): Iterator[(Int32, a), r, r] \ rSource

Instances

instance ChainSource
instance DelayListSource
instance DelayMap[k]Source
instance ListSource
instance Map[k]Source
instance NecSource
instance NelSource
instance OptionSource
instance RedBlackTree[k]Source
instance SetSource
instance VectorSource
class JoinLattice[a: Type] with PartialOrder[a]Source

Signatures

def leastUpperBound(x: a, y: a): aSource

Instances

instance Down[a] with MeetLattice[a]Source
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance (a1, a2) with JoinLattice[a1], JoinLattice[a2]Source
instance (a1, a2, a3) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3]Source
instance (a1, a2, a3, a4) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4]Source
instance (a1, a2, a3, a4, a5) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5]Source
instance (a1, a2, a3, a4, a5, a6) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with JoinLattice[a1], JoinLattice[a2], JoinLattice[a3], JoinLattice[a4], JoinLattice[a5], JoinLattice[a6], JoinLattice[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Map[k, v] with Order[k], Eq[v], JoinLattice[v]Source
instance Option[t] with JoinLattice[t]Source
instance Set[a] with Order[a]Source
class LowerBound[a: Type]Source

A type class for partially ordered types that have a lower bound.

Signatures

def minValue(_unit: Unit): aSource

Instances

instance BoolSource
instance CharSource
instance Down[a] with UpperBound[a]Source
instance Float32Source
instance Float64Source
instance Int16Source
instance Int32Source
instance Int64Source
instance Int8Source
instance (a1, a2) with LowerBound[a1], LowerBound[a2]Source
instance (a1, a2, a3) with LowerBound[a1], LowerBound[a2], LowerBound[a3]Source
instance (a1, a2, a3, a4) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4]Source
instance (a1, a2, a3, a4, a5) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5]Source
instance (a1, a2, a3, a4, a5, a6) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with LowerBound[a1], LowerBound[a2], LowerBound[a3], LowerBound[a4], LowerBound[a5], LowerBound[a6], LowerBound[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance UnitSource
instance Map[k, v]Source
instance Option[t]Source
instance Set[a]Source
class MeetLattice[a: Type] with PartialOrder[a]Source

Signatures

def greatestLowerBound(x: a, y: a): aSource

Instances

instance Down[a] with JoinLattice[a]Source
instance Map[k, v] with Order[k], Eq[v], MeetLattice[v]Source
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance (a1, a2) with MeetLattice[a1], MeetLattice[a2]Source
instance (a1, a2, a3) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3]Source
instance (a1, a2, a3, a4) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4]Source
instance (a1, a2, a3, a4, a5) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5]Source
instance (a1, a2, a3, a4, a5, a6) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with MeetLattice[a1], MeetLattice[a2], MeetLattice[a3], MeetLattice[a4], MeetLattice[a5], MeetLattice[a6], MeetLattice[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Option[t] with MeetLattice[t]Source
instance Set[a] with Order[a]Source
class Monad[m: Type -> Type] with Applicative[m]Source

A 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).

Signatures

def flatMap(f: a -> m[b] \ ef, x: m[a]): m[b] \ efSource

Instances

instance ChainSource
instance DelayListSource
instance IdentitySource
instance ListSource
instance NecSource
instance NelSource
instance OptionSource
instance Result[e]Source
instance VectorSource
class MonadZero[m: Type -> Type] with Monad[m]Source

A type class for Monads that have a zero element.

Signatures

def empty(_unit: Unit): m[t]Source

Instances

instance ChainSource
instance DelayListSource
instance ListSource
instance OptionSource
instance VectorSource
class MonadZip[m: Type -> Type] with Monad[m]Source

A 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] \ efSource
def zipWithA(f: a -> (b -> f[c] \ ef), ma: m[a], mb: m[b]): f[m[c]] \ efSource

Generalized version of zipWith where f zips an applicative functor across the (monadic) containers ma and mb.

Definitions

def unzip(mx: m[(a, b)]): (m[a], m[b])Source

Returns a pair of monads, the first containing the element (or elements) of the left part of mx the second containing the element (or elements) of the right part of mx.

def zip(ma: m[a], mb: m[b]): m[(a, b)]Source

Instances

instance ChainSource
instance IdentitySource
instance ListSource
instance NecSource
instance NelSource
instance OptionSource
instance VectorSource
class Monoid[a: Type] with SemiGroup[a]Source

A type class for Monoids, objects that support an associative binary operation combine and neutral element empty.

Signatures

def empty(_unit: Unit): aSource

Definitions

def combine(x: a, y: a): aSource

Instances

instance Chain[a]Source
instance DelayList[a]Source
instance PrecedenceGraphSource
instance Identity[a] with Monoid[a]Source
instance List[a]Source
instance Map[k, v] with Order[k], Monoid[v]Source
instance UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance StringSource
instance (a1, a2) with Monoid[a1], Monoid[a2]Source
instance (a1, a2, a3) with Monoid[a1], Monoid[a2], Monoid[a3]Source
instance (a1, a2, a3, a4) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4]Source
instance (a1, a2, a3, a4, a5) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Monoid[a1], Monoid[a2], Monoid[a3], Monoid[a4], Monoid[a5], Monoid[a6], Monoid[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance MultiMap[k, v] with Order[k], Order[v]Source
instance Option[a] with Monoid[a]Source
instance AnySource
instance AllSource
instance Set[a] with Order[a]Source
instance Validation[e, t] with Monoid[t]Source
instance Vector[a]Source
class Mul[a: Type]Source

A type class for multiplication.

Signatures

def mul(x: a, y: a): aSource

Instances

instance Identity[a] with Mul[a]Source
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
class Neg[a: Type]Source

A type class for negation.

Signatures

def neg(x: a): aSource

Instances

instance Identity[a] with Neg[a]Source
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
class Order[a: Type] with Eq[a]Source

Signatures

def compare(x: a, y: a): ComparisonSource

Definitions

def greater(x: a, y: a): BoolSource

Returns true if and only if x > y.

def greaterEqual(x: a, y: a): BoolSource

Returns true if and only if x >= y.

def less(x: a, y: a): BoolSource
def lessEqual(x: a, y: a): BoolSource

Returns true if and only if x <= y.

def max(x: a, y: a): aSource

Returns the maximum of x and y.

def min(x: a, y: a): aSource

Returns the minimum of x and y.

Instances

instance BoxedSource
instance Chain[a] with Order[a]Source
instance DelayList[a] with Order[a]Source
instance DelayMap[k, v] with Order[k], Order[v]Source
instance Down[a] with Order[a]Source
instance FileTypeSource
instance PrecedenceEdgeSource
instance VarSymSource
instance RamSym[v]Source
instance RowVarSource
instance PredSymSource
instance Identity[a] with Order[a]Source
instance List[a] with Order[a]Source
instance Map[k, v] with Order[k], Order[v]Source
instance MultiMap[k, v] with Order[k], Order[v]Source
instance Nec[a] with Order[a]Source
instance Nel[a] with Order[a]Source
instance Option[t] with Order[t]Source
instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
instance (a1, a2) with Order[a1], Order[a2]Source
instance (a1, a2, a3) with Order[a1], Order[a2], Order[a3]Source
instance (a1, a2, a3, a4) with Order[a1], Order[a2], Order[a3], Order[a4]Source
instance (a1, a2, a3, a4, a5) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Order[a1], Order[a2], Order[a3], Order[a4], Order[a5], Order[a6], Order[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance FlagSource
instance Result[e, t] with Order[e], Order[t]Source
instance Set[a] with Order[a]Source
instance Validation[e, t] with Order[e], Order[t]Source
instance Vector[a] with Order[a]Source
class PartialOrder[a: Type]Source

Signatures

def lessEqual(x: a, y: a): BoolSource

Instances

instance Down[a] with PartialOrder[a]Source
instance Map[k, v] with Order[k], Eq[v]Source
instance Option[t] with PartialOrder[t]Source
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance (a1, a2) with PartialOrder[a1], PartialOrder[a2]Source
instance (a1, a2, a3) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3]Source
instance (a1, a2, a3, a4) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4]Source
instance (a1, a2, a3, a4, a5) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5]Source
instance (a1, a2, a3, a4, a5, a6) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with PartialOrder[a1], PartialOrder[a2], PartialOrder[a3], PartialOrder[a4], PartialOrder[a5], PartialOrder[a6], PartialOrder[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Set[a] with Order[a]Source
class Reducible[t: Type -> Type]Source

A 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 + ef2Source
def reduceRightTo(f: a -> (b -> b \ ef1), g: a -> b \ ef2, t: t[a]): b \ ef1 + ef2Source

Definitions

def count(f: a -> Bool \ ef, t: t[a]): Int32 \ efSource

Returns the number of elements in t that satisfy the predicate f.

def dropWhile(f: a -> Bool \ ef, t: t[a]): List[a] \ efSource

Returns t as a list without the longest prefix that satisfies the predicate f.

def exists(f: a -> Bool \ ef, t: t[a]): Bool \ efSource

Returns 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] \ efSource

Alias 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] \ efSource

Optionally 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] \ efSource

Optionally returns the first element of t that satisfies the predicate f when searching from right to left.

def fold(t: t[a]): aSource

Alias for reduce.

Reduce t using the derived SemiGroup instance.

def foldLeft(f: b -> (a -> b \ ef), s: b, t: t[a]): b \ efSource

Left-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 \ efSource

Right-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 \ efSource

Right-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 \ efSource

Returns true if and only if all elements in t satisfy the predicate f.

def forEach(f: a -> Unit \ ef, t: t[a]): Unit \ efSource

Applies f to each element in t.

def head(t: t[a]): aSource

Returns the first element of t.

def init(t: t[a]): List[a]Source

Returns t as a list without the last element.

def intersperse(a: a, t: t[a]): List[a]Source

Returns t as a list with a inserted between every two adjacent elements.

def last(t: t[a]): aSource

Returns the last element of t.

def length(t: t[a]): Int32Source

Returns the number of elements in t.

def maximum(t: t[a]): aSource

Finds the largest element of t according to the Order on a.

def maximumBy(cmp: a -> (a -> Comparison), t: t[a]): aSource

Finds the largest element of t according to the given comparator cmp.

def memberOf(a: a, t: t[a]): BoolSource

Returns true if and only if the element a is in t.

def minimum(t: t[a]): aSource

Finds the smallest element of t according to the Order on a.

def minimumBy(cmp: a -> (a -> Comparison), t: t[a]): aSource

Finds the smallest element of t according to the given comparator cmp.

def reduce(t: t[a]): aSource

Reduce t using the derived SemiGroup instance.

def reduceLeft(f: a -> (a -> a \ ef), t: t[a]): a \ efSource
def reduceMap(f: a -> b \ ef, t: t[a]): b \ efSource

Applies 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 \ efSource

Right-associative reduction on t using f.

def reverse(t: t[a]): List[a]Source

Returns the reverse of t as a list.

def sum(t: t[Int32]): Int32Source

Returns the sum of all elements in t.

def sumWith(f: a -> Int32 \ ef, t: t[a]): Int32 \ efSource

Returns the sum of all elements in t according to the function f.

def tail(t: t[a]): List[a]Source

Returns the tail of t as a list.

def takeWhile(f: a -> Bool \ ef, t: t[a]): List[a] \ efSource

Returns the longest prefix of t as a list that satisfies the predicate f.

def toArray(rc: Region[r], t: t[a]): Array[a, r] \ rSource

Returns t as an array.

def toList(t: t[a]): List[a]Source

Returns t as a list.

def toMap(t: t[(k, v)]): Map[k, v]Source

Returns t as a map.

def toNel(t: t[a]): Nel[a]Source

Returns t as a non-empty list.

def toSet(t: t[a]): Set[a]Source

Returns t as a set.

def toVector(t: t[a]): Vector[a]Source

Returns t as a vector.

Instances

instance NecSource
instance NelSource
class SemiGroup[a: Type]Source

A type class for types that form a semigroup.

Signatures

def combine(x: a, y: a): aSource

Definitions

def combineN(x: a, n: Int32): aSource

Instances

instance Chain[a]Source
instance DelayList[a]Source
instance PrecedenceGraphSource
instance Identity[a] with SemiGroup[a]Source
instance List[a]Source
instance Map[k, v] with Order[k], SemiGroup[v]Source
instance MultiMap[k, v] with Order[k], Order[v]Source
instance Nec[a]Source
instance Nel[a]Source
instance Option[a] with SemiGroup[a]Source
instance UnitSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance StringSource
instance (a1, a2) with SemiGroup[a1], SemiGroup[a2]Source
instance (a1, a2, a3) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3]Source
instance (a1, a2, a3, a4) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4]Source
instance (a1, a2, a3, a4, a5) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5]Source
instance (a1, a2, a3, a4, a5, a6) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with SemiGroup[a1], SemiGroup[a2], SemiGroup[a3], SemiGroup[a4], SemiGroup[a5], SemiGroup[a6], SemiGroup[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance AnySource
instance AllSource
instance Set[a] with Order[a]Source
instance Validation[e, t] with SemiGroup[t]Source
instance Vector[a]Source
class Sendable[a: Type]Source

A type class for types that can be passed to Channel.send.

Instances

instance BoxedSource
instance Chain[t] with Sendable[t]Source
instance ComparisonSource
instance DelayList[a] with Sendable[a]Source
instance DelayMap[k, v] with Sendable[k], Sendable[v]Source
instance Down[a] with Sendable[a]Source
instance Identity[a] with Sendable[a]Source
instance List[t] with Sendable[t]Source
instance Map[k, v] with Sendable[k], Sendable[v]Source
instance MultiMap[k, v] with Sendable[k], Sendable[v]Source
instance Nec[t] with Sendable[t]Source
instance Nel[a] with Sendable[a]Source
instance Option[t] with Sendable[t]Source
instance RedBlackTree[k, v] with Sendable[k], Sendable[v]Source
instance Result[e, t] with Sendable[e], Sendable[t]Source
instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
instance StringSource
instance (a1, a2) with Sendable[a1], Sendable[a2]Source
instance (a1, a2, a3) with Sendable[a1], Sendable[a2], Sendable[a3]Source
instance (a1, a2, a3, a4) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4]Source
instance (a1, a2, a3, a4, a5) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5]Source
instance (a1, a2, a3, a4, a5, a6) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with Sendable[a1], Sendable[a2], Sendable[a3], Sendable[a4], Sendable[a5], Sendable[a6], Sendable[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Set[t] with Sendable[t]Source
instance Validation[e, t] with Sendable[e], Sendable[t]Source
class Sub[a: Type]Source

A type class for subtraction.

Signatures

def sub(x: a, y: a): aSource

Instances

instance Identity[a] with Sub[a]Source
instance Float32Source
instance Float64Source
instance BigDecimalSource
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance BigIntSource
class ToJava[t: Type]Source

A type class for marshaling values to Java.

Signatures

def toJava(t: t): O[t] \ IOSource

Instances

instance Chain[a]Source
instance List[a]Source
instance Map[k, v] with Order[k]Source
instance Nec[a]Source
instance Nel[a]Source
instance Set[a] with Order[a]Source
instance Vector[a]Source
class ToString[a: Type]Source

A type class for types that can be converted to strings.

Signatures

def toString(x: a): StringSource

Instances

instance BoxedSource
instance Chain[a] with ToString[a]Source
instance ComparisonSource
instance DelayList[a] with ToString[a]Source
instance DelayMap[k, v] with ToString[k], ToString[v]Source
instance Down[a] with ToString[a]Source
instance FileTypeSource
instance BodyPredicate[v]Source
instance BodyTerm[v]Source
instance Constraint[v]Source
instance Datalog[v]Source
instance HeadPredicate[v]Source
instance HeadTerm[v]Source
instance VarSymSource
instance BoolExp[v]Source
instance RamStmt[v]Source
instance RamSym[v]Source
instance RamTerm[v]Source
instance RelOp[v]Source
instance RowVarSource
instance PredSymSource
instance Identity[a] with ToString[a]Source
instance List[a] with ToString[a]Source
instance Map[k, v] with ToString[k], ToString[v]Source
instance MultiMap[k, v] with ToString[k], ToString[v]Source
instance Nec[a] with ToString[a]Source
instance Nel[a] with ToString[a]Source
instance Option[t] with ToString[t]Source
instance FlagSource
instance Result[e, t] with ToString[e], ToString[t]Source
instance Set[a] with ToString[a]Source
instance InstantSource
instance UnitSource
instance BoolSource
instance CharSource
instance Float32Source
instance Float64Source
instance Int8Source
instance Int16Source
instance Int32Source
instance Int64Source
instance StringSource
instance BigIntSource
instance BigDecimalSource
instance RegexSource
instance (a1, a2) with ToString[a1], ToString[a2]Source
instance (a1, a2, a3) with ToString[a1], ToString[a2], ToString[a3]Source
instance (a1, a2, a3, a4) with ToString[a1], ToString[a2], ToString[a3], ToString[a4]Source
instance (a1, a2, a3, a4, a5) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5]Source
instance (a1, a2, a3, a4, a5, a6) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with ToString[a1], ToString[a2], ToString[a3], ToString[a4], ToString[a5], ToString[a6], ToString[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance Validation[e, t] with ToString[e], ToString[t]Source
instance Vector[a] with ToString[a]Source

A Vector data type which is fundamentally like Array but is immutable.

class Traversable[t: Type -> Type] with Functor[t], Foldable[t]Source

A type class for data structures that can be traversed in left-to-right order with an applicative functor.

Signatures

def traverse(f: a -> m[b] \ ef, t: t[a]): m[t[b]] \ efSource

Definitions

def sequence(t: t[m[a]]): m[t[a]]Source

Returns the result of running all the actions in the data structure t.

Instances

instance ChainSource
instance DelayListSource
instance IdentitySource
instance ListSource
instance Map[k]Source
instance NecSource
instance NelSource
instance OptionSource
instance RedBlackTree[k]Source
instance VectorSource
class UnorderedFoldable[t: Type -> Type]Source

A type class for unordered data structures that can be folded.

Signatures

def foldMap(f: a -> b \ ef, t: t[a]): b \ efSource

Definitions

def count(f: a -> Bool \ ef, t: t[a]): Int32 \ efSource

Returns the number of elements in t that satisfy the predicate f.

def exists(f: a -> Bool \ ef, t: t[a]): Bool \ efSource

Returns 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]): aSource

Returns the result of applying CommutativeMonoid.combine to all the elements in t.

def forAll(f: a -> Bool \ ef, t: t[a]): Bool \ efSource

Returns true if and only if all elements in t satisfy the predicate f.

Returns true if t is empty.

def isEmpty(t: t[a]): BoolSource

Returns true if and only if t is empty.

def memberOf(x: a, t: t[a]): BoolSource

Returns true if and only if the element x is in t.

def size(t: t[a]): Int32Source

Returns the number of elements in t.

Instances

instance ChainSource
instance DelayListSource
instance IdentitySource
instance ListSource
instance Map[k]Source
instance MultiMap[k]Source
instance NecSource
instance NelSource
instance OptionSource
instance RedBlackTree[k]Source
instance SetSource
instance VectorSource
class UpperBound[a: Type]Source

A type class for partially ordered types that have an upper bound.

Signatures

def maxValue(_unit: Unit): aSource

Instances

instance BoolSource
instance CharSource
instance Down[a] with LowerBound[a]Source
instance Float32Source
instance Float64Source
instance Int16Source
instance Int32Source
instance Int64Source
instance Int8Source
instance (a1, a2) with UpperBound[a1], UpperBound[a2]Source
instance (a1, a2, a3) with UpperBound[a1], UpperBound[a2], UpperBound[a3]Source
instance (a1, a2, a3, a4) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4]Source
instance (a1, a2, a3, a4, a5) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5]Source
instance (a1, a2, a3, a4, a5, a6) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6]Source
instance (a1, a2, a3, a4, a5, a6, a7) with UpperBound[a1], UpperBound[a2], UpperBound[a3], UpperBound[a4], UpperBound[a5], UpperBound[a6], UpperBound[a7]Source
instance (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]Source
instance (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]Source
instance (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]Source
instance UnitSource
class Witherable[t: Type -> Type] with Traversable[t], Filterable[t]Source

A type class for data structures that can be traversed in left-to-right order with an applicative partial functor.

Definitions

def sequenceWither(t: t[m[Option[a]]]): m[t[a]]Source

Returns the result of running all the actions in the data structure t.

def wither(f: a -> m[Option[b]] \ ef, t: t[a]): m[t[b]] \ efSource

Instances

instance ChainSource
instance DelayListSource
instance ListSource
instance Map[k] with Order[k]Source
instance OptionSource
instance RedBlackTree[k] with Order[k]Source
instance VectorSource

Effects

eff IOSource

The Generic IO Effect.

The IO effect is the most general effect of any operation that interacts with the environment.

eff NonDetSource

Enums

enum BenchmarkSource
case 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 SendableSource
case 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 SendableSource
case 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, SendableSource
case LessThan(Unit)case EqualTo(Unit)case GreaterThan(Unit)
enum DelayList[a: Type] with SendableSource
case ENil(Unit)case ECons(a, DelayList[a])case LCons(a, Lazy[DelayList[a]])case LList(Lazy[DelayList[a]])
enum DelayMap[k: Type, v: Type] with SendableSource
case DMap(RedBlackTree[k, Lazy[v]])
enum Down[a: Type] with SendableSource
case Down(a)

The Down type allows you to reverse the sort order of a conveniently.

enum Identity[a: Type] with Eq, Order, ToString, Hash, SendableSource
case Identity(a)

The Identity Functor / Monad.

enum Iterator[a: Type, ef: Eff, r: Eff]Source
case Iterator(Region[r], Unit -> Step[a] \ r + ef)
enum List[t: Type] with SendableSource
case 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 SendableSource
case 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 SendableSource
case 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]Source
case 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]Source
case 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]Source
case MutMap(Region[r], Ref[Map[k, v], r])

The Mutable Map type.

enum MutPriorityQueue[a: Type, r: Eff]Source
case 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 MutSet[t: Type, r: Eff]Source
case MutSet(Region[r], Ref[Set[t], r])

The Mutable Set type.

enum Nec[t: Type] with SendableSource
case 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 Nel[a: Type] with SendableSource
case Nel(a, List[a])

The NonEmptyList type.

enum Option[t: Type] with Eq, Order, ToString, SendableSource
case 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 Proxy[_: Type]Source
case Proxy(Unit)
enum RandomSource
case Random(Random)

Represents a random number generator.

enum RedBlackTree[k: Type, v: Type] with SendableSource
case 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.

  1. For all nodes with key x, the left subtree contains only nodes with keys y < `x` and the right subtree contains only nodes with keys `z` > x.
  2. No red node has a red parent.
  3. 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, SendableSource
case 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 SendableSource
case Set(RedBlackTree[t, Unit])

The Set type.

A set is currently represented internally as a red-black tree.

enum StringBuilder[_: Eff]Source
case StringBuilder(StringBuilder)

Represents a StringBuilder.

@MustUse enum Validation[e: Type, t: Type] with Eq, Order, ToString, SendableSource
case Success(t)case Failure(Nec[e])

The Validation type.

enum VoidSource

The empty type.

Type Aliases

type alias Static = IOSource

Static is a type alias for false and denotes the global lifetime.

Definitions

def !>(x: a, f: a -> Unit \ ef): a \ efSource

Pipes the given value x into the function f.

Given a value x and a function f returns x.

def ++(x: a, y: a): aSource

Alias for SemiGroup.combine.

def >>(f: a -> b \ ef1, g: b -> c \ ef2): a -> c \ ef1 + ef2Source

Forwards 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 bug!(m: String): aSource

Crashes the current process with the given message m.

def constant(x: a): b -> a \ efSource

The constant function.

def debug(x: a): aSource

Prints 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): aSource

Prints 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): aSource

Prints 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)Source

Returns the function f with input arguments swapped. That is, given the function f: (a, b) -> c, returns a function (b, a) -> c

def fst(p: (a, b)): aSource

Returns the first component of t.

def identity(x: a): a \ efSource
def on(f: b -> (b -> c \ ef1), g: a -> b \ ef2, x: a, y: a): c \ ef1 + ef2Source

Partially 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 \ IOSource

Converts x to a string and prints it to standard out followed by a new line.

def snd(p: (a, b)): bSource

Returns the second component of t.

def swap(p: (a, b)): (b, a)Source

Returns the pair p with the components swapped. That is, returns (y, x) if p = (x, y).

def touch(_: Region[r]): Unit \ rSource

Touches the given region capability rc.

def unreachable!(_unit: Unit): aSource

Asserts that this expression is unreachable. Crashes if not.

def |+|(x: a, y: a): aSource

Alias for CommutativeSemiGroup.combine.

def |>(x: a, f: a -> b \ ef): b \ efSource

Pipes 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 \ efSource

Pipes the given pair x into the function f.

Given a pair x and a function f returns f(x).