flix

0.77.0

Prelude

Modules

Adaptor
Array
BigDecimalRepresents arbitrary-precision signed decimal numbers. The representation consists of both a "value" and a "scale". Standard equality (`==` and the `Eq` trait) consider both value and scale, numerical equality (are the values the same after the scales have been normalized) is provided by the function `numericEquals`.
BigInt
Bool
Channel
Char
CodePointThe `CodePoint` module complements the `Char` module. `Char` only represents characters in Unicode's _Basic Multilingual Plane_ (U+0000 to U+FFFF). CodePoint extends access to include _supplementary characters_ so all Unicode characters can be represented.
Concurrent
Fixpoint3
Float32
Float64
Fs## Effect Hierarchy
GraphA library of functions that operates on graphs, represented as foldable collections of either pairs or triples, for unweighted and weighted graphs respectively. These pairs, or triples, represent directed edges while nodes(vertices) are given implicitly.
Int16
Int32
Int64
Int8
MathThe `Math` module is a collection of mathematical utility submodules, each offering a self-contained piece of functionality:
NetThe `Net` module is a collection of networking utility submodules, each offering a self-contained piece of functionality:
Object
Reflect
RegexBasic support for regular expression matching on Strings.
String
SysThe `Sys` module is a collection of operating-system utility submodules, each offering a self-contained piece of functionality:
TimeThe `Time` module is a collection of time-related utility submodules, each offering a self-contained piece of functionality:
UtilThe `Util` module is a collection of general-purpose utility submodules, each offering a self-contained piece of functionality:
Vector

Traits

AddA trait for addition.
ApplicativeA trait for functors that support application, i.e. allow to:
BoxA trait for primitive types that can be boxed and unboxed.
CoerceA trait for type that can be coerced.
CollectableA trait representing collections that can be produced from an Iterator.
CommutativeGroupA trait for types that form a commutative group (abelian group) i.e. groups where the `combine` function is commutative.
CommutativeMonoidA trait for types that form a commutative monoid.
CommutativeSemiGroupA trait for types that form a commutative semigroup.
DiscreteA trait for types whose values form a discrete sequence, i.e. where every value has an immediate successor and predecessor.
DivA trait for division.
EqA trait for equality and inequality.
FilterableA trait for filtering container functors.
FoldableA trait for data structures that can be folded.
ForEachA trait for data structures that support a forEach operation.
FormattableA trait for types that can be formatted as a `RichString`.
FromStringA trait for types that can be constructed from strings.
FunctorA trait for types that can be mapped over.
GroupA trait for types that form a group.
HashA trait for types that can be hashed.
IndexableAn `Indexable` instance on a type means that it has a (partial or total) mapping from indices (`Idx`) to elements (`Elm`). The mapping can be accessed by `get`.
IndexableMutAn `IndexableMut` instance on a type means that it has a (potentially partial) mapping from indices (`Indexable.Idx`) to elements (`Indexable.Elm`). The mapping can be modified and potentially expanded. The mapping can be accessed by `Indexable.get` and modified by `put`.
IterableA trait for immutable data structures that can be iterated.
JoinLatticeA trait for join semi lattices.
LowerBoundA trait for partially ordered types that have a lower bound.
MeetLatticeA trait for meet semi lattices. A Meet Lattice is pair of functions (⊑, ⊓) where ⊑ is a partial order and ⊓ satisfy two properties: lower-bound and greatest-lower-bound.
MonadA trait 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`).
MonadZeroA trait for Monads that have a zero element.
MonadZipA trait for zipping Monads, typically container monads like `List`.
MonoidA trait for Monoids, objects that support an associative binary operation `combine` and neutral element `empty`.
MulA trait for multiplication.
NegA trait for negation.
OrderA trait for types with a total order.
PartialOrderA Partial Order is a function ⊑ which satisfies three properties: reflexivity, anti-symmetry, and transitivity.
PeekableExtends `Readable` with the ability to `peek` at values that have not yet been `read`, `skip` values that don't need to be read, and perform other kinds of conditional reads.
ReadableA trait for types which are resources that can be read from.
ReducibleA trait for types that can be reduced to a summary value.
SemiGroupA trait for types that form a semigroup.
SubA trait for subtraction.
ToFlixA trait for marshaling values to Flix objects.
ToJavaA trait for marshaling values to Java objects.
ToStringA trait for types that can be converted to strings.
TraversableA trait for data structures that can be traversed in left-to-right order with an applicative functor.
UnorderedFoldableA trait for unordered data structures that can be folded.
UpperBoundA trait for partially ordered types that have an upper bound.
WitherableA trait for data structures that can be traversed in left-to-right order with an applicative partial functor.
WritableA trait for types which are resources that can be written to.

Effects

AbortAn effect used to abort computation with an error message.
AssertAn effect used to perform assertions during program execution.
ChanThe uninterpretable Chan effect.
DebugAn effect used for print debugging.
IOThe uninterpretable IO effect.
KeyNotFoundIndicates that a key was not found. Useful for instances of `Index` or `IndexMut`.
LoggerAn effect used to log messages.
NonDetThe uninterpretable `NonDet` effect.
OutOfBoundsIndicates that an index was out of bounds. Useful for instances of `Index` or `IndexMut`.

Enums

ChainThe Chain type.
CharacterSet
Comparison
DelayList
DelayMap
DownThe `Down` type allows you to reverse the sort order of `a` conveniently.
EncodingWriterAdapts a `Writable` of bytes to a `Writable` of chars.
Identity
IoErrorAn error that can occur when performing I/O operations involving the file system.
Iterator
ListThe List type.
MapThe Map type.
MultiMapThe MultiMap type.
NecThe NonEmpty Chain type.
NelThe NonEmptyList type.
OptionThe Option type.
ProxyAn enum that holds type information where a witness is not available.
ProxyBoolAn enum that holds type-level Bool information where a witness is not available.
ProxyEffAn enum that holds effect information where a witness is not available.
Purity
Purity2
Purity3
RangeRepresents a range (b, e) of discrete values from `b` (inclusive) to `e` (exclusive).
RedBlackTreeAn immutable red-black tree implementation with keys of type `k` and values of type `v`.
ResultThe Result type.
RichStringA rich string composed of multiple styled spans.
SetThe Set type.
StringBuilderRepresents a StringBuilder.
ValidationThe Validation type.

Structs

BPlusTreeA mutable concurrent B+ Tree implementation with keys of type `k` and values of type `v`.
BufReaderA `Readable` implementation that wraps an underlying `Readable` instance and stores the items read from the underlying instance in an internal buffer.
DecodingReaderAdapts a `Readable` of bytes to a `Readable` of chars.
MutDequeRepresents a mutable deque.
MutDisjointSetsRepresents a mutable disjoint set data structure using union-by-rank and path compression.
MutHashMapRepresents a mutable hash map that preserves insertion order.
MutHashSetRepresents a mutable hash set that preserves insertion order.
MutListRepresents a mutable list.
MutMapThe Mutable Map type.
MutPriorityQueueRepresents 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.
MutSetThe Mutable Set type.
Ref

Type Aliases

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] \ Aef[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 indexOutOfBounds!(m: String): a§ Source

Throws an IndexOutOfBoundsException with the given message m.

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