flix

0.77.0

Prelude

Modules

AdaptorFunctions for converting between Flix and Java values and collections.
ArrayType of mutable fixed-length arrays, and its functions.
BigDecimalType of arbitrary-precision signed decimal numbers, and its functions.
BigIntType of arbitrary-precision signed integers, and its functions.
BoolType of boolean values, and its functions.
ChannelFunctions for message passing over channels.
CharType of 16-bit Unicode characters, and its functions.
CodePointFunctions for working with Unicode code points.
ConcurrentModules for concurrent programming.
Fixpoint3Functions for solving Datalog programs.
Float32Type of 32-bit floating-point numbers, and its functions.
Float64Type of 64-bit floating-point numbers, and its functions.
FsModules for interacting with the file system.
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.
Int16Type of 16-bit signed integers, and its functions.
Int32Type of 32-bit signed integers, and its functions.
Int64Type of 64-bit signed integers, and its functions.
Int8Type of 8-bit signed integers, and its functions.
MathModules for mathematical utilities.
NetModules for networking.
ObjectFunctions for working with Java objects and `null` values.
ReflectFunctions for reflecting on the runtime representation of values and types.
RegexType of compiled regular expressions, and its functions.
StringType of immutable strings, and its functions.
SysModules for interacting with the operating system.
TimeModules for working with time.
UtilModules for general-purpose utilities.
VectorType of immutable arrays, and its functions.

Traits

AddTrait for types that support addition.
ApplicativeTrait for types that support embedding values and applying embedded functions.
BoxA trait for primitive types that can be boxed and unboxed.
CoerceTrait for types that can be coerced.
CollectableTrait for types that can be collected from an iterator.
CommutativeGroupTrait for types that form a commutative group.
CommutativeMonoidTrait for types that form a commutative monoid.
CommutativeSemiGroupTrait for types that form a commutative semigroup.
DiscreteTrait for types that form a discrete sequence.
DivTrait for types that support division.
EqTrait for types that support equality and inequality.
FilterableTrait for types that support filtering.
FoldableTrait for types that can be folded.
ForEachTrait for types that support iterating over their elements with `forEach`.
FormattableTrait for types that can be formatted as a `RichString`.
FromStringTrait for types that can be constructed from strings.
FunctorTrait for types that can be mapped over.
GroupTrait for types that form a group.
HashTrait for types that can be hashed.
IndexableTrait for types that map indices to elements.
IndexableMutTrait for types that map indices to elements and can be modified.
IterableTrait for types that can be iterated.
JoinLatticeTrait for types that form a join semi-lattice.
LowerBoundTrait for types that are partially ordered and have a lower bound.
MeetLatticeTrait for types that form a meet semi-lattice.
MonadTrait for types that support monadic bind (`flatMap`).
MonadZeroTrait for types that are monads with a zero element.
MonadZipTrait for types that are monads that support zipping.
MonoidTrait for types that form a monoid.
MulTrait for types that support multiplication.
NegTrait for types that support negation.
OrderTrait for types that have a total order.
PartialOrderTrait for types that have a partial order.
PeekableTrait for types that can be read from with lookahead.
ReadableTrait for types that can be read from.
ReducibleTrait for types that can be reduced to a summary value.
SemiGroupTrait for types that form a semigroup.
SubTrait for types that support subtraction.
ToFlixTrait for types that can be marshaled to Flix values.
ToJavaTrait for types that can be marshaled to Java objects.
ToStringTrait for types that can be converted to strings.
TraversableTrait for types that can be traversed from left to right with an applicative functor.
UnorderedFoldableTrait for types that can be folded without regard to order.
UpperBoundTrait for types that are partially ordered and have an upper bound.
WitherableTrait for types that can be traversed from left to right with an applicative functor while filtering elements.
WritableTrait for types that can be written to.

Effects

AbortEffect for aborting a computation with an error message.
AssertEffect for performing assertions during program execution.
ChanEffect for operations on channels in the global region.
DebugAn effect used for print debugging.
IOEffect for actions not described by any other effect.
KeyNotFoundEffect for signaling that a key was not found.
LoggerEffect for logging messages.
NonDetEffect for non-deterministic actions.
OutOfBoundsEffect for signaling that an index is out of bounds.

Enums

ChainType of immutable sequences with efficient append.
CharacterSetType of character sets for encoding and decoding text.
ComparisonType of comparison results.
DelayListType of lazy lists.
DelayMapType of immutable maps with lazily evaluated values.
DownType of values with reversed ordering.
EncodingWriterType of writers that encode chars into bytes.
IdentityType of values in the identity functor and monad.
IoErrorType of errors that can occur when performing I/O operations involving the file system.
IteratorType of lazy iterators scoped to a region.
ListType of immutable singly-linked lists.
MapType of immutable maps.
MultiMapType of immutable maps that allow multiple values per key.
NecType of non-empty chains.
NelType of non-empty immutable lists.
OptionType of optional values.
ProxyType of proxies that carry type information where a witness is not available.
ProxyBoolType of proxies that carry type-level Boolean information where a witness is not available.
ProxyEffType of proxies that carry effect information where a witness is not available.
PurityType of unary functions tagged as either pure or impure.
Purity2Type of curried binary functions tagged as either pure or impure.
Purity3Type of curried ternary functions tagged as either pure or impure.
RangeType of half-open ranges of discrete values.
RedBlackTreeType of immutable red-black trees.
ResultType of results that are either a successful value or an error value.
RichStringType of rich strings composed of styled text spans.
SetType of immutable ordered sets.
StringBuilderType of mutable string builders.
ValidationType of validation results that are either a successful value or a non-empty collection of errors.

Structs

BPlusTreeType of mutable concurrent B+ trees.
BufReaderType of buffered readers.
DecodingReaderType of readers that decode bytes into chars.
MutDequeType of mutable double-ended queues.
MutDisjointSetsType of mutable disjoint sets (union-find).
MutHashMapType of mutable hash maps that preserve insertion order.
MutHashSetType of mutable hash sets that preserve insertion order.
MutListType of mutable lists backed by resizable arrays.
MutMapType of mutable maps.
MutPriorityQueueType of mutable priority queues.
MutSetType of mutable sets.
RefRepresents a mutable reference to a value of type `a` in region `r`.

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