!=
(Any, Any) > Bool
Returns true if the two value are not equal
%
(Int, Int) > Int
Returns the result of wrapping `a` around so that `0 <= res < b`.
The modulus `b` must be 0 or negative.
Use `Int::remainder` if you want the remainder after division, which has a different behavior for negative numbers.
&&
(Bool, Bool) > Bool
Returns true if both a and b are true
*
(Int, Int) > Int
Multiplies two integers
+
(Int, Int) > Int
Adds two integers together
++
(Str, Str) > Str
Concatenates the two strings by appending `s2` to `s1` and returns the joined string.

(Int, Int) > Int
Subtracts two integers
/
(Float, Float) > Float
Divide float `a` by float `b`
<
(Int, Int) > Bool
Returns true if a is less than b
<=
(Int, Int) > Bool
Returns true if a is less than or equal to b
==
(Any, Any) > Bool
Returns true if the two value are equal
>
(Int, Int) > Bool
Returns true if a is greater than b
>=
(Int, Int) > Bool
Returns true if a is greater than or equal to b
AWS::urlencode
(Str) > Str
Url encode a string per AWS' requirements
Bool::and
(Bool, Bool) > Bool
Returns true if both a and b are true
Bool::isNull
(Any) > Bool
Returns true if the `check` parameter is null
Bool::not
(Bool) > Bool
Returns the inverse of `b`: true if `b` is false and false if `b` is true
Bool::or
(Bool, Bool) > Bool
Returns true if either a is true or b is true
Bool::xor
(Bool, Bool) > Bool
Returns `true` if exactly one of `a` and `b` is `true`. Returns `false` if both are `true` or neither is `true`.
Bytes::base64Encode
(Bytes) > Str
Base64URL encodes `bytes` with `=` padding. Uses URLsafe encoding with `` and `_` instead of `+` and `/`, as defined in RFC 4648 section 5.
Bytes::hexEncode
(Bytes) > Str
Hex (Base16) encodes `bytes` using an uppercase alphabet. Complies with RFC 4648 section 8.
Bytes::length
(Bytes) > Int
Length of encoded byte string
Crypto::md5
(Bytes) > Bytes
Computes the md5 digest of the given `data`. NOTE: There are multiple security problems with md5, see https://en.wikipedia.org/wiki/MD5#Security
Crypto::sha1hmac
(Bytes, Bytes) > Bytes
Computes the SHA1HMAC (hashbased message authentication code) digest of the given `key` and `data`.
Crypto::sha256
(Bytes) > Bytes
Computes the SHA256 digest of the given `data`.
Crypto::sha256hmac
(Bytes, Bytes) > Bytes
Computes the SHA256 HMAC (hashbased message authentication code) digest of the given `key` and `data`.
Crypto::sha384
(Bytes) > Bytes
Computes the SHA384 digest of the given `data`.
DB::count
(Datastore) > Int
Return the number of items stored in `table`.
DB::deleteAll_v1
(Datastore) > Nothing
Delete everything from `table`
DB::delete_v1
(Str, Datastore) > Nothing
Delete `key` from `table`
DB::generateKey
() > Str
Returns a random key suitable for use as a DB key
DB::getAllWithKeys_v2
(Datastore) > Dict
Fetch all the values in `table`. Returns an object with key: value. ie. {key : value, key2: value2}
DB::getAll_v3
(Datastore) > List
Fetch all the values in `table`.
DB::getExisting
(List, Datastore) > List
Finds many values in `table` by `keys` (ignoring any missing items), returning a [value] list of values
DB::getManyWithKeys_v1
(List, Datastore) > Dict
Finds many values in `table` by `keys, returning a {key:{value}, key2: {value2}} object of keys and values
DB::getMany_v3
(List, Datastore) > Option
Finds many values in `table` by `keys`. If all `keys` are found, returns Just a list of [values], otherwise returns Nothing (to ignore missing keys, use DB::getExisting)
DB::get_v2
(Str, Datastore) > Option
Finds a value in `table` by `key
DB::keys_v1
(Datastore) > List
Fetch all the keys of entries in `table`. Returns an list with strings
DB::queryCount
(Datastore, Block) > Int
Return the number of items from `table` for which filter returns true. Note that this does not check every value in `table`, but rather is optimized to find data with indexes. Errors at compiletime if Dark's compiler does not support the code in question.
DB::queryExactFields
(Dict, Datastore) > List
Fetch all the values from `table` which have the same fields and values that `spec` has, returning a list of values. Previously called DB::query_v3
DB::queryExactFieldsWithKey
(Dict, Datastore) > Dict
Fetch all the values from `table` which have the same fields and values that `spec` has
, returning {key : value} as an object. Previous called DB::queryWithKey_v2
DB::queryOneWithExactFields
(Dict, Datastore) > Option
Fetch exactly one value from `table` which have the same fields and values that `spec` has. If there is exactly one value, it returns Just value and if there is none or more than 1 found, it returns Nothing. Previously called DB::queryOne_v2
DB::queryOneWithExactFieldsWithKey
(Dict, Datastore) > Option
Fetch exactly one value from `table` which have the same fields and values that `spec` has. If there is exactly one key/value pair, it returns Just {key: value} and if there is none or more than 1 found, it returns Nothing. Previously called DB::queryOnewithKey_v2
DB::queryOneWithKey_v3
(Datastore, Block) > Option
Fetch exactly one value from `table` for which filter returns true. Note that this does not check every value in `table`, but rather is optimized to find data with indexes. If there is exactly one key/value pair, it returns Just {key: value} and if there is none or more than 1 found, it returns Nothing. Errors at compiletime if Dark's compiler does not support the code in question.
DB::queryOne_v4
(Datastore, Block) > Option
Fetch exactly one value from `table` for which filter returns true. Note that this does not check every value in `table`, but rather is optimized to find data with indexes. If there is exactly one value, it returns Just value and if there is none or more than 1 found, it returns Nothing. Errors at compiletime if Dark's compiler does not support the code in question.
DB::queryWithKey_v3
(Datastore, Block) > Dict
Fetch all the values from `table` for which filter returns true, returning {key : value} as an object. Note that this does not check every value in `table`, but rather is optimized to find data with indexes. Errors at compiletime if Dark's compiler does not support the code in question.
DB::query_v4
(Datastore, Block) > List
Fetch all the values from `table` for which filter returns true. Note that this does not check every value in `table`, but rather is optimized to find data with indexes. Errors at compiletime if Dark's compiler does not support the code in question.
DB::schemaFields_v1
(Datastore) > List
Fetch all the fieldNames in `table`
DB::schema_v1
(Datastore) > Dict
Returns an `Obj` representing { fieldName: fieldType } in `table`
DB::set_v1
(Dict, Str, Datastore) > Dict
Upsert `val` into `table`, accessible by `key`
Date::<
(Date, Date) > Bool
Returns whether `d1` < ` d2`
Date::<=
(Date, Date) > Bool
Returns whether `d1` <= ` d2`
Date::>
(Date, Date) > Bool
Returns whether `d1` > ` d2`
Date::>=
(Date, Date) > Bool
Returns whether `d1` >= ` d2`
Date::add
(Date, Int) > Date
Returns a new Date `seconds` seconds after `d`
Date::atStartOfDay
(Date) > Date
Returns the Date with the time set to midnight
Date::day
(Date) > Int
Returns the day portion of the Date as an int
Date::fromSeconds
(Int) > Date
Converts an integer representing seconds since the Unix epoch into a Date
Date::greaterThan
(Date, Date) > Bool
Returns whether `d1` > ` d2`
Date::greaterThanOrEqualTo
(Date, Date) > Bool
Returns whether `d1` >= ` d2`
Date::hour_v1
(Date) > Int
Returns the hour portion of the Date as an int
Date::lessThan
(Date, Date) > Bool
Returns whether `d1` < ` d2`
Date::lessThanOrEqualTo
(Date, Date) > Bool
Returns whether `d1` <= ` d2`
Date::minute
(Date) > Int
Returns the minute portion of the Date as an int
Date::month
(Date) > Int
Returns the month portion of the Date as an int between 1 and 12
Date::now
() > Date
Returns the current time.
Date::parse_v2
(Str) > Result
Parses a string representing a date and time in the ISO 8601 format (for example: 20190907T22:44:25Z) and returns the Date wrapped in a Result.
Date::second
(Date) > Int
Returns the second portion of the Date as an int
Date::subtract
(Date, Int) > Date
Returns a new Date `seconds` seconds before `d`
Date::toSeconds
(Date) > Int
Converts a Date `date` to an integer representing seconds since the Unix epoch
Date::toString
(Date) > Str
Stringify `date` to the ISO 8601 format YYYYMMDD'T'hh:mm:ss'Z'
Date::toStringISO8601BasicDate
(Date) > Str
Stringify `date` to the ISO 8601 basic format YYYYMMDD
Date::toStringISO8601BasicDateTime
(Date) > Str
Stringify `date` to the ISO 8601 basic format YYYYMMDD'T'hhmmss'Z'
Date::today
() > Date
Returns the Date with the time set to midnight
Date::weekday
(Date) > Int
Returns the weekday of `date` as an int. Monday = 1, Tuesday = 2, ... Sunday = 7 (in accordance with ISO 8601).
Date::year
(Date) > Int
Returns the year portion of the Date as an int
Dict::empty
() > Dict
Returns an empty dictionary.
Dict::filterMap
(Dict, Block) > Dict
Calls `f` on every entry in `dict`, returning a new dictionary that drops some entries (filter) and transforms others (map).
If `f key value` returns `Nothing`, does not add `key` or `value` to the new dictionary, dropping the entry.
If `f key value` returns `Just newValue`, adds the entry `key`: `newValue` to the new dictionary.
This function combines `Dict::filter` and `Dict::map`.
Dict::filter_v1
(Dict, Block) > Dict
Evaluates `f key value` on every entry in `dict`. Returns a new dictionary that contains only the entries of `dict` for which `f` returned `true`.
Dict::fromList
(List) > Option
Each value in `entries` must be a `[key, value]` list, where `key` is a `String`.
If `entries` contains no duplicate keys, returns `Just dict` where `dict` has `entries`.
Otherwise, returns `Nothing` (use `Dict::fromListOverwritingDuplicates` if you want to overwrite duplicate keys).
Dict::fromListOverwritingDuplicates
(List) > Dict
Returns a new dict with `entries`. Each value in `entries` must be a `[key, value]` list, where `key` is a `String`.
If `entries` contains duplicate `key`s, the last entry with that key will be used in the resulting dictionary (use `Dict::fromList` if you want to enforce unique keys).
This function is the opposite of `Dict::toList`.
Dict::get_v2
(Dict, Str) > Option
If the `dict` contains `key`, returns the corresponding value, wrapped in an option: `Just value`. Otherwise, returns `Nothing`.
Dict::isEmpty
(Dict) > Bool
Returns `true` if the `dict` contains no entries.
Dict::keys
(Dict) > List
Returns `dict`'s keys in a list, in an arbitrary order.
Dict::map
(Dict, Block) > Dict
Returns a new dictionary that contains the same keys as the original `dict` with values that have been transformed by `f`, which operates on each keyvalue pair.
Consider `Dict::filterMap` if you also want to drop some of the entries.
Dict::member
(Dict, Str) > Bool
Returns `true` if the `dict` contains an entry with `key`, and `false` otherwise.
Dict::merge
(Dict, Dict) > Dict
Returns a combined dictionary with both dictionaries' entries. If the same key exists in both `left` and `right`, it will have the value from `right`.
Dict::remove
(Dict, Str) > Dict
If the `dict` contains `key`, returns a copy of `dict` with `key` and its associated value removed. Otherwise, returns `dict` unchanged.
Dict::set
(Dict, Str, Any) > Dict
Returns a copy of `dict` with the `key` set to `val`.
Dict::singleton
(Str, Any) > Dict
Returns a new dictionary with a single entry `key`: `value`.
Dict::size
(Dict) > Int
Returns the number of entries in `dict` (the number of keyvalue pairs).
Dict::toJSON
(Dict) > Str
Returns `dict` as a JSON string.
Dict::toList
(Dict) > List
Returns `dict`'s entries as a list of `[key, value]` lists, in an arbitrary order. This function is the opposite of `Dict::fromList`.
Dict::values
(Dict) > List
Returns `dict`'s values in a list, in an arbitrary order.
Float::absoluteValue
(Float) > Float
Returns the absolute value of `a` (turning negative inputs into positive outputs).
Float::add
(Float, Float) > Float
Add float `a` to float `b`
Float::ceiling
(Float) > Int
Round up to an integer value
Float::clamp
(Float, Float, Float) > Float
If `value` is within the range given by `limitA` and `limitB`, returns `value`.
If `value` is outside the range, returns `limitA` or `limitB`, whichever is closer to `value`.
`limitA` and `limitB` can be provided in any order.
Float::divide
(Float, Float) > Float
Divide float `a` by float `b`
Float::floor
(Float) > Int
Round down to an integer value. Consider Float::truncate if your goal is to discard the fractional part of a number: `Float::floor 1.9 == 2.0` but `Float::truncate 1.9 == 1.0`.
Float::greaterThan
(Float, Float) > Bool
Returns true if a is greater than b
Float::greaterThanOrEqualTo
(Float, Float) > Bool
Returns true if a is greater than b
Float::lessThan
(Float, Float) > Bool
Returns true if a is less than b
Float::lessThanOrEqualTo
(Float, Float) > Bool
Returns true if a is less than b
Float::max
(Float, Float) > Float
Returns the greater of float `a` and float `b`
Float::min
(Float, Float) > Float
Returns the lesser of float `a` and float `b`
Float::multiply
(Float, Float) > Float
Multiply float `a` by float `b`
Float::negate
(Float) > Float
Returns the negation of `a`, `a`.
Float::power
(Float, Float) > Float
Returns `base` raised to the power of `exponent`
Float::round
(Float) > Int
Round to the nearest integer value
Float::roundDown
(Float) > Int
Round down to an integer value. Consider Float::truncate if your goal is to discard the fractional part of a number: `Float::floor 1.9 == 2.0` but `Float::truncate 1.9 == 1.0`.
Float::roundTowardsZero
(Float) > Int
Discard the fractional portion of the float, rounding towards zero.
Float::roundUp
(Float) > Int
Round up to an integer value
Float::sqrt
(Float) > Float
Get the square root of a float
Float::subtract
(Float, Float) > Float
Subtract float `b` from float `a`
Float::sum
(List) > Float
Returns the sum of all the floats in the list
Float::truncate
(Float) > Int
Discard the fractional portion of the float, rounding towards zero.
Http::badRequest
(Str) > Response
Returns a Response that can be returned from an HTTP handler to respond with a 400 status and string `error` message.
Http::forbidden
() > Response
Returns a Response that can be returned from an HTTP handler to respond with 403 Forbidden.
Http::notFound
() > Response
Returns a Response that can be returned from an HTTP handler to respond with 404 Not Found.
Http::redirectTo
(Str) > Response
Returns a Response that can be returned from an HTTP handler to respond with a 302 redirect to `url`.
Http::response
(Any, Int) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status `code` and `response` body.
Http::responseWithHeaders
(Any, Dict, Int) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status `code`, `response` body, and `headers`.
Http::responseWithHtml
(Any, Int) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status `code` and `response` body, with `contenttype` set to "text/html".
Http::responseWithJson
(Any, Int) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status `code` and `response` body, with `contenttype` set to "application/json"
Http::responseWithText
(Any, Int) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status `code` and `response` body, with `contenttype` set to "text/plain".
Http::setCookie_v2
(Str, Str, Dict) > Dict
Returns an HTTP SetCookie header suitable for use with , given a cookie , a for it, and a of SetCookie ({{Expires}}, {{MaxAge}}, {{Domain}}, {{Path}}, {{Secure}}, {{HttpOnly}}, and/or {{SameSite}}).
Http::success
(Any) > Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status 200 and `response` body.
Http::unauthorized
() > Response
Returns a Response that can be returned from an HTTP handler to respond with 401 Unauthorized.
HttpClient::basicAuth_v1
(Str, Str) > Dict
Returns an object with 'Authorization' created using HTTP basic auth
HttpClient::bearerToken_v1
(Str) > Dict
Returns an object with 'Authorization' set to the passed token
HttpClient::delete_v5
(Str, Dict, Dict) > Result
Make blocking HTTP DELETE call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::formContentType
() > Dict
Returns an object with 'ContentType' for urlencoded HTML forms
HttpClient::get_v5
(Str, Dict, Dict) > Result
Make blocking HTTP GET call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::head_v5
(Str, Dict, Dict) > Result
Make blocking HTTP HEAD call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::htmlContentType
() > Dict
Returns an object with 'ContentType' for html
HttpClient::jsonContentType
() > Dict
Returns an object with 'ContentType' for JSON
HttpClient::options_v5
(Str, Dict, Dict) > Result
Make blocking HTTP OPTIONS call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::patch_v5
(Str, Any, Dict, Dict) > Result
Make blocking HTTP PATCH call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::plainTextContentType
() > Dict
Returns an object with 'ContentType' for plain text
HttpClient::post_v5
(Str, Any, Dict, Dict) > Result
Make blocking HTTP POST call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
HttpClient::put_v5
(Str, Any, Dict, Dict) > Result
Make blocking HTTP PUT call to `uri`. Returns a `Result` object where the response object is wrapped in `Ok` if the status code is in the 2xx range, and is wrapped in `Error` otherwise. Parsing errors/UTF8 decoding errors are also `Error` wrapped response objects, with a message in the `body` and/or `raw` fields
Int::absoluteValue
(Int) > Int
Returns the absolute value of `a` (turning negative inputs into positive outputs).
Int::add
(Int, Int) > Int
Adds two integers together
Int::clamp
(Int, Int, Int) > Int
If `value` is within the range given by `limitA` and `limitB`, returns `value`.
If `value` is outside the range, returns `limitA` or `limitB`, whichever is closer to `value`.
`limitA` and `limitB` can be provided in any order.
Int::divide
(Int, Int) > Int
Divides two integers
Int::greaterThan
(Int, Int) > Bool
Returns true if a is greater than b
Int::greaterThanOrEqualTo
(Int, Int) > Bool
Returns true if a is greater than or equal to b
Int::lessThan
(Int, Int) > Bool
Returns true if a is less than b
Int::lessThanOrEqualTo
(Int, Int) > Bool
Returns true if a is less than or equal to b
Int::max
(Int, Int) > Int
Returns the higher of a and b
Int::min
(Int, Int) > Int
Returns the lower of `a` and `b`
Int::mod
(Int, Int) > Int
Returns the result of wrapping `a` around so that `0 <= res < b`.
The modulus `b` must be 0 or negative.
Use `Int::remainder` if you want the remainder after division, which has a different behavior for negative numbers.
Int::multiply
(Int, Int) > Int
Multiplies two integers
Int::negate
(Int) > Int
Returns the negation of `a`, `a`.
Int::power
(Int, Int) > Int
Raise `base` to the power of `exponent`
Int::random_v1
(Int, Int) > Int
Returns a random integer between `start` and `end` (inclusive).
Int::remainder
(Int, Int) > Result
Returns the integer remainder left over after dividing `value` by `divisor`, as a Result.
For example, `Int::remainder 15 6 == Ok 3`. The remainder will be negative only if `value < 0`.
The sign of `divisor` doesn't influence the outcome.
Returns an `Error` if `divisor` is 0.
Int::sqrt
(Int) > Float
Get the square root of an Int
Int::subtract
(Int, Int) > Int
Subtracts two integers
Int::sum
(List) > Int
Returns the sum of all the ints in the list
Int::toFloat
(Int) > Float
Converts an Int to a Float
JSON::parse_v1
(Str) > Result
Parses a json string and returns its value. HTTPClient functions, and our request handler, automatically parse JSON into the `body` and `jsonbody` fields, so you probably won't need this. However, if you need to consume bad JSON, you can use string functions to fix the JSON and then use this function to parse it.
JWT::signAndEncodeWithHeaders_v1
(Str, Dict, Any) > Result
Sign and encode an rfc751J9 JSON Web Token, using the RS256 algorithm, with an extra header map. Takes an unecnrypted RSA private key in PEM format.
JWT::signAndEncode_v1
(Str, Any) > Result
Sign and encode an rfc751J9 JSON Web Token, using the RS256 algorithm. Takes an unecnrypted RSA private key in PEM format.
JWT::verifyAndExtract_v1
(Str, Str) > Result
Verify and extra the payload and headers from an rfc751J9 JSON Web Token that uses the RS256 algorithm. Takes an unencrypted RSA public key in PEM format.
List::append
(List, List) > List
Returns a new list with all values in `as` followed by all values in `bs`, preserving the order.
List::drop
(List, Int) > List
Drops the first `count` values from `list`.
List::dropWhile
(List, Block) > List
Drops the longest prefix of `list` which satisfies the predicate `val`
List::empty
() > List
Returns an empty list.
List::filterMap
(List, Block) > List
Calls `f` on every `val` in `list`, returning a new list that drops some values (filter) and transforms others (map).
If `f val` returns `Nothing`, drops `val` from the list.
If `f val` returns `Just newValue`, replaces `val` with `newValue`.
Preserves the order of values that were not dropped.
This function combines `List::filter` and `List::map`.
List::filter_v2
(List, Block) > List
Calls `f` on every `val` in `list`, returning a list of only those values for which `f val` returns `true`.
Preserves the order of values that were not dropped.
Consider `List::filterMap` if you also want to transform the values.
List::findFirst_v2
(List, Block) > Option
Returns `Just firstMatch` where `firstMatch` is the first value of the list for which `f` returns `true`. Returns `Nothing` if no such value exists.
List::flatten
(List) > List
Returns a single list containing the values of every list directly in `list` (does not recursively flatten nested lists).
List::fold
(List, Any, Block) > Any
Folds `list` into a single value, by repeatedly applying `f` to any two pairs.
List::getAt_v1
(List, Int) > Option
Returns `Just value` at `index` in `list` if `index` is less than the length of the list otherwise returns `Nothing`.
List::head_v2
(List) > Option
Returns `Just` the head (first value) of a list. Returns `Nothing` if the list is empty.
List::indexedMap
(List, Block) > List
Calls `f` on every `val` and its `index` in `list`, returning a list of the results of those calls.
Consider `List::map` if you don't need the index.
List::isEmpty
(List) > Bool
Returns true if `list` has no values.
List::last_v2
(List) > Option
Returns the last value in `list`, wrapped in an option (`Nothing` if the list is empty).
List::length
(List) > Int
Returns the number of values in `list`.
List::map
(List, Block) > List
Calls `f` on every `val` in `list`, returning a list of the results of those calls.
Consider `List::filterMap` if you also want to drop some of the values.
List::map2
(List, List, Block) > Option
If the lists are the same length, returns `Just list` formed by mapping `f` over `as` and `bs` in parallel,
calling `f a b` on every pair of values from `as` and `bs`.
For example, if `as` is `[1,2,3]` and `bs` is `["x","y","z"]`, returns `[(f 1 "x"), (f 2 "y"), (f 3 "z")]`.
If the lists differ in length, returns `Nothing` (consider `List::map2shortest` if you want to drop values from the longer list instead).
List::map2shortest
(List, List, Block) > List
Maps `f` over `as` and `bs` in parallel, calling `f a b` on every pair of values from `as` and `bs`.
If the lists differ in length, values from the longer list are dropped.
For example, if `as` is `[1,2]` and `bs` is `["x","y","z"]`, returns `[(f 1 "x"), (f 2 "y")]`.
Use `List::map2` if you want to enforce equivalent lengths for `as` and `bs`.
List::member
(List, Any) > Bool
Returns `true` if `val` is in the list.
List::push
(List, Any) > List
Add element `val` to front of list `list`
List::pushBack
(List, Any) > List
Add element `val` to back of list `list`
List::randomElement
(List) > Option
Returns {{Just }}, where is a randomly selected value in . Returns {{Nothing}} if is empty.
List::range
(Int, Int) > List
Returns a list of numbers where each element is 1 larger than the previous. You provide the `lowest` and `highest` numbers in the list. If `lowest` is greater than `highest`, returns the empty list.
List::repeat
(Int, Any) > List
Returns a new list containing `val` repeated `times` times.
List::reverse
(List) > List
Returns a reversed copy of `list`.
List::singleton
(Any) > List
Returns a oneelement list containing the given `val`.
List::sort
(List) > List
Returns a copy of `list` with every value sorted in ascending order. Use this if the values have types Dark knows how to sort.
Consider `List::sortBy` or `List::sortByComparator` if you need more control over the sorting process.
List::sortBy
(List, Block) > List
Returns a copy of `list`, sorted in ascending order, as if each value evaluated to `f val`.
For example, `List::sortBy ["x","jkl","ab"] \val > String::length val` returns `[ "x", "ab", "jkl" ]`.
Consider `List::sort` if the list values can be directly compared, or `List::sortByComparator` if you want more control over the sorting process.
List::sortByComparator
(List, Block) > Result
Returns a copy of `list`, sorted using `f a b` to compare values `a` and `b`.
`f` must return `1` if `a` should appear before `b`, `1` if `a` should appear after `b`, and `0` if the order of `a` and `b` doesn't matter.
Consider `List::sort` or `List::sortBy` if you don't need this level of control.
List::tail
(List) > Option
If the list contains at least one value, returns `Just` a list of every value other than the first. Otherwise, returns `Nothing`.
List::take
(List, Int) > List
Drops all but the first `count` values from `list`.
List::takeWhile
(List, Block) > List
Return the longest prefix of `list` which satisfies the predicate `val`
List::uniqueBy
(List, Block) > List
Returns the passed list, with only unique values, where uniqueness is based on the result of `f`. Only one of each value will be returned, but the order will not be maintained.
List::unzip
(List) > List
Given a `pairs` list where each value is a list of two values (such lists are constructed by `List::zip` and `List::zipShortest`), returns a list of two lists,
one with every first value, and one with every second value. For example, if `pairs` is `[[1,"x"], [2,"y"], [3,"z"]]`, returns `[[1,2,3], ["x","y","z"]]`.
List::zip
(List, List) > Option
If the lists have the same length, returns `Just list` formed from parallel pairs in `as` and `bs`.
For example, if `as` is `[1,2,3]` and `bs` is `["x","y","z"]`, returns `[[1,"x"], [2,"y"], [3,"z"]]`.
See `List::unzip` if you want to deconstruct `list` into `as` and `bs` again.
If the lists differ in length, returns `Nothing` (consider `List::zipShortest` if you want to drop values from the longer list instead).
List::zipShortest
(List, List) > List
Returns a list of parallel pairs from `as` and `bs`.
If the lists differ in length, values from the longer list are dropped.
For example, if `as` is `[1,2]` and `bs` is `["x","y","z"]`, returns `[[1,"x"], [2,"y"]]`.
Use `List::zip` if you want to enforce equivalent lengths for `as` and `bs`.
See `List::unzip` if you want to deconstruct the result into `as` and `bs` again.
Math::acos
(Float) > Option
Returns the arc cosine of `ratio`, as an Option.
If `ratio` is in the inclusive range `[1.0, 1.0]`, returns
`Just result` where `result` is in radians and is between `0.0` and `Math::pi`. Otherwise, returns `Nothing`.
This function is the inverse of `Math::cos`.
Math::asin
(Float) > Option
Returns the arc sine of `ratio`, as an Option.
If `ratio` is in the inclusive range `[1.0, 1.0]`, returns
`Just result` where `result` is in radians and is between `Math::pi/2` and `Math::pi/2`. Otherwise, returns `Nothing`.
This function is the inverse of `Math::sin`.
Math::atan
(Float) > Float
Returns the arc tangent of `ratio`. The result is in radians and is between `Math::pi/2` and `Math::pi/2`.
This function is the inverse of `Math::tan`. Use `Math::atan2` to expand the output range, if you know the numerator and denominator of `ratio`.
Math::atan2
(Float, Float) > Float
Returns the arc tangent of `y / x`, using the signs of `y` and `x` to determine the quadrant of the result.
The result is in radians and is between `Math::pi` and `Math::pi`. Consider `Math::atan` if you know the value of `y / x` but not the individual values `x` and `y`.
Math::cos
(Float) > Float
Returns the cosine of the given `angleInRadians`.
One interpretation of the result relates to a right triangle: the cosine is the ratio of the lengths of the side adjacent to the angle and the hypotenuse.
Math::cosh
(Float) > Float
Returns the hyperbolic cosine of `angleInRadians`.
Math::degrees
(Float) > Float
Returns the equivalent of `angleInDegrees` in radians, the unit used by all of Dark's trigonometry functions.
There are 360 degrees in a circle.
Math::pi
() > Float
Returns an approximation for the mathematical constant π, the ratio of a circle's circumference to its diameter.
Math::radians
(Float) > Float
Returns `angleInRadians` in radians, the unit used by all of Dark's trigonometry functions.
There are `Float::multiply 2 Math::pi` radians in a circle.
Math::sin
(Float) > Float
Returns the sine of the given `angleInRadians`.
One interpretation of the result relates to a right triangle: the sine is the ratio of the lengths of the side opposite the angle and the hypotenuse.
Math::sinh
(Float) > Float
Returns the hyperbolic sine of `angleInRadians`.
Math::tan
(Float) > Float
Returns the tangent of the given `angleInRadians`.
One interpretation of the result relates to a right triangle: the tangent is the ratio of the lengths of the side opposite the angle and the side adjacent to the angle.
Math::tanh
(Float) > Float
Returns the hyperbolic tangent of `angleInRadians`.
Math::tau
() > Float
Returns an approximation for the mathematical constant τ, the number of radians in one turn. Equivalent to `Float::multiply Math::pi 2`.
Math::turns
(Float) > Float
Returns the equivalent of `angleInTurns` in radians, the unit used by all of Dark's trigonometry functions.
There is 1 turn in a circle.
Option::andThen
(Option, Block) > Option
If is {{Just }}, returns {{f }}. Where the lambda is applied to and must return {{Just }} or {{Nothing}}. Otherwise if is {{Nothing}}, returns {{Nothing}}.
Option::map2
(Option, Option, Block) > Option
If both arguments are {{Just}} ( is {{Just }} and is {{Just }}), then return {{Just (f )}}  The lambda should have two parameters, representing and . But if either or are {{Nothing}}, returns {{Nothing}} without applying .
Option::map_v1
(Option, Block) > Option
If is {{Just }}, then return {{Just (f )}}. The lambda applied to and the result is wrapped in {{Just}}. Otherwise if the result is {{Nothing}}, then return {{Nothing}}.
Option::withDefault
(Option, Any) > Any
If is {{Just }}, returns . Returns otherwise.
Password::check
(Password, Str) > Bool
Check whether a Password matches a raw password String safely. This uses libsodium's pwhash under the hood, which is based on argon2.
NOTE: This is not usable interactively, because we do not send Password values to the client for security reasons.
Password::hash
(Str) > Password
Hash a password into a Password by salting and hashing it. This uses libsodium's crypto_pwhash_str under the hood, which is based on argon2.
NOTE: This is not usable interactively, because we do not send Password values to the client for security reasons.
Result::andThen_v1
(Result, Block) > Result
If is {{Ok }}, returns {{f }}. The lambda is applied to and must return {{Error }} or {{Ok }}. If is {{Error }}, returns unchanged.
Result::fromOption_v1
(Option, Str) > Result
Turn an option into a result, using as the error message for Error. Specifically, if is {{Just }}, returns {{Ok }}. Returns {{Error }} otherwise.
Result::map2
(Result, Result, Block) > Result
If both is {{Ok }} and is {{Ok }}, returns {{Ok (f )}}  the lambda is applied to and , and the result is wrapped in {{Ok}}. Otherwise, returns the first of and that is an error.
Result::mapError_v1
(Result, Block) > Result
If is {{Error }}, returns {{Error (f )}}. The lambda is applied to and the result is wrapped in {{Error}}. If is {{Ok }}, returns unchanged.
Result::map_v1
(Result, Block) > Result
If is {{Ok }}, returns {{Ok (f )}}. The lambda is applied to and the result is wrapped in {{Ok}}. If is {{Error }}, returns unchanged.
Result::toOption_v1
(Result) > Option
Turn a result into an option.
Result::withDefault
(Result, Any) > Any
If is {{Ok }}, returns . Returns otherwise.
StaticAssets::baseUrlFor
(Str) > Str
Return the baseUrl for the specified deploy hash
StaticAssets::baseUrlForLatest
() > Str
Return the baseUrl for the latest deploy
StaticAssets::fetchBytes
(Str, Str) > Result
Return the bytes of the specified file from the deploy_hash
StaticAssets::fetchLatestBytes
(Str) > Result
Return the bytes of the specified file from the latest deploy
StaticAssets::fetchLatest_v1
(Str) > Result
Return the specified file from the latest deploy  only works on UTF8safe files for now
StaticAssets::fetch_v1
(Str, Str) > Result
Return the specified file from the deploy_hash  only works on UTF8safe files for now
StaticAssets::serveLatest_v1
(Str) > Result
Return the specified file from the latest deploy
StaticAssets::serve_v1
(Str, Str) > Result
Return the specified file from the latest deploy
StaticAssets::urlFor
(Str, Str) > Str
Return a url for the specified file and deploy hash
StaticAssets::urlForLatest
(Str) > Str
Return a url for the specified file and latest deploy
String::append_v1
(Str, Str) > Str
Concatenates the two strings by appending `s2` to `s1` and returns the joined string.
String::base64Decode
(Str) > Str
Base64 decodes a string. Works with both the URLsafe and standard Base64 alphabets defined in RFC 4648 sections 4 and 5.
String::base64Encode
(Str) > Str
URLBase64 encodes a string without padding. Uses URLsafe encoding with `` and `_` instead of `+` and `/`, as defined in RFC 4648 section 5.
String::contains
(Str, Str) > Bool
Checks if `lookingIn` contains `searchingFor`
String::digest
(Str) > Str
Take a string and hash it to a cryptographicallysecure digest.
Don't rely on either the size or the algorithm.
String::dropFirst
(Str, Int) > Str
Returns all but the first `characterCount` characters of `string`, as a String.
If `characterCount` is longer than `string`, returns the empty string.
If `characterCount` is negative, returns `string`.
String::dropLast
(Str, Int) > Str
Returns all but the last `characterCount` characters of `string`, as a String.
If `characterCount` is longer than `string`, returns the empty string.
If `characterCount` is negative, returns `string`.
String::endsWith
(Str, Str) > Bool
Checks if `subject` ends with `suffix`
String::first
(Str, Int) > Str
Returns the first `characterCount` characters of `string`, as a String.
If `characterCount` is longer than `string`, returns `string`.
If `characterCount` is negative, returns the empty string.
String::foreach_v1
(Str, Block) > Str
Iterate over each Character (EGC, not byte) in the string, performing the operation in the block on each one.
String::fromChar_v1
(Character) > Str
Converts a char to a string
String::fromList_v1
(List) > Str
Returns the list of characters as a string
String::htmlEscape
(Str) > Str
Escape an untrusted string in order to include it safely in HTML output.
String::isEmpty
(Str) > Bool
Returns `true` if `s` is the empty string "".
String::join
(List, Str) > Str
Combines a list of strings with the provided separator
String::last
(Str, Int) > Str
Returns the last `characterCount` characters of `string`, as a String.
If `characterCount` is longer than `string`, returns `string`.
If `characterCount` is negative, returns the empty string.
String::length_v1
(Str) > Int
Returns the length of the string
String::newline
() > Str
Returns a string containing a single '
'
String::padEnd
(Str, Str, Int) > Str
If `string` is shorter than `goalLength` characters, returns a copy of `string` ending with enough copies of `padWith` for the result have `goalLength`.
If the `string` is longer than `goalLength`, returns an unchanged copy of `string`.
String::padStart
(Str, Str, Int) > Str
If `string` is shorter than `goalLength` characters, returns a copy of `string` starting with enough copies of `padWith` for the result have `goalLength`.
If the `string` is longer than `goalLength`, returns an unchanged copy of `string`.
String::prepend
(Str, Str) > Str
Concatenates the two strings by prepending `s2` to `s1` and returns the joined string.
String::random_v2
(Int) > Result
Generate a string of length `length` from random characters.
String::replaceAll
(Str, Str, Str) > Str
Replace all instances on `searchFor` in `s` with `replaceWith`
String::reverse
(Str) > Str
Reverses `string`
String::slice
(Str, Int, Int) > Str
Returns the substring of `string` between the `from` and `to` indices.
Negative indices start counting from the end of `string`.
Indices represent characters.
String::slugify_v2
(Str) > Str
Turns a string into a prettified slug, including only lowercased alphanumeric characters, joined by hyphens
String::split
(Str, Str) > List
Splits a string at the separator, returning a list of strings without the separator. If the separator is not present, returns a list containing only the initial string.
String::startsWith
(Str, Str) > Bool
Checks if `subject` starts with `prefix`
String::toBytes
(Str) > Bytes
Converts the given unicode string to a utf8encoded byte sequence.
String::toFloat_v1
(Str) > Result
Returns the float value of the string
String::toInt_v1
(Str) > Result
Returns the int value of the string, wrapped in a `Ok`, or `Error ` if the string contains characters other than numeric digits
String::toList_v1
(Str) > List
Returns the list of Characters (EGC, not byte) in the string
String::toLowercase_v1
(Str) > Str
Returns the string, lowercased
String::toUUID_v1
(Str) > Result
Parse a UUID of form XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX from the input `uuid` string
String::toUppercase_v1
(Str) > Str
Returns the string, uppercased
String::trim
(Str) > Str
Returns a copy of `str` with all leading and trailing whitespace removed. 'whitespace' here means all Unicode characters with the `White_Space` property, which includes " ", "\t" and "\n".
String::trimEnd
(Str) > Str
Returns a copy of `str` with all trailing whitespace removed. 'whitespace' here means all Unicode characters with the `White_Space` property, which includes " ", "\t" and "\n".
String::trimStart
(Str) > Str
Returns a copy of `str` with all leading whitespace removed. 'whitespace' here means all Unicode characters with the `White_Space` property, which includes " ", "\t" and "\n".
Twilio::sendText_v1
(Str, Str, Str, Str, Str) > Dict
Send text with `body` to phone number `toNumber` from number `fromNumber`, authenticated via `accountSID` and `authToken`
Uuid::generate
() > UUID
Generate a new UUID v4 according to RFC 4122
X509::pemCertificatePublicKey
(Str) > Result
Extract the public key from a PEM encoded certificate and return the key in PEM format.
^
(Int, Int) > Int
Raise `base` to the power of `exponent`
emit_v1
(Any, Str) > Any
Emit a `event` to the `name` worker
equals
(Any, Any) > Bool
Returns true if the two value are equal
notEquals
(Any, Any) > Bool
Returns true if the two value are not equal
toString
(Any) > Str
Returns a string representation of `v`, suitable for displaying to a user. Redacts passwords.

(Bool, Bool) > Bool
Returns true if either a is true or b is true