Core Library API Reference
Complete API signatures from mo:core library.
Use this as a reference when using contextual dot notation.
Generated from motoko-core’s API lock by scripts/generate-motoko-api-reference.mjs.
Deprecated APIs are omitted — if a symbol is not here, do not write it.
Array
func all\<T\>(self : [T], predicate : T -> Bool) : Boolfunc any\<T\>(self : [T], predicate : T -> Bool) : Boolfunc binarySearch\<T\>(self : [T], compare : (implicit : (T, T) -> Order.Order), element : T) : { #found : Nat; #insertionIndex : Nat }func compare\<T\>(self : [T], other : [T], compare : (implicit : (T, T) -> Order.Order)) : Order.Orderfunc concat\<T\>(self : [T], other : [T]) : [T]func contains\<T\>(self : [T], equal : (implicit : (T, T) -> Bool), element : T) : Boolfunc empty\<T\>() : [T]func enumerate\<T\>(self : [T]) : Types.Iter<(Nat, T)>func equal\<T\>(self : [T], other : [T], equal : (implicit : (T, T) -> Bool)) : Boolfunc filter\<T\>(self : [T], f : T -> Bool) : [T]func filterMap\<T, R\>(self : [T], f : T -> ?R) : [R]func find\<T\>(self : [T], predicate : T -> Bool) : ?Tfunc findIndex\<T\>(self : [T], predicate : T -> Bool) : ?Natfunc flatMap\<T, R\>(self : [T], k : T -> Types.Iter\<R\>) : [R]func flatten\<T\>(self : [[T]]) : [T]func foldLeft\<T, A\>(self : [T], base : A, combine : (A, T) -> A) : Afunc foldRight\<T, A\>(self : [T], base : A, combine : (T, A) -> A) : Afunc forEach\<T\>(self : [T], f : T -> ())func indexOf\<T\>(self : [T], equal : (implicit : (T, T) -> Bool), element : T) : ?Natfunc isEmpty\<T\>(self : [T]) : Boolfunc isSorted\<T\>(self : [T], compare : (implicit : (T, T) -> Order.Order)) : Boolfunc join\<T\>(self : Types.Iter<[T]>) : [T]func keys\<T\>(self : [T]) : Types.Iter\<Nat\>func lastIndexOf\<T\>(self : [T], equal : (implicit : (T, T) -> Bool), element : T) : ?Natfunc map\<T, R\>(self : [T], f : T -> R) : [R]func mapEntries\<T, R\>(self : [T], f : (T, Nat) -> R) : [R]func nextIndexOf\<T\>(self : [T], equal : (implicit : (T, T) -> Bool), element : T, fromInclusive : Nat) : ?Natfunc prevIndexOf\<T\>(self : [T], equal : (implicit : (T, T) -> Bool), element : T, fromExclusive : Nat) : ?Natfunc range\<T\>(self : [T], fromInclusive : Int, toExclusive : Int) : Types.Iter\<T\>func repeat\<T\>(item : T, size : Nat) : [T]func reverse\<T\>(self : [T]) : [T]func singleton\<T\>(element : T) : [T]func size\<T\>(self : [T]) : Natfunc sliceToArray\<T\>(self : [T], fromInclusive : Int, toExclusive : Int) : [T]func sliceToVarArray\<T\>(self : [T], fromInclusive : Int, toExclusive : Int) : [var T]func sort\<T\>(self : [T], compare : (implicit : (T, T) -> Order.Order)) : [T]func tabulate\<T\>(size : Nat, generator : Nat -> T) : [T]func toBlob(self : [Nat8]) : Blobfunc toText\<T\>(self : [T], f : (implicit : (toText : T -> Text))) : Textfunc toVarArray\<T\>(self : [T]) : [var T]func values\<T\>(self : [T]) : Types.Iter\<T\>
Blob
func compare(self : Blob, other : Blob) : Order.Orderfunc empty() : Blobfunc equal(self : Blob, other : Blob) : Boolfunc greater(self : Blob, other : Blob) : Boolfunc greaterOrEqual(self : Blob, other : Blob) : Boolfunc hash(self : Blob) : Types.Hashfunc isEmpty(self : Blob) : Boolfunc less(self : Blob, other : Blob) : Boolfunc lessOrEqual(self : Blob, other : Blob) : Boolfunc notEqual(self : Blob, other : Blob) : Boolfunc size(self : Blob) : Natfunc toArray(self : Blob) : [Nat8]func toVarArray(self : Blob) : [var Nat8]type Blob = Prim.Types.Blob
Bool
func allValues() : Iter.Iter<Bool>func compare(self : Bool, other : Bool) : Order.Orderfunc equal(self : Bool, other : Bool) : Boolfunc logicalAnd(self : Bool, other : Bool) : Boolfunc logicalNot(self : Bool) : Boolfunc logicalOr(self : Bool, other : Bool) : Boolfunc logicalXor(self : Bool, other : Bool) : Boolfunc toText(self : Bool) : Texttype Bool = Prim.Types.Bool
Char
func compare(self : Char, other : Char) : { #less; #equal; #greater }func equal(self : Char, other : Char) : Boolfunc greater(self : Char, other : Char) : Boolfunc greaterOrEqual(self : Char, other : Char) : Boolfunc isAlphabetic(self : Char) : Boolfunc isDigit(self : Char) : Boolfunc isLower(self : Char) : Boolfunc isUpper(self : Char) : Boolfunc isWhitespace(self : Char) : Boolfunc less(self : Char, other : Char) : Boolfunc lessOrEqual(self : Char, other : Char) : Boolfunc notEqual(self : Char, other : Char) : Boolfunc toNat32(self : Char) : Nat32func toText(self : Char) : Texttype Char = Prim.Types.Char
Debug
func print(text : Text) : ()func todo() : None
Error
func code(self : Error) : ErrorCodefunc isCleanReject(self : Error) : Boolfunc isRetryPossible(self : Error) : Boolfunc message(self : Error) : Textfunc reject(message : Text) : Errortype Error = Prim.Types.Errortype ErrorCode = Prim.ErrorCode
Float
func abs(x : Float) : Floatfunc add(x : Float, y : Float) : Floatfunc arccos(x : Float) : Floatfunc arcsin(x : Float) : Floatfunc arctan(x : Float) : Floatfunc arctan2(y : Float, x : Float) : Floatfunc ceil(x : Float) : Floatfunc compare(x : Float, y : Float) : Order.Orderfunc copySign(x : Float, y : Float) : Floatfunc cos(x : Float) : Floatfunc div(x : Float, y : Float) : Floatfunc equal(x : Float, y : Float, epsilon : Float) : Boolfunc exp(x : Float) : Floatfunc floor(x : Float) : Floatfunc format(self : Float, fmt : { #fix : Nat8; #exp : Nat8; #gen : Nat8; #exact }) : Textfunc fromInt64(x : Int64) : Floatfunc greater(x : Float, y : Float) : Boolfunc greaterOrEqual(x : Float, y : Float) : Boolfunc isNaN(self : Float) : Boolfunc less(x : Float, y : Float) : Boolfunc lessOrEqual(x : Float, y : Float) : Boolfunc log(x : Float) : Floatfunc max(x : Float, y : Float) : Floatfunc min(x : Float, y : Float) : Floatfunc mul(x : Float, y : Float) : Floatfunc nearest(x : Float) : Floatfunc neg(x : Float) : Floatfunc notEqual(x : Float, y : Float, epsilon : Float) : Boolfunc pow(x : Float, y : Float) : Floatfunc rem(x : Float, y : Float) : Floatfunc sin(x : Float) : Floatfunc sqrt(x : Float) : Floatfunc sub(x : Float, y : Float) : Floatfunc tan(x : Float) : Floatfunc toFloat32(self : Float) : Prim.Types.Float32func toInt(self : Float) : Intfunc toInt64(self : Float) : Int64func toText(self : Float) : Textfunc trunc(x : Float) : Floatlet e : Floatlet pi : Floattype Float = Prim.Types.Float
Int
func abs(x : Int) : Natfunc add(x : Int, y : Int) : Intfunc compare(x : Int, y : Int) : Order.Orderfunc div(x : Int, y : Int) : Intfunc equal(x : Int, y : Int) : Boolfunc fromText(text : Text) : ?Intfunc greater(x : Int, y : Int) : Boolfunc greaterOrEqual(x : Int, y : Int) : Boolfunc less(x : Int, y : Int) : Boolfunc lessOrEqual(x : Int, y : Int) : Boolfunc max(x : Int, y : Int) : Intfunc min(x : Int, y : Int) : Intfunc mul(x : Int, y : Int) : Intfunc neg(x : Int) : Intfunc notEqual(x : Int, y : Int) : Boolfunc pow(x : Int, y : Int) : Intfunc range(fromInclusive : Int, toExclusive : Int) : Iter.Iter<Int>func rangeBy(fromInclusive : Int, toExclusive : Int, step : Int) : Iter.Iter<Int>func rangeByInclusive(from : Int, to : Int, step : Int) : Iter.Iter<Int>func rangeInclusive(from : Int, to : Int) : Iter.Iter<Int>func rem(x : Int, y : Int) : Intfunc sub(x : Int, y : Int) : Intfunc toFloat(self : Int) : Floatfunc toInt(self : Text) : ?Intfunc toInt16(self : Int) : Int16func toInt32(self : Int) : Int32func toInt64(self : Int) : Int64func toInt8(self : Int) : Int8func toNat(self : Int) : Natfunc toText(self : Int) : Texttype Int = Prim.Types.Int
Iter
func all\<T\>(self : Iter\<T\>, f : T -> Bool) : Boolfunc any\<T\>(self : Iter\<T\>, f : T -> Bool) : Boolfunc concat\<T\>(self : Iter\<T\>, other : Iter\<T\>) : Iter\<T\>func contains\<T\>(self : Iter\<T\>, equal : (implicit : (T, T) -> Bool), value : T) : Boolfunc drop\<T\>(self : Iter\<T\>, n : Nat) : Iter\<T\>func dropWhile\<T\>(self : Iter\<T\>, f : T -> Bool) : Iter\<T\>func empty\<T\>() : Iter\<T\>func enumerate\<T\>(self : Iter\<T\>) : Iter<(Nat, T)>func filter\<T\>(self : Iter\<T\>, f : T -> Bool) : Iter\<T\>func filterMap\<T, R\>(self : Iter\<T\>, f : T -> ?R) : Iter\<R\>func find\<T\>(self : Iter\<T\>, f : T -> Bool) : ?Tfunc findIndex\<T\>(self : Iter\<T\>, predicate : T -> Bool) : ?Natfunc flatMap\<T, R\>(self : Iter\<T\>, f : T -> Iter\<R\>) : Iter\<R\>func flatten\<T\>(self : Iter<Iter<T>>) : Iter\<T\>func foldLeft\<T, R\>(self : Iter\<T\>, initial : R, combine : (R, T) -> R) : Rfunc foldRight\<T, R\>(self : Iter\<T\>, initial : R, combine : (T, R) -> R) : Rfunc forEach\<T\>(self : Iter\<T\>, f : (T) -> ())func infinite\<T\>(item : T) : Iter\<T\>func map\<T, R\>(self : Iter\<T\>, f : T -> R) : Iter\<R\>func max\<T\>(self : Iter\<T\>, compare : (implicit : (T, T) -> Order.Order)) : ?Tfunc min\<T\>(self : Iter\<T\>, compare : (implicit : (T, T) -> Order.Order)) : ?Tfunc reduce\<T\>(self : Iter\<T\>, combine : (T, T) -> T) : ?Tfunc repeat\<T\>(item : T, count : Nat) : Iter\<T\>func reverse\<T\>(self : Iter\<T\>) : Iter\<T\>func scanLeft\<T, R\>(self : Iter\<T\>, initial : R, combine : (R, T) -> R) : Iter\<R\>func scanRight\<T, R\>(self : Iter\<T\>, initial : R, combine : (T, R) -> R) : Iter\<R\>func singleton\<T\>(value : T) : Iter\<T\>func size\<T\>(self : Iter\<T\>) : Natfunc sort\<T\>(self : Iter\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Iter\<T\>func step\<T\>(self : Iter\<T\>, n : Nat) : Iter\<T\>func take\<T\>(self : Iter\<T\>, n : Nat) : Iter\<T\>func takeWhile\<T\>(self : Iter\<T\>, f : T -> Bool) : Iter\<T\>func toArray\<T\>(self : Iter\<T\>) : [T]func toVarArray\<T\>(self : Iter\<T\>) : [var T]func unfold\<T, S\>(initial : S, step : S -> ?(T, S)) : Iter\<T\>func zip3\<A, B, C\>(self : Iter\<A\>, other1 : Iter<B>, other2 : Iter\<C\>) : Iter<(A, B, C)>func zip\<A, B\>(self : Iter\<A\>, other : Iter<B>) : Iter<(A, B)>func zipWith3\<A, B, C, R\>(self : Iter\<A\>, other1 : Iter<B>, other2 : Iter\<C\>, f : (A, B, C) -> R) : Iter\<R\>func zipWith\<A, B, R\>(self : Iter\<A\>, other : Iter<B>, f : (A, B) -> R) : Iter\<R\>type Iter\<T\> = Types.Iter\<T\>
List
func add\<T\>(self : List\<T\>, element : T)func addAll\<T\>(self : List\<T\>, iter : Types.Iter\<T\>)func addRepeat\<T\>(self : List\<T\>, initValue : T, count : Nat)func all\<T\>(self : List\<T\>, predicate : T -> Bool) : Boolfunc any\<T\>(self : List\<T\>, predicate : T -> Bool) : Boolfunc append\<T\>(self : List\<T\>, added : List\<T\>)func at\<T\>(self : List\<T\>, index : Nat) : Tfunc binarySearch\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order), element : T) : { #found : Nat; #insertionIndex : Nat }func clear\<T\>(self : List\<T\>)func clone\<T\>(self : List\<T\>) : List\<T\>func compare\<T\>(self : List\<T\>, other : List\<T\>, compare : (implicit : (T, T) -> Types.Order)) : Types.Orderfunc contains\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool), element : T) : Boolfunc deduplicate\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool))func empty\<T\>() : List\<T\>func enumerate\<T\>(self : List\<T\>) : Types.Iter<(Nat, T)>func equal\<T\>(self : List\<T\>, other : List\<T\>, equal : (implicit : (T, T) -> Bool)) : Boolfunc fill\<T\>(self : List\<T\>, value : T)func filter\<T\>(self : List\<T\>, predicate : T -> Bool) : List\<T\>func filterMap\<T, R\>(self : List\<T\>, f : T -> ?R) : List\<R\>func find\<T\>(self : List\<T\>, predicate : T -> Bool) : ?Tfunc findIndex\<T\>(self : List\<T\>, predicate : T -> Bool) : ?Natfunc findLastIndex\<T\>(self : List\<T\>, predicate : T -> Bool) : ?Natfunc first\<T\>(self : List\<T\>) : ?Tfunc flatMap\<T, R\>(self : List\<T\>, k : T -> Types.Iter\<R\>) : List\<R\>func flatten\<T\>(self : List<List<T>>) : List\<T\>func foldLeft\<A, T\>(self : List\<T\>, base : A, combine : (A, T) -> A) : Afunc foldRight\<T, A\>(self : List\<T\>, base : A, combine : (T, A) -> A) : Afunc forEach\<T\>(self : List\<T\>, f : T -> ())func forEachEntry\<T\>(self : List\<T\>, f : (Nat, T) -> ())func forEachInRange\<T\>(self : List\<T\>, f : T -> (), fromInclusive : Nat, toExclusive : Nat)func fromArray\<T\>(array : [T]) : List\<T\>func fromIter\<T\>(iter : Types.Iter\<T\>) : List\<T\>func fromVarArray\<T\>(array : [var T]) : List\<T\>func get\<T\>(self : List\<T\>, index : Nat) : ?Tfunc indexOf\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool), element : T) : ?Natfunc isEmpty\<T\>(self : List\<T\>) : Boolfunc isSorted\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order)) : Boolfunc join\<T\>(self : Types.Iter<List<T>>) : List\<T\>func keys\<T\>(self : List\<T\>) : Types.Iter\<Nat\>func last\<T\>(self : List\<T\>) : ?Tfunc lastIndexOf\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool), element : T) : ?Natfunc map\<T, R\>(self : List\<T\>, f : T -> R) : List\<R\>func mapEntries\<T, R\>(self : List\<T\>, f : (T, Nat) -> R) : List\<R\>func mapInPlace\<T\>(self : List\<T\>, f : T -> T)func mapResult\<T, R, E\>(self : List\<T\>, f : T -> Types.Result\<R, E\>) : Types.Result<List<R>, E>func max\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order)) : ?Tfunc min\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order)) : ?Tfunc nextIndexOf\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool), element : T, fromInclusive : Nat) : ?Natfunc prevIndexOf\<T\>(self : List\<T\>, equal : (implicit : (T, T) -> Bool), element : T, fromExclusive : Nat) : ?Natfunc put\<T\>(self : List\<T\>, index : Nat, value : T)func range\<T\>(self : List\<T\>, fromInclusive : Int, toExclusive : Int) : Types.Iter\<T\>func reader\<T\>(self : List\<T\>, start : Nat) : () -> Tfunc removeLast\<T\>(self : List\<T\>) : ?Tfunc repeat\<T\>(initValue : T, size : Nat) : List\<T\>func retain\<T\>(self : List\<T\>, predicate : T -> Bool)func reverse\<T\>(self : List\<T\>) : List\<T\>func reverseEnumerate\<T\>(self : List\<T\>) : Types.Iter<(Nat, T)>func reverseForEach\<T\>(self : List\<T\>, f : T -> ())func reverseForEachEntry\<T\>(self : List\<T\>, f : (Nat, T) -> ())func reverseInPlace\<T\>(self : List\<T\>)func reverseValues\<T\>(self : List\<T\>) : Types.Iter\<T\>func singleton\<T\>(element : T) : List\<T\>func size\<T\>(self : List\<T\>) : Natfunc sliceToArray\<T\>(self : List\<T\>, fromInclusive : Int, toExclusive : Int) : [T]func sliceToVarArray\<T\>(self : List\<T\>, fromInclusive : Int, toExclusive : Int) : [var T]func sort\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order)) : List\<T\>func sortInPlace\<T\>(self : List\<T\>, compare : (implicit : (T, T) -> Types.Order))func tabulate\<T\>(size : Nat, generator : Nat -> T) : List\<T\>func toArray\<T\>(self : List\<T\>) : [T]func toList\<T\>(self : Types.Iter\<T\>) : List\<T\>func toText\<T\>(self : List\<T\>, toText : (implicit : T -> Text)) : Textfunc toVarArray\<T\>(self : List\<T\>) : [var T]func truncate\<T\>(self : List\<T\>, newSize : Nat)func values\<T\>(self : List\<T\>) : Types.Iter\<T\>type List\<T\> = Types.List\<T\>
Map
func add\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K, value : V)func all\<K, V\>(self : Map\<K, V\>, predicate : (K, V) -> Bool) : Boolfunc any\<K, V\>(self : Map\<K, V\>, predicate : (K, V) -> Bool) : Boolfunc clear\<K, V\>(self : Map\<K, V\>)func clone\<K, V\>(self : Map\<K, V\>) : Map\<K, V\>func compare\<K, V\>(self : Map\<K, V\>, other : Map\<K, V\>, compareKey : (implicit : (compare : (K, K) -> Order.Order)), compareValue : (implicit : (compare : (V, V) -> Order.Order))) : Order.Orderfunc containsKey\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K) : Boolfunc empty\<K, V\>() : Map\<K, V\>func entries\<K, V\>(self : Map\<K, V\>) : Types.Iter<(K, V)>func entriesFrom\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K) : Types.Iter<(K, V)>func equal\<K, V\>(self : Map\<K, V\>, other : Map\<K, V\>, compare : (implicit : (K, K) -> Types.Order), equal : (implicit : (V, V) -> Bool)) : Boolfunc filter\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), criterion : (K, V) -> Bool) : Map\<K, V\>func filterMap\<K, V1, V2\>(self : Map\<K, V1\>, compare : (implicit : (K, K) -> Order.Order), project : (K, V1) -> ?V2) : Map\<K, V2\>func foldLeft\<K, V, A\>(self : Map\<K, V\>, base : A, combine : (A, K, V) -> A) : Afunc foldRight\<K, V, A\>(self : Map\<K, V\>, base : A, combine : (K, V, A) -> A) : Afunc forEach\<K, V\>(self : Map\<K, V\>, operation : (K, V) -> ())func fromArray\<K, V\>(array : [(K, V)], compare : (implicit : (K, K) -> Order.Order)) : Map\<K, V\>func fromIter\<K, V\>(iter : Types.Iter<(K, V)>, compare : (implicit : (K, K) -> Order.Order)) : Map\<K, V\>func fromVarArray\<K, V\>(array : [var (K, V)], compare : (implicit : (K, K) -> Order.Order)) : Map\<K, V\>func get\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K) : ?Vfunc isEmpty\<K, V\>(self : Map\<K, V\>) : Boolfunc keys\<K, V\>(self : Map\<K, V\>) : Types.Iter\<K\>func map\<K, V1, V2\>(self : Map\<K, V1\>, project : (K, V1) -> V2) : Map\<K, V2\>func maxEntry\<K, V\>(self : Map\<K, V\>) : ?(K, V)func minEntry\<K, V\>(self : Map\<K, V\>) : ?(K, V)func remove\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K)func replace\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K, value : V) : ?Vfunc reverseEntries\<K, V\>(self : Map\<K, V\>) : Types.Iter<(K, V)>func reverseEntriesFrom\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K) : Types.Iter<(K, V)>func singleton\<K, V\>(key : K, value : V) : Map\<K, V\>func size\<K, V\>(self : Map\<K, V\>) : Natfunc swap\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K, value : V) : ?Vfunc take\<K, V\>(self : Map\<K, V\>, compare : (implicit : (K, K) -> Order.Order), key : K) : ?Vfunc toArray\<K, V\>(self : Map\<K, V\>) : [(K, V)]func toMap\<K, V\>(self : Types.Iter<(K, V)>, compare : (implicit : (K, K) -> Order.Order)) : Map\<K, V\>func toText\<K, V\>(self : Map\<K, V\>, keyFormat : (implicit : (toText : K -> Text)), valueFormat : (implicit : (toText : V -> Text))) : Textfunc toVarArray\<K, V\>(self : Map\<K, V\>) : [var (K, V)]func values\<K, V\>(self : Map\<K, V\>) : Types.Iter\<V\>type Map\<K, V\> = Types.Map\<K, V\>
Nat
func add(x : Nat, y : Nat) : Natfunc allValues() : Iter.Iter\<Nat\>func bitshiftLeft(x : Nat, y : Nat32) : Natfunc bitshiftRight(x : Nat, y : Nat32) : Natfunc compare(x : Nat, y : Nat) : Order.Orderfunc div(x : Nat, y : Nat) : Natfunc equal(x : Nat, y : Nat) : Boolfunc fromText(text : Text) : ?Natfunc greater(x : Nat, y : Nat) : Boolfunc greaterOrEqual(x : Nat, y : Nat) : Boolfunc less(x : Nat, y : Nat) : Boolfunc lessOrEqual(x : Nat, y : Nat) : Boolfunc max(x : Nat, y : Nat) : Natfunc min(x : Nat, y : Nat) : Natfunc mul(x : Nat, y : Nat) : Natfunc notEqual(x : Nat, y : Nat) : Boolfunc pow(x : Nat, y : Nat) : Natfunc range(fromInclusive : Nat, toExclusive : Nat) : Iter.Iter\<Nat\>func rangeBy(fromInclusive : Nat, toExclusive : Nat, step : Int) : Iter.Iter\<Nat\>func rangeByInclusive(from : Nat, to : Nat, step : Int) : Iter.Iter\<Nat\>func rangeInclusive(from : Nat, to : Nat) : Iter.Iter\<Nat\>func rem(x : Nat, y : Nat) : Natfunc sub(x : Nat, y : Nat) : Natfunc toFloat(self : Nat) : Floatfunc toInt(self : Nat) : Intfunc toNat(self : Text) : ?Natfunc toNat16(self : Nat) : Nat16func toNat32(self : Nat) : Nat32func toNat64(self : Nat) : Nat64func toNat8(self : Nat) : Nat8func toText(self : Nat) : Texttype Nat = Prim.Types.Nat
Option
func apply\<T, R\>(self : ?T, f : ?(T -> R)) : ?Rfunc chain\<T, R\>(self : ?T, f : T -> ?R) : ?Rfunc compare\<T\>(self : ?T, other : ?T, compare : (implicit : (T, T) -> Types.Order)) : Types.Orderfunc equal\<T\>(self : ?T, other : ?T, eq : (implicit : (equal : (T, T) -> Bool))) : Boolfunc flatten\<T\>(self : ??T) : ?Tfunc forEach\<T\>(self : ?T, f : T -> ())func get\<T\>(self : ?T, default : T) : Tfunc getMapped\<T, R\>(self : ?T, f : T -> R, default : R) : Rfunc isNull(self : ?Any) : Boolfunc isSome(self : ?Any) : Boolfunc map\<T, R\>(self : ?T, f : T -> R) : ?Rfunc some\<T\>(self : T) : ?Tfunc toText\<T\>(self : ?T, toText : (implicit : T -> Text)) : Textfunc unwrap\<T\>(self : ?T) : T
Order
func allValues() : Types.Iter\<Order\>func equal(self : Order, other : Order) : Boolfunc isEqual(self : Order) : Boolfunc isGreater(self : Order) : Boolfunc isLess(self : Order) : Booltype Order = Types.Order
Principal
func anonymous() : Principalfunc compare(self : Principal, other : Principal) : { #less; #equal; #greater }func equal(self : Principal, other : Principal) : Boolfunc fromActor(a : actor {}) : Principalfunc fromBlob(blob : Blob) : Principalfunc fromText(t : Text) : Principalfunc greater(self : Principal, other : Principal) : Boolfunc greaterOrEqual(self : Principal, other : Principal) : Boolfunc hash(self : Principal) : Types.Hashfunc isAnonymous(self : Principal) : Boolfunc isCanister(self : Principal) : Boolfunc isController(self : Principal) : Boolfunc isReserved(self : Principal) : Boolfunc isSelfAuthenticating(self : Principal) : Boolfunc less(self : Principal, other : Principal) : Boolfunc lessOrEqual(self : Principal, other : Principal) : Boolfunc notEqual(self : Principal, other : Principal) : Boolfunc toActor<A <: actor {}>(p : Principal) : Afunc toBlob(self : Principal) : Blobfunc toLedgerAccount(self : Principal, subAccount : ?Blob) : Blobfunc toText(self : Principal) : Texttype Principal = Prim.Types.Principal
Queue
func all\<T\>(self : Queue\<T\>, predicate : T -> Bool) : Boolfunc any\<T\>(self : Queue\<T\>, predicate : T -> Bool) : Boolfunc clear\<T\>(self : Queue\<T\>)func clone\<T\>(self : Queue\<T\>) : Queue\<T\>func compare\<T\>(self : Queue\<T\>, other : Queue\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Order.Orderfunc contains\<T\>(self : Queue\<T\>, equal : (implicit : (T, T) -> Bool), element : T) : Boolfunc empty\<T\>() : Queue\<T\>func equal\<T\>(self : Queue\<T\>, other : Queue\<T\>, equal : (implicit : (T, T) -> Bool)) : Boolfunc filter\<T\>(self : Queue\<T\>, criterion : T -> Bool) : Queue\<T\>func filterMap\<T, U\>(self : Queue\<T\>, project : T -> ?U) : Queue\<U\>func forEach\<T\>(self : Queue\<T\>, operation : T -> ())func fromArray\<T\>(array : [T]) : Queue\<T\>func fromIter\<T\>(iter : Iter.Iter\<T\>) : Queue\<T\>func fromVarArray\<T\>(array : [var T]) : Queue\<T\>func isEmpty\<T\>(self : Queue\<T\>) : Boolfunc map\<T, U\>(self : Queue\<T\>, project : T -> U) : Queue\<U\>func peekBack\<T\>(self : Queue\<T\>) : ?Tfunc peekFront\<T\>(self : Queue\<T\>) : ?Tfunc popBack\<T\>(self : Queue\<T\>) : ?Tfunc popFront\<T\>(self : Queue\<T\>) : ?Tfunc pushBack\<T\>(self : Queue\<T\>, element : T)func pushFront\<T\>(self : Queue\<T\>, element : T)func reverseValues\<T\>(self : Queue\<T\>) : Iter.Iter\<T\>func singleton\<T\>(element : T) : Queue\<T\>func size\<T\>(self : Queue\<T\>) : Natfunc toArray\<T\>(self : Queue\<T\>) : [T]func toQueue\<T\>(self : Iter.Iter\<T\>) : Queue\<T\>func toText\<T\>(self : Queue\<T\>, format : (implicit : (toText : T -> Text))) : Textfunc toVarArray\<T\>(self : Queue\<T\>) : [var T]func values\<T\>(self : Queue\<T\>) : Iter.Iter\<T\>type Queue\<T\> = Types.Queue.Queue\<T\>
Result
func assertErr(self : Result\<Any, Any\>)func assertOk(self : Result\<Any, Any\>)func chain\<Ok1, Ok2, Err\>(self : Result\<Ok1, Err\>, f : Ok1 -> Result\<Ok2, Err\>) : Result\<Ok2, Err\>func compare\<Ok, Err\>(self : Result\<Ok, Err\>, other : Result\<Ok, Err\>, compareOk : (implicit : (compare : (Ok, Ok) -> Order.Order)), compareErr : (implicit : (compare : (Err, Err) -> Order.Order))) : Order.Orderfunc equal\<Ok, Err\>(self : Result\<Ok, Err\>, other : Result\<Ok, Err\>, equalOk : (implicit : (equal : Ok, Ok) -> Bool), equalErr : (implicit : (equal : (Err, Err) -> Bool))) : Boolfunc flatten\<Ok, Err\>(self : Result<Result<Ok, Err>, Err>) : Result\<Ok, Err\>func forErr\<Ok, Err\>(self : Result\<Ok, Err\>, f : Err -> ())func forOk\<Ok, Err\>(self : Result\<Ok, Err\>, f : Ok -> ())func fromOption\<Ok, Err\>(x : ?Ok, err : Err) : Result\<Ok, Err\>func fromUpper\<Ok, Err\>(result : { #Ok : Ok; #Err : Err }) : Result\<Ok, Err\>func isErr(self : Result\<Any, Any\>) : Boolfunc isOk(self : Result\<Any, Any\>) : Boolfunc mapErr\<Ok, Err1, Err2\>(self : Result\<Ok, Err1\>, f : Err1 -> Err2) : Result\<Ok, Err2\>func mapOk\<Ok1, Ok2, Err\>(self : Result\<Ok1, Err\>, f : Ok1 -> Ok2) : Result\<Ok2, Err\>func toOption\<Ok, Err\>(self : Result\<Ok, Err\>) : ?Okfunc toUpper\<Ok, Err\>(self : Result\<Ok, Err\>) : { #Ok : Ok; #Err : Err }type Result\<Ok, Err\> = Types.Result\<Ok, Err\>
Runtime
func envVar\<system\>(name : Text) : ?Textfunc envVarNames\<system\>() : [Text]func trap(errorMessage : Text) : Nonefunc unreachable() : None
Set
func add\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), element : T)func addAll\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), iter : Types.Iter\<T\>)func all\<T\>(self : Set\<T\>, predicate : T -> Bool) : Boolfunc any\<T\>(self : Set\<T\>, predicate : T -> Bool) : Boolfunc clear\<T\>(self : Set\<T\>)func clone\<T\>(self : Set\<T\>) : Set\<T\>func compare\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Order.Orderfunc contains\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), element : T) : Boolfunc deleteAll\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), iter : Types.Iter\<T\>) : Boolfunc difference\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func empty\<T\>() : Set\<T\>func equal\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Types.Order)) : Boolfunc filter\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), criterion : T -> Bool) : Set\<T\>func filterMap\<T1, T2\>(self : Set\<T1\>, compare : (implicit : (T2, T2) -> Order.Order), project : T1 -> ?T2) : Set\<T2\>func flatten\<T\>(self : Set<Set<T>>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func foldLeft\<T, A\>(self : Set\<T\>, base : A, combine : (A, T) -> A) : Afunc foldRight\<T, A\>(self : Set\<T\>, base : A, combine : (T, A) -> A) : Afunc forEach\<T\>(self : Set\<T\>, operation : T -> ())func fromArray\<T\>(array : [T], compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func fromIter\<T\>(iter : Types.Iter\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func insertAll\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), iter : Types.Iter\<T\>) : Boolfunc intersection\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func isEmpty\<T\>(self : Set\<T\>) : Boolfunc isSubset\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Boolfunc join\<T\>(setIterator : Types.Iter<Set<T>>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func map\<T1, T2\>(self : Set\<T1\>, compare : (implicit : (T2, T2) -> Order.Order), project : T1 -> T2) : Set\<T2\>func max\<T\>(self : Set\<T\>) : ?Tfunc min\<T\>(self : Set\<T\>) : ?Tfunc remove\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), element : T) : ()func retainAll\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), predicate : T -> Bool) : Boolfunc reverseValues\<T\>(self : Set\<T\>) : Types.Iter\<T\>func reverseValuesFrom\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), element : T) : Types.Iter\<T\>func singleton\<T\>(element : T) : Set\<T\>func size\<T\>(self : Set\<T\>) : Natfunc toArray\<T\>(self : Set\<T\>) : [T]func toSet\<T\>(self : Types.Iter\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func toText\<T\>(self : Set\<T\>, toText : (implicit : T -> Text)) : Textfunc union\<T\>(self : Set\<T\>, other : Set\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Set\<T\>func values\<T\>(self : Set\<T\>) : Types.Iter\<T\>func valuesFrom\<T\>(self : Set\<T\>, compare : (implicit : (T, T) -> Order.Order), element : T) : Types.Iter\<T\>type Set\<T\> = Types.Set.Set\<T\>
Stack
func all\<T\>(self : Stack\<T\>, predicate : T -> Bool) : Boolfunc any\<T\>(self : Stack\<T\>, predicate : T -> Bool) : Boolfunc clear\<T\>(self : Stack\<T\>)func clone\<T\>(self : Stack\<T\>) : Stack\<T\>func compare\<T\>(self : Stack\<T\>, other : Stack\<T\>, compare : (implicit : (T, T) -> Order.Order)) : Order.Orderfunc contains\<T\>(self : Stack\<T\>, equal : (implicit : (T, T) -> Bool), element : T) : Boolfunc empty\<T\>() : Stack\<T\>func equal\<T\>(self : Stack\<T\>, other : Stack\<T\>, equal : (implicit : (T, T) -> Bool)) : Boolfunc filter\<T\>(self : Stack\<T\>, predicate : T -> Bool) : Stack\<T\>func filterMap\<T, U\>(self : Stack\<T\>, project : T -> ?U) : Stack\<U\>func find\<T\>(self : Stack\<T\>, predicate : T -> Bool) : ?Tfunc findIndex\<T\>(self : Stack\<T\>, predicate : T -> Bool) : ?Natfunc forEach\<T\>(self : Stack\<T\>, operation : T -> ())func fromArray\<T\>(array : [T]) : Stack\<T\>func fromIter\<T\>(iter : Types.Iter\<T\>) : Stack\<T\>func fromVarArray\<T\>(array : [var T]) : Stack\<T\>func get\<T\>(self : Stack\<T\>, position : Nat) : ?Tfunc isEmpty\<T\>(self : Stack\<T\>) : Boolfunc map\<T, U\>(self : Stack\<T\>, project : T -> U) : Stack\<U\>func peek\<T\>(self : Stack\<T\>) : ?Tfunc pop\<T\>(self : Stack\<T\>) : ?Tfunc push\<T\>(self : Stack\<T\>, value : T)func reverse\<T\>(self : Stack\<T\>)func reverseValues\<T\>(self : Stack\<T\>) : Iter.Iter\<T\>func singleton\<T\>(element : T) : Stack\<T\>func size\<T\>(self : Stack\<T\>) : Natfunc tabulate\<T\>(size : Nat, generator : Nat -> T) : Stack\<T\>func toArray\<T\>(self : Stack\<T\>) : [T]func toStack\<T\>(self : Types.Iter\<T\>) : Stack\<T\>func toText\<T\>(self : Stack\<T\>, format : (implicit : (toText : T -> Text))) : Textfunc toVarArray\<T\>(self : Stack\<T\>) : [var T]func values\<T\>(self : Stack\<T\>) : Types.Iter\<T\>type Stack\<T\> = Types.Stack\<T\>
Text
func compare(self : Text, other : Text) : Order.Orderfunc compareWith(self : Text, other : Text, compare : (Char, Char) -> Order.Order) : Order.Orderfunc concat(self : Text, other : Text) : Textfunc contains(self : Text, p : Pattern) : Boolfunc decodeUtf8(self : Blob) : ?Textfunc encodeUtf8(self : Text) : Blobfunc endsWith(self : Text, p : Pattern) : Boolfunc equal(self : Text, other : Text) : Boolfunc flatMap(self : Text, f : Char -> Text) : Textfunc foldLeft\<A\>(self : Text, base : A, combine : (A, Char) -> A) : Afunc fromArray(a : [Char]) : Textfunc fromIter(cs : Iter.Iter\<Char\>) : Textfunc fromVarArray(a : [var Char]) : Textfunc greater(self : Text, other : Text) : Boolfunc greaterOrEqual(self : Text, other : Text) : Boolfunc isEmpty(self : Text) : Boolfunc join(self : Iter.Iter\<Text\>, sep : Text) : Textfunc less(self : Text, other : Text) : Boolfunc lessOrEqual(self : Text, other : Text) : Boolfunc map(self : Text, f : Char -> Char) : Textfunc notEqual(self : Text, other : Text) : Boolfunc replace(self : Text, p : Pattern, r : Text) : Textfunc reverse(self : Text) : Textfunc size(self : Text) : Natfunc split(self : Text, p : Pattern) : Iter.Iter\<Text\>func startsWith(self : Text, p : Pattern) : Boolfunc stripEnd(self : Text, p : Pattern) : ?Textfunc stripStart(self : Text, p : Pattern) : ?Textfunc toArray(self : Text) : [Char]func toIter(self : Text) : Iter.Iter\<Char\>func toLower(self : Text) : Textfunc toText(self : Text) : Textfunc toUpper(self : Text) : Textfunc toVarArray(self : Text) : [var Char]func tokens(self : Text, p : Pattern) : Iter.Iter\<Text\>func trim(self : Text, p : Pattern) : Textfunc trimEnd(self : Text, p : Pattern) : Textfunc trimStart(self : Text, p : Pattern) : Texttype Pattern = Types.Patterntype Text = Prim.Types.Text
Time
func now() : Timefunc toNanoseconds(duration : Duration) : Nattype Duration = Types.Durationtype Time = Types.Timetype TimerId = Nat
No
Time.compare— useInt.compareto compare times.
Timer
func cancelTimer(TimerId) : ()func recurringTimer\<system\>(duration : Time.Duration, job : () -> async ()) : TimerIdfunc setTimer\<system\>(duration : Time.Duration, job : () -> async ()) : TimerIdtype TimerId = Nat