module Implements the most basic data types. Espcially those needed for built-in functionality and for the compiler. Will always be imported implicitly.
- extern Any
- enum Bool
- extern Char
- data Cons
- extern Dict
- data False
- extern Float
- extern Function
- extern Int
- enum List
- enum Maybe
- extern Module
- enum Never
- data Nil
- data None
- enum Optional
- data Pair
- data Some
- extern String
- data True
- data Void
- func compose f, g, value
- func const value, _
- extern debug message
- extern eager value
- func identity value
- func if condition, then, else
- func pipe functions, initial
- extern print message
- func unless condition, then
- func when condition, then
- func with value, body
extern Any value that exists.
enum
Represents boolean values like True
and False
.
Typically used for conditionals and flags.
extern A single character of a string.
data Represents a non-empty List.
head
- The first elementtail
- The remaining list. @type List
extern Stores values for given String-keys. As dicts are immutable, all changing operations return new copies.
delete key
- Creates a copy Dict, which includes no value for the given key. The current Dict stays at it is.entries
- A List of all entries as Pair.get key
- Returns Some value for a specific key or None.keys
- A List of all keys.length
- The count of all key-value-pairs.set key, value
- Creates a copy Dict, which includes the given key-value-pair. The current Dict stays at it is.values
- A List of all values.
data A constant to represent invalid conditions.
extern A base type for floating point numbers like 13.37.
extern A function that may be called.
arity
- The minimum arity of the function. If it returns another function, the actual arity might be higher.
extern A base type for non-fractional numbers like -1, 0, 1 and 2.
enum A list of arbiratry elements.
import lists
let myList = [1, 2, 3, 4]
lists.reduce { l, r => l + r }, 0, myList
enum An uknown value. Might be an optional, the value itself or None.
extern A module. Either from an import or by a module-declaration.
enum An enum with no valid values. Allows empty, but valid type expressions.
data Marks the end of the list.
data
enum An optional value. Either some value or none.
data A pair of values.
key
- The associated key.value
- The associated value.
data
value
extern Represents text like "hello world".
append str
- Allows to append another string.length
- The length of the string.
data A constant to represent valid conditions.
data Represents a single value.
func compose f, g, value
Composes two given functions. Calls the second function first and pipes the result into the second one.
func const value, _
Always returns the first argument.
func debug message
Prints a debug message to stdout.
func eager value
Eagerly evaluates a given value recursively. All members of lists, dictionaries and data structures will be evaluated.
func identity value
Always returns the given argument.
func if condition, then, else
When the given condition evaluates to True
, returns then
. Otherwise false
.
Both, then
and else
are evaluted lazily.
if True, print "Succeeded", exit 1
func pipe functions, initial
Pipes a given value through a list of functions. The first function is applied to the value, the second to the result of the first, etc.
func print message
Prints a message to stdout.
func unless condition, then
Only if a condition is False, the right side will be executed and returned. Otherwise Void.
func when condition, then
Only if a condition is True, the right side will be executed and returned. Otherwise Void.
func with value, body
Applies the given body to the given value. Mostly useful for readability, e.g. in destructings.
with True, Bool(True: { _ => }, False: { _ => })