!=(Any a, Any b) -> Bool
Returns true if the two value are not equal

%(Int a, Int b) -> Int
Returns the result of wrappingaaround so that0 <= res < b. The modulusbmust be 0 or negative. UseInt::remainderif you want the remainder after division, which has a different behavior for negative numbers.

&&(Bool a, Bool b) -> Bool
Returns true if both a and b are true

*(Int a, Int b) -> Int
Multiplies two integers

+(Int a, Int b) -> Int
Adds two integers together

++(Str s1, Str s2) -> Str
Concatenates the two strings by appendings2tos1and returns the joined string.

-(Int a, Int b) -> Int
Subtracts two integers

/(Float a, Float b) -> Float
Divide floataby floatb

<(Int a, Int b) -> Bool
Returns true if a is less than b

<=(Int a, Int b) -> Bool
Returns true if a is less than or equal to b

==(Any a, Any b) -> Bool
Returns true if the two value are equal

>(Int a, Int b) -> Bool
Returns true if a is greater than b

>=(Int a, Int b) -> Bool
Returns true if a is greater than or equal to b

AWS::urlencode(Str str) -> Str
Url encode a string per AWS' requirements

Bool::and(Bool a, Bool b) -> Bool
Returns true if both a and b are true

Bool::isNull(Any check) -> Bool
Returns true if thecheckparameter is null

Bool::not(Bool b) -> Bool
Returns the inverse ofb: true ifbis false and false ifbis true

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

Bool::xor(Bool a, Bool b) -> Bool
Returnstrueif exactly one ofaandbistrue. Returnsfalseif both aretrueor neither istrue.

Bytes::base64Encode(Bytes bytes) -> Str
Base64URL encodesbyteswith=padding. Uses URL-safe encoding with-and_instead of+and/ as defined in RFC 4648 section 5.

Bytes::hexEncode(Bytes bytes) -> Str
Hex (Base16) encodesbytesusing an uppercase alphabet. Complies with RFC 4648 section 8.

Bytes::length(Bytes bytes) -> Int
Length of encoded byte string

Crypto::md5(Bytes data) -> Bytes
Computes the md5 digest of the givendata. NOTE: There are multiple security problems with md5, see https://en.wikipedia.org/wiki/MD5#Security

Crypto::sha1hmac(Bytes key, Bytes data) -> Bytes
Computes the SHA1-HMAC (hash-based message authentication code) digest of the givenkeyanddata.

Crypto::sha256(Bytes data) -> Bytes
Computes the SHA-256 digest of the givendata.

Crypto::sha256hmac(Bytes key, Bytes data) -> Bytes
Computes the SHA-256 HMAC (hash-based message authentication code) digest of the givenkeyanddata.

Crypto::sha384(Bytes data) -> Bytes
Computes the SHA-384 digest of the givendata.

DB::count(Datastore table) -> Int
Return the number of items stored intable.

DB::deleteAll_v1(Datastore table) -> Nothing
Delete everything fromtable

DB::delete_v1(Str key, Datastore table) -> Nothing
Deletekeyfromtable

DB::generateKey() -> Str
Returns a random key suitable for use as a DB key

DB::getAllWithKeys_v2(Datastore table) -> Dict
Fetch all the values intable. Returns an object with key: value. ie. {key : value, key2: value2}

DB::getAll_v3(Datastore table) -> List
Fetch all the values intable.

DB::getExisting(List keys, Datastore table) -> List
Finds many values intablebykeys(ignoring any missing items), returning a [value] list of values

DB::getManyWithKeys_v1(List keys, Datastore table) -> Dict
Finds many values intablebykeys, returning a {key:{value}, key2: {value2}} object of keys and values

DB::getMany_v3(List keys, Datastore table) -> Option
Finds many values intablebykeys. If allkeysare found, returns Just a list of [values], otherwise returns Nothing (to ignore missing keys, use DB::getExisting)

DB::get_v2(Str key, Datastore table) -> Option
Finds a value intablebykey

DB::keys_v1(Datastore table) -> List
Fetch all the keys of entries intable. Returns an list with strings

DB::queryCount(Datastore table, Block filter) -> Int
Return the number of items fromtablefor which filter returns true. Note that this does not check every value intable but rather is optimized to find data with indexes. Errors at compile-time if Dark's compiler does not support the code in question.

DB::queryExactFields(Dict spec, Datastore table) -> List
Fetch all the values fromtablewhich have the same fields and values thatspechas, returning a list of values. Previously called DB::query_v3

DB::queryExactFieldsWithKey(Dict spec, Datastore table) -> Dict
Fetch all the values fromtablewhich have the same fields and values thatspechas , returning {key : value} as an object. Previous called DB::queryWithKey_v2

DB::queryOneWithExactFields(Dict spec, Datastore table) -> Option
Fetch exactly one value fromtablewhich have the same fields and values thatspechas. 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 spec, Datastore table) -> Option
Fetch exactly one value fromtablewhich have the same fields and values thatspechas. 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 table, Block filter) -> Option
Fetch exactly one value fromtablefor which filter returns true. Note that this does not check every value intable 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 compile-time if Dark's compiler does not support the code in question.

DB::queryOne_v4(Datastore table, Block filter) -> Option
Fetch exactly one value fromtablefor which filter returns true. Note that this does not check every value intable 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 compile-time if Dark's compiler does not support the code in question.

DB::queryWithKey_v3(Datastore table, Block filter) -> Dict
Fetch all the values fromtablefor which filter returns true, returning {key : value} as an object. Note that this does not check every value intable but rather is optimized to find data with indexes. Errors at compile-time if Dark's compiler does not support the code in question.

DB::query_v4(Datastore table, Block filter) -> List
Fetch all the values fromtablefor which filter returns true. Note that this does not check every value intable but rather is optimized to find data with indexes. Errors at compile-time if Dark's compiler does not support the code in question.

DB::schemaFields_v1(Datastore table) -> List
Fetch all the fieldNames intable

DB::schema_v1(Datastore table) -> Dict
Returns anObjrepresenting { fieldName: fieldType } intable

DB::set_v1(Dict val, Str key, Datastore table) -> Dict
Upsertvalintotable accessible bykey

Date::<(Date d1, Date d2) -> Bool
Returns whetherd1< d2

Date::<=(Date d1, Date d2) -> Bool
Returns whetherd1<= d2

Date::>(Date d1, Date d2) -> Bool
Returns whetherd1> d2

Date::>=(Date d1, Date d2) -> Bool
Returns whetherd1>= d2

Date::add(Date d, Int seconds) -> Date
Returns a new Datesecondsseconds afterd

Date::day(Date date) -> Int
Returns the day portion of the Date as an int

Date::fromSeconds(Int seconds) -> Date
Converts an integer representing seconds since the Unix epoch into a Date

Date::greaterThan(Date d1, Date d2) -> Bool
Returns whetherd1> d2

Date::greaterThanOrEqualTo(Date d1, Date d2) -> Bool
Returns whetherd1>= d2

Date::hour_v1(Date date) -> Int
Returns the hour portion of the Date as an int

Date::lessThan(Date d1, Date d2) -> Bool
Returns whetherd1< d2

Date::lessThanOrEqualTo(Date d1, Date d2) -> Bool
Returns whetherd1<= d2

Date::minute(Date date) -> Int
Returns the minute portion of the Date as an int

Date::month(Date 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 s) -> Result
Parses a string representing a date and time in the ISO 8601 format (for example: 2019-09-07T22:44:25Z) and returns the Date wrapped in a Result.

Date::second(Date date) -> Int
Returns the second portion of the Date as an int

Date::subtract(Date d, Int seconds) -> Date
Returns a new Datesecondsseconds befored

Date::toSeconds(Date date) -> Int
Converts a Datedateto an integer representing seconds since the Unix epoch

Date::toString(Date date) -> Str
Stringifydateto the ISO 8601 format YYYY-MM-DD'T'hh:mm:ss'Z'

Date::toStringISO8601BasicDate(Date date) -> Str
Stringifydateto the ISO 8601 basic format YYYYMMDD

Date::toStringISO8601BasicDateTime(Date date) -> Str
Stringifydateto the ISO 8601 basic format YYYYMMDD'T'hhmmss'Z'

Date::weekday(Date date) -> Int
Returns the weekday ofdateas an int. Monday = 1, Tuesday = 2, ... Sunday = 7 (in accordance with ISO 8601).

Date::year(Date date) -> Int
Returns the year portion of the Date as an int

Dict::empty() -> Dict
Returns an empty dictionary.

Dict::filterMap(Dict dict, Block f) -> Dict
Callsfon every entry indict returning a new dictionary that drops some entries (filter) and transforms others (map). Iff key valuereturnsNothing does not addkeyorvalueto the new dictionary, dropping the entry. Iff key valuereturnsJust newValue adds the entrykey:newValueto the new dictionary. This function combinesDict::filterandDict::map.

Dict::filter_v1(Dict dict, Block f) -> Dict
Evaluatesf key valueon every entry indict. Returns a new dictionary that contains only the entries ofdictfor whichfreturnedtrue.

Dict::fromList(List entries) -> Option
Each value inentriesmust be a[key, value]list, wherekeyis aString. Ifentriescontains no duplicate keys, returnsJust dictwheredicthasentries. Otherwise, returnsNothing(useDict::fromListOverwritingDuplicatesif you want to overwrite duplicate keys).

Dict::fromListOverwritingDuplicates(List entries) -> Dict
Returns a new dict withentries. Each value inentriesmust be a[key, value]list, wherekeyis aString. Ifentriescontains duplicatekeys, the last entry with that key will be used in the resulting dictionary (useDict::fromListif you want to enforce unique keys). This function is the opposite ofDict::toList.

Dict::get_v2(Dict dict, Str key) -> Option
If thedictcontainskey returns the corresponding value, wrapped in an option:Just value. Otherwise, returnsNothing.

Dict::isEmpty(Dict dict) -> Bool
Returnstrueif thedictcontains no entries.

Dict::keys(Dict dict) -> List
Returnsdict's keys in a list, in an arbitrary order.

Dict::map(Dict dict, Block f) -> Dict
Returns a new dictionary that contains the same keys as the originaldictwith values that have been transformed byf which operates on each key-value pair. ConsiderDict::filterMapif you also want to drop some of the entries.

Dict::member(Dict dict, Str key) -> Bool
Returnstrueif thedictcontains an entry withkey andfalseotherwise.

Dict::merge(Dict left, Dict right) -> Dict
Returns a combined dictionary with both dictionaries' entries. If the same key exists in bothleftandright it will have the value fromright.

Dict::remove(Dict dict, Str key) -> Dict
If thedictcontainskey returns a copy ofdictwithkeyand its associated value removed. Otherwise, returnsdictunchanged.

Dict::set(Dict dict, Str key, Any val) -> Dict
Returns a copy ofdictwith thekeyset toval.

Dict::singleton(Str key, Any value) -> Dict
Returns a new dictionary with a single entrykey:value.

Dict::size(Dict dict) -> Int
Returns the number of entries indict(the number of key-value pairs).

Dict::toJSON(Dict dict) -> Str
Returnsdictas a JSON string.

Dict::toList(Dict dict) -> List
Returnsdict's entries as a list of[key, value]lists, in an arbitrary order. This function is the opposite ofDict::fromList.

Dict::values(Dict dict) -> List
Returnsdict's values in a list, in an arbitrary order.

Float::absoluteValue(Float a) -> Float
Returns the absolute value ofa(turning negative inputs into positive outputs).

Float::add(Float a, Float b) -> Float
Add floatato floatb

Float::ceiling(Float a) -> Int
Round up to an integer value

Float::clamp(Float value, Float limitA, Float limitB) -> Float
Ifvalueis within the range given bylimitAandlimitB returnsvalue. Ifvalueis outside the range, returnslimitAorlimitB whichever is closer tovalue. limitAandlimitBcan be provided in any order.

Float::divide(Float a, Float b) -> Float
Divide floataby floatb

Float::floor(Float a) -> 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.0butFloat::truncate -1.9 == -1.0.

Float::greaterThan(Float a, Float b) -> Bool
Returns true if a is greater than b

Float::greaterThanOrEqualTo(Float a, Float b) -> Bool
Returns true if a is greater than b

Float::lessThan(Float a, Float b) -> Bool
Returns true if a is less than b

Float::lessThanOrEqualTo(Float a, Float b) -> Bool
Returns true if a is less than b

Float::max(Float a, Float b) -> Float
Returns the greater of floataand floatb

Float::min(Float a, Float b) -> Float
Returns the lesser of floataand floatb

Float::multiply(Float a, Float b) -> Float
Multiply floataby floatb

Float::negate(Float a) -> Float
Returns the negation ofa-a.

Float::power(Float base, Float exponent) -> Float
Returnsbaseraised to the power ofexponent

Float::round(Float a) -> Int
Round to the nearest integer value

Float::roundDown(Float a) -> 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.0butFloat::truncate -1.9 == -1.0.

Float::roundTowardsZero(Float a) -> Int
Discard the fractional portion of the float, rounding towards zero.

Float::roundUp(Float a) -> Int
Round up to an integer value

Float::sqrt(Float a) -> Float
Get the square root of a float

Float::subtract(Float a, Float b) -> Float
Subtract floatbfrom floata

Float::sum(List a) -> Float
Returns the sum of all the floats in the list

Float::truncate(Float a) -> Int
Discard the fractional portion of the float, rounding towards zero.

Http::badRequest(Str error) -> Response
Returns a Response that can be returned from an HTTP handler to respond with a 400 status and stringerrormessage.

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 url) -> Response
Returns a Response that can be returned from an HTTP handler to respond with a 302 redirect tourl.

Http::response(Any response, Int code) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP statuscodeandresponsebody.

Http::responseWithHeaders(Any response, Dict headers, Int code) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP statuscoderesponsebody, andheaders.

Http::responseWithHtml(Any response, Int code) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP statuscodeandresponsebody, withcontent-typeset to "text/html".

Http::responseWithJson(Any response, Int code) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP statuscodeandresponsebody, withcontent-typeset to "application/json"

Http::responseWithText(Any response, Int code) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP statuscodeandresponsebody, withcontent-typeset to "text/plain".

Http::setCookie_v2(Str name, Str value, Dict params) -> Dict
Returns an HTTP Set-Cookie header suitable for use with , given a cookie , a for it, and a of Set-Cookie ({{Expires}}, {{Max-Age}}, {{Domain}}, {{Path}}, {{Secure}}, {{HttpOnly}}, and/or {{SameSite}}).

Http::success(Any response) -> Response
Returns a Response that can be returned from an HTTP handler to respond with HTTP status 200 andresponsebody.

Http::unauthorized() -> Response
Returns a Response that can be returned from an HTTP handler to respond with 401 Unauthorized.

HttpClient::basicAuth_v1(Str username, Str password) -> Dict
Returns an object with 'Authorization' created using HTTP basic auth

HttpClient::bearerToken_v1(Str token) -> Dict
Returns an object with 'Authorization' set to the passed token

HttpClient::delete_v5(Str uri, Dict query, Dict headers) -> Result
Make blocking HTTP DELETE call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::formContentType() -> Dict
Returns an object with 'Content-Type' for url-encoded HTML forms

HttpClient::get_v5(Str uri, Dict query, Dict headers) -> Result
Make blocking HTTP GET call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::head_v5(Str uri, Dict query, Dict headers) -> Result
Make blocking HTTP HEAD call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::htmlContentType() -> Dict
Returns an object with 'Content-Type' for html

HttpClient::jsonContentType() -> Dict
Returns an object with 'Content-Type' for JSON

HttpClient::options_v5(Str uri, Dict query, Dict headers) -> Result
Make blocking HTTP OPTIONS call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::patch_v5(Str uri, Any body, Dict query, Dict headers) -> Result
Make blocking HTTP PATCH call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::plainTextContentType() -> Dict
Returns an object with 'Content-Type' for plain text

HttpClient::post_v5(Str uri, Any body, Dict query, Dict headers) -> Result
Make blocking HTTP POST call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

HttpClient::put_v5(Str uri, Any body, Dict query, Dict headers) -> Result
Make blocking HTTP PUT call touri. Returns aResultobject where the response object is wrapped inOkif the status code is in the 2xx range, and is wrapped inErrorotherwise. Parsing errors/UTF-8 decoding errors are alsoErrorwrapped response objects, with a message in thebodyand/orrawfields

Int::absoluteValue(Int a) -> Int
Returns the absolute value ofa(turning negative inputs into positive outputs).

Int::add(Int a, Int b) -> Int
Adds two integers together

Int::clamp(Int value, Int limitA, Int limitB) -> Int
Ifvalueis within the range given bylimitAandlimitB returnsvalue. Ifvalueis outside the range, returnslimitAorlimitB whichever is closer tovalue. limitAandlimitBcan be provided in any order.

Int::divide(Int a, Int b) -> Int
Divides two integers

Int::greaterThan(Int a, Int b) -> Bool
Returns true if a is greater than b

Int::greaterThanOrEqualTo(Int a, Int b) -> Bool
Returns true if a is greater than or equal to b

Int::lessThan(Int a, Int b) -> Bool
Returns true if a is less than b

Int::lessThanOrEqualTo(Int a, Int b) -> Bool
Returns true if a is less than or equal to b

Int::max(Int a, Int b) -> Int
Returns the higher of a and b

Int::min(Int a, Int b) -> Int
Returns the lower ofaandb

Int::mod(Int a, Int b) -> Int
Returns the result of wrappingaaround so that0 <= res < b. The modulusbmust be 0 or negative. UseInt::remainderif you want the remainder after division, which has a different behavior for negative numbers.

Int::multiply(Int a, Int b) -> Int
Multiplies two integers

Int::negate(Int a) -> Int
Returns the negation ofa-a.

Int::power(Int base, Int exponent) -> Int
Raisebaseto the power ofexponent

Int::random_v1(Int start, Int end) -> Int
Returns a random integer betweenstartandend(inclusive).

Int::remainder(Int value, Int divisor) -> Result
Returns the integer remainder left over after dividingvaluebydivisor as a Result. For example,Int::remainder 15 6 == Ok 3. The remainder will be negative only ifvalue < 0. The sign ofdivisordoesn't influence the outcome. Returns anErrorifdivisoris 0.

Int::sqrt(Int a) -> Float
Get the square root of an Int

Int::subtract(Int a, Int b) -> Int
Subtracts two integers

Int::sum(List a) -> Int
Returns the sum of all the ints in the list

Int::toFloat(Int a) -> Float
Converts an Int to a Float

JSON::parse_v1(Str json) -> Result
Parses a json string and returns its value. HTTPClient functions, and our request handler, automatically parse JSON into thebodyandjsonbodyfields, 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 pemPrivKey, Dict headers, Any payload) -> 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 pemPrivKey, Any payload) -> 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 pemPubKey, Str token) -> 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 as, List bs) -> List
Returns a new list with all values inasfollowed by all values inbs preserving the order.

List::drop(List list, Int count) -> List
Drops the firstcountvalues fromlist.

List::empty() -> List
Returns an empty list.

List::filterMap(List list, Block f) -> List
Callsfon everyvalinlist returning a new list that drops some values (filter) and transforms others (map). Iff valreturnsNothing dropsvalfrom the list. Iff valreturnsJust newValue replacesvalwithnewValue. Preserves the order of values that were not dropped. This function combinesList::filterandList::map.

List::filter_v2(List list, Block f) -> List
Callsfon everyvalinlist returning a list of only those values for whichf valreturnstrue. Preserves the order of values that were not dropped. ConsiderList::filterMapif you also want to transform the values.

List::findFirst_v2(List list, Block f) -> Option
ReturnsJust firstMatchwherefirstMatchis the first value of the list for whichfreturnstrue. ReturnsNothingif no such value exists.

List::flatten(List list) -> List
Returns a single list containing the values of every list directly inlist(does not recursively flatten nested lists).

List::fold(List list, Any init, Block f) -> Any
Foldslistinto a single value, by repeatedly applyingfto any two pairs.

List::getAt_v1(List list, Int index) -> Option
ReturnsJust valueatindexinlistifindexis less than the length of the list otherwise returnsNothing.

List::head_v2(List list) -> Option
ReturnsJustthe head (first value) of a list. ReturnsNothingif the list is empty.

List::indexedMap(List list, Block f) -> List
Callsfon everyvaland itsindexinlist returning a list of the results of those calls. ConsiderList::mapif you don't need the index.

List::isEmpty(List list) -> Bool
Returns true iflisthas no values.

List::last_v2(List list) -> Option
Returns the last value inlist wrapped in an option (Nothingif the list is empty).

List::length(List list) -> Int
Returns the number of values inlist.

List::map(List list, Block f) -> List
Callsfon everyvalinlist returning a list of the results of those calls. ConsiderList::filterMapif you also want to drop some of the values.

List::map2(List as, List bs, Block f) -> Option
If the lists are the same length, returnsJust listformed by mappingfoverasandbsin parallel, callingf a bon every pair of values fromasandbs. For example, ifasis[1,2,3]andbsis["x","y","z"] returns[(f 1 "x"), (f 2 "y"), (f 3 "z")]. If the lists differ in length, returnsNothing(considerList::map2shortestif you want to drop values from the longer list instead).

List::map2shortest(List as, List bs, Block f) -> List
Mapsfoverasandbsin parallel, callingf a bon every pair of values fromasandbs. If the lists differ in length, values from the longer list are dropped. For example, ifasis[1,2]andbsis["x","y","z"] returns[(f 1 "x"), (f 2 "y")]. UseList::map2if you want to enforce equivalent lengths forasandbs.

List::member(List list, Any val) -> Bool
Returnstrueifvalis in the list.

List::push(List list, Any val) -> List
Add elementvalto front of listlist

List::pushBack(List list, Any val) -> List
Add elementvalto back of listlist

List::randomElement(List list) -> Option
Returns {{Just }}, where is a randomly selected value in . Returns {{Nothing}} if is empty.

List::range(Int lowest, Int highest) -> List
Returns a list of numbers where each element is 1 larger than the previous. You provide thelowestandhighestnumbers in the list. Iflowestis greater thanhighest returns the empty list.

List::repeat(Int times, Any val) -> List
Returns a new list containingvalrepeatedtimestimes.

List::reverse(List list) -> List
Returns a reversed copy oflist.

List::singleton(Any val) -> List
Returns a one-element list containing the givenval.

List::sort(List list) -> List
Returns a copy oflistwith every value sorted in ascending order. Use this if the values have types Dark knows how to sort. ConsiderList::sortByorList::sortByComparatorif you need more control over the sorting process.

List::sortBy(List list, Block f) -> List
Returns a copy oflist sorted in ascending order, as if each value evaluated tof val. For example,List::sortBy ["x","jkl","ab"] \val -> String::length valreturns[ "x", "ab", "jkl" ]. ConsiderList::sortif the list values can be directly compared, orList::sortByComparatorif you want more control over the sorting process.

List::sortByComparator(List list, Block f) -> Result
Returns a copy oflist sorted usingf a bto compare valuesaandb. fmust return-1ifashould appear beforeb1ifashould appear afterb and0if the order ofaandbdoesn't matter. ConsiderList::sortorList::sortByif you don't need this level of control.

List::tail(List list) -> Option
If the list contains at least one value, returnsJusta list of every value other than the first. Otherwise, returnsNothing.

List::take(List list, Int count) -> List
Drops all but the firstcountvalues fromlist.

List::takeWhile(List list, Block f) -> List
Return the longest prefix oflistwhich satisfies the predicateval

List::uniqueBy(List list, Block f) -> List
Returns the passed list, with only unique values, where uniqueness is based on the result off. Only one of each value will be returned, but the order will not be maintained.

List::unzip(List pairs) -> List
Given apairslist where each value is a list of two values (such lists are constructed byList::zipandList::zipShortest), returns a list of two lists, one with every first value, and one with every second value. For example, ifpairsis[[1,"x"], [2,"y"], [3,"z"]] returns[[1,2,3], ["x","y","z"]].

List::zip(List as, List bs) -> Option
If the lists have the same length, returnsJust listformed from parallel pairs inasandbs. For example, ifasis[1,2,3]andbsis["x","y","z"] returns[[1,"x"], [2,"y"], [3,"z"]]. SeeList::unzipif you want to deconstructlistintoasandbsagain. If the lists differ in length, returnsNothing(considerList::zipShortestif you want to drop values from the longer list instead).

List::zipShortest(List as, List bs) -> List
Returns a list of parallel pairs fromasandbs. If the lists differ in length, values from the longer list are dropped. For example, ifasis[1,2]andbsis["x","y","z"] returns[[1,"x"], [2,"y"]]. UseList::zipif you want to enforce equivalent lengths forasandbs. SeeList::unzipif you want to deconstruct the result intoasandbsagain.

Math::acos(Float ratio) -> Option
Returns the arc cosine ofratio as an Option. Ifratiois in the inclusive range[-1.0, 1.0] returns Just resultwhereresultis in radians and is between0.0andMath::pi. Otherwise, returnsNothing. This function is the inverse ofMath::cos.

Math::asin(Float ratio) -> Option
Returns the arc sine ofratio as an Option. Ifratiois in the inclusive range[-1.0, 1.0] returns Just resultwhereresultis in radians and is between-Math::pi/2andMath::pi/2. Otherwise, returnsNothing. This function is the inverse ofMath::sin.

Math::atan(Float ratio) -> Float
Returns the arc tangent ofratio. The result is in radians and is between-Math::pi/2andMath::pi/2. This function is the inverse ofMath::tan. UseMath::atan2to expand the output range, if you know the numerator and denominator ofratio.

Math::atan2(Float y, Float x) -> Float
Returns the arc tangent ofy / x using the signs ofyandxto determine the quadrant of the result. The result is in radians and is between-Math::piandMath::pi. ConsiderMath::atanif you know the value ofy / xbut not the individual valuesxandy.

Math::cos(Float angleInRadians) -> Float
Returns the cosine of the givenangleInRadians. 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 angleInRadians) -> Float
Returns the hyperbolic cosine ofangleInRadians.

Math::degrees(Float angleInDegrees) -> Float
Returns the equivalent ofangleInDegreesin 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 angleInRadians) -> Float
ReturnsangleInRadiansin radians, the unit used by all of Dark's trigonometry functions. There areFloat::multiply 2 Math::piradians in a circle.

Math::sin(Float angleInRadians) -> Float
Returns the sine of the givenangleInRadians. 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 angleInRadians) -> Float
Returns the hyperbolic sine ofangleInRadians.

Math::tan(Float angleInRadians) -> Float
Returns the tangent of the givenangleInRadians. 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 angleInRadians) -> Float
Returns the hyperbolic tangent ofangleInRadians.

Math::tau() -> Float
Returns an approximation for the mathematical constant τ, the number of radians in one turn. Equivalent toFloat::multiply Math::pi 2.

Math::turns(Float angleInTurns) -> Float
Returns the equivalent ofangleInTurnsin radians, the unit used by all of Dark's trigonometry functions. There is 1 turn in a circle.

Option::andThen(Option option, Block f) -> 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 option1, Option option2, Block f) -> 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 option, Block f) -> 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 option, Any default) -> Any
If is {{Just }}, returns . Returns otherwise.

Password::check(Password existingpwr, Str rawpw) -> 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 pw) -> 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 result, Block f) -> 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 option, Str error) -> 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 result1, Result result2, Block f) -> 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 result, Block f) -> 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 result, Block f) -> 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 result) -> Option
Turn a result into an option.

Result::withDefault(Result result, Any default) -> Any
If is {{Ok }}, returns . Returns otherwise.

StaticAssets::baseUrlFor(Str deploy_hash) -> Str
Return the baseUrl for the specified deploy hash

StaticAssets::baseUrlForLatest() -> Str
Return the baseUrl for the latest deploy

StaticAssets::fetchBytes(Str deploy_hash, Str file) -> Result
Return the bytes of the specified file from the deploy_hash

StaticAssets::fetchLatestBytes(Str file) -> Result
Return the bytes of the specified file from the latest deploy

StaticAssets::fetchLatest_v1(Str file) -> Result
Return the specified file from the latest deploy - only works on UTF8-safe files for now

StaticAssets::fetch_v1(Str deploy_hash, Str file) -> Result
Return the specified file from the deploy_hash - only works on UTF8-safe files for now

StaticAssets::serveLatest_v1(Str file) -> Result
Return the specified file from the latest deploy

StaticAssets::serve_v1(Str deploy_hash, Str file) -> Result
Return the specified file from the latest deploy

StaticAssets::urlFor(Str deploy_hash, Str file) -> Str
Return a url for the specified file and deploy hash

StaticAssets::urlForLatest(Str file) -> Str
Return a url for the specified file and latest deploy

String::append_v1(Str s1, Str s2) -> Str
Concatenates the two strings by appendings2tos1and returns the joined string.

String::base64Decode(Str s) -> Str
Base64 decodes a string. Works with both the URL-safe and standard Base64 alphabets defined in RFC 4648 sections 4 and 5.

String::base64Encode(Str s) -> Str
URLBase64 encodes a string without padding. Uses URL-safe encoding with-and_instead of+and/ as defined in RFC 4648 section 5.

String::contains(Str lookingIn, Str searchingFor) -> Bool
Checks iflookingIncontainssearchingFor

String::digest(Str s) -> Str
Take a string and hash it to a cryptographically-secure digest. Don't rely on either the size or the algorithm.

String::dropFirst(Str string, Int characterCount) -> Str
Returns all but the firstcharacterCountcharacters ofstring as a String. IfcharacterCountis longer thanstring returns the empty string. IfcharacterCountis negative, returnsstring.

String::dropLast(Str string, Int characterCount) -> Str
Returns all but the lastcharacterCountcharacters ofstring as a String. IfcharacterCountis longer thanstring returns the empty string. IfcharacterCountis negative, returnsstring.

String::endsWith(Str subject, Str suffix) -> Bool
Checks ifsubjectends withsuffix

String::first(Str string, Int characterCount) -> Str
Returns the firstcharacterCountcharacters ofstring as a String. IfcharacterCountis longer thanstring returnsstring. IfcharacterCountis negative, returns the empty string.

String::foreach_v1(Str s, Block f) -> Str
Iterate over each Character (EGC, not byte) in the string, performing the operation in the block on each one.

String::fromChar_v1(Character c) -> Str
Converts a char to a string

String::fromList_v1(List l) -> Str
Returns the list of characters as a string

String::htmlEscape(Str html) -> Str
Escape an untrusted string in order to include it safely in HTML output.

String::isEmpty(Str s) -> Bool
Returnstrueifsis the empty string "".

String::join(List l, Str separator) -> Str
Combines a list of strings with the provided separator

String::last(Str string, Int characterCount) -> Str
Returns the lastcharacterCountcharacters ofstring as a String. IfcharacterCountis longer thanstring returnsstring. IfcharacterCountis negative, returns the empty string.

String::length_v1(Str s) -> Int
Returns the length of the string

String::newline() -> Str
Returns a string containing a single ' '

String::padEnd(Str string, Str padWith, Int goalLength) -> Str
Ifstringis shorter thangoalLengthcharacters, returns a copy ofstringending with enough copies ofpadWithfor the result havegoalLength. If thestringis longer thangoalLength returns an unchanged copy ofstring.

String::padStart(Str string, Str padWith, Int goalLength) -> Str
Ifstringis shorter thangoalLengthcharacters, returns a copy ofstringstarting with enough copies ofpadWithfor the result havegoalLength. If thestringis longer thangoalLength returns an unchanged copy ofstring.

String::prepend(Str s1, Str s2) -> Str
Concatenates the two strings by prependings2tos1and returns the joined string.

String::random_v2(Int length) -> Result
Generate a string of lengthlengthfrom random characters.

String::replaceAll(Str s, Str searchFor, Str replaceWith) -> Str
Replace all instances onsearchForinswithreplaceWith

String::reverse(Str string) -> Str
Reversesstring

String::slice(Str string, Int from, Int to) -> Str
Returns the substring ofstringbetween thefromandtoindices. Negative indices start counting from the end ofstring. Indices represent characters.

String::slugify_v2(Str string) -> Str
Turns a string into a prettified slug, including only lowercased alphanumeric characters, joined by hyphens

String::split(Str s, Str separator) -> 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 subject, Str prefix) -> Bool
Checks ifsubjectstarts withprefix

String::toBytes(Str str) -> Bytes
Converts the given unicode string to a utf8-encoded byte sequence.

String::toFloat_v1(Str s) -> Result
Returns the float value of the string

String::toInt_v1(Str s) -> Result
Returns the int value of the string, wrapped in aOk orError if the string contains characters other than numeric digits

String::toList_v1(Str s) -> List
Returns the list of Characters (EGC, not byte) in the string

String::toLowercase_v1(Str s) -> Str
Returns the string, lowercased

String::toUUID_v1(Str uuid) -> Result
Parse a UUID of form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX from the inputuuidstring

String::toUppercase_v1(Str s) -> Str
Returns the string, uppercased

String::trim(Str str) -> Str
Returns a copy ofstrwith all leading and trailing whitespace removed. 'whitespace' here means all Unicode characters with theWhite_Spaceproperty, which includes " ", "\t" and "\n".

String::trimEnd(Str str) -> Str
Returns a copy ofstrwith all trailing whitespace removed. 'whitespace' here means all Unicode characters with theWhite_Spaceproperty, which includes " ", "\t" and "\n".

String::trimStart(Str str) -> Str
Returns a copy ofstrwith all leading whitespace removed. 'whitespace' here means all Unicode characters with theWhite_Spaceproperty, which includes " ", "\t" and "\n".

Twilio::sendText_v1(Str accountSID, Str authToken, Str fromNumber, Str toNumber, Str body) -> Dict
Send text withbodyto phone numbertoNumberfrom numberfromNumber authenticated viaaccountSIDandauthToken

Uuid::generate() -> UUID
Generate a new UUID v4 according to RFC 4122

X509::pemCertificatePublicKey(Str pemCert) -> Result
Extract the public key from a PEM encoded certificate and return the key in PEM format.

^(Int base, Int exponent) -> Int
Raisebaseto the power ofexponent

emit_v1(Any event, Str Name) -> Any
Emit aeventto thenameworker

equals(Any a, Any b) -> Bool
Returns true if the two value are equal

notEquals(Any a, Any b) -> Bool
Returns true if the two value are not equal

toString(Any v) -> Str
Returns a string representation ofv suitable for displaying to a user. Redacts passwords.

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