Prelude

Type Aliases

type alias FileIO = FsRead + FsWrite Source

A type alias for the FileRead and FileWrite effects.

type alias Heap[h: Eff] = h Source

A type alias used while we transition to a proper Heap effect.

type alias Static = IO Source

Static denotes the region of global lifetime.

Definitions

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

Pipes the given value x into the function f.

Given a value x and a function f returns x.

def ++(x: a, y: a): a with SemiGroup[a] Source

Alias for SemiGroup.combine.

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

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): a Source

Crashes the current process with the given message m.

def coerce(x: t): Out[t] with Coerce[t] Source

Coerces the given value x.

def constant(x: a): b -> a \ ef Source

The constant function.

def eidentity(x: a): a \ ef Source

The identity function, automatically casting to the required effect.

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)): a Source

Returns the first component of t.

def identity(x: a): a Source

The pure identity function.

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

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 \ IO with ToString[a] Source

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

def purityOf(f: a -> b \ ef): Purity[a, b, ef] Source

Returns Purity.Pure(g) if f has no effects. Returns Purity.Impure(g) otherwise. The function g can then be used in a context that requires it to be pure.

def purityOf2(f: a -> (b -> c \ ef)): Purity2[a, b, c, ef] Source

Returns Purity2.Pure(g) if f has no effects. Returns Purity2.Impure(g) otherwise. The function g can then be used in a context that requires it to be pure.

def purityOf3(f: a -> (b -> (c -> d \ ef))): Purity3[a, b, c, d, ef] Source

Returns Purity3.Pure(g) if f has no effects. Returns Purity3.Impure(g) otherwise. The function g can then be used in a context that requires it to be pure.

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

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 \ r Source

Touches the given region capability rc.

def unreachable!(): a Source

Asserts that this expression is unreachable. Crashes if not.

def |+|(x: a, y: a): a with CommutativeSemiGroup[a] Source

Alias for CommutativeSemiGroup.combine.

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

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 \ ef Source

Pipes the given pair x into the function f.

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