libraries.json (6325B)
1 { 2 "base": { 3 "description": "Lists and strings, Booleans, checked natural arithmetic, Maybe/Result protocols and contracts.", 4 "alias": "B", 5 "usage": "`add a b`, `sub a b` (saturating), `mul a b`, `div a b`, `mod a b`, `divMod a b`, `pow a b` use naturals. Division requires a nonzero divisor. `lt? a b`, `lte? a b`, `equal? a b` return Booleans (equal? compares trees). `map f xs`, `filter predicate xs`, `foldl f initial xs`, `foldr f initial xs`: both folds pass accumulator first, element second. `append xs ys` concatenates lists, including strings. `intercalate separator strings` joins between fields; `joinSuffix separator strings` adds a separator after every field. `take n xs`, `drop n xs`, `reverse xs`, `length xs`, `sum xs` handle lists. `lazyBool thenThunk elseThunk condition` calls the selected thunk with t. `matchBool onTrue onFalse condition` chooses a value. `matchResult onError onSuccess result` calls either handler with two arguments: diagnostic/value and remainder. Contract failures produce Results; successful checked arithmetic produces an ordinary natural." 6 }, 7 "native-math": { 8 "description": "Compact natural arithmetic, ordering and ASCII classification.", 9 "alias": "N", 10 "usage": "`add a b`, `subtract a b` (saturating), `multiply a b`, `quotient a b`, `remainder a b`, `power a b`; `divMod a b` returns `t quotient remainder`. `equal a b`, `lt a b`, `lte a b`, `gt a b`, `gte a b`, `zero n`, `even n`, `odd n` return Booleans. Inputs must be canonical naturals. Raw `divMod a 0` returns `t 0 a`; use base's checked division at external boundaries. `compare a b` returns t for equal, t t for less, t t t for greater. `successor n`, `predecessor n`, `minimum a b`, `maximum a b` are natural operations. See source for character-classification bounds." 11 }, 12 "conversions": { 13 "description": "Decimal text formatting for natural numbers.", 14 "alias": "C", 15 "usage": "`showNumber n` converts a canonical natural to an ASCII decimal character list, including \"0\". Display it as Text. Its input contract reports malformed values as Results." 16 }, 17 "prelude": { 18 "description": "Combined public interfaces of base, bytes and conversions.", 19 "alias": "P", 20 "usage": "Reexports base, bytes and conversions. Use their calling conventions with this module's qualifier, for example `P.showNumber 42` or `P.map f xs`. Reexported executable trees are included in the bundle." 21 }, 22 "bytes": { 23 "description": "Byte-oriented string helpers and codecs.", 24 "alias": "Bytes" 25 }, 26 "io": { 27 "description": "Host-interpreted interaction trees, sequencing and effect helpers.", 28 "alias": "IO", 29 "usage": "Wrap a final action with `IO.io action`. `IO.pure value` returns a value; `IO.bind action (value : nextAction)` sequences; `IO.putStr text` writes a character list; `IO.getLine` reads one line. `IO.abortIO diagnostic` aborts. This historical release constructs version-1 IO trees. Current hosts execute version 2; use io 0.12.0 and io-text 0.12.0 as in the worked examples for browser execution. Historical trees remain inspectable as data. `do IO.bind` is explicit sequencing syntax; finish with an action such as `IO.pure value`. See the host ABI and IO source for Result-aware helper conventions." 30 }, 31 "patterns": { 32 "description": "Predicate-based matching and conditional dispatch.", 33 "alias": "Patterns", 34 "usage": "`match value rows` uses exact two-element `[predicate action]` rows. `cond rows` uses `guard predicateThunk actionThunk` pairs; thunks receive t. Check source for row shape and fallthrough behavior." 35 }, 36 "parser": { 37 "description": "Parser combinators with positioned diagnostics, commitment and rollback.", 38 "alias": "Parser" 39 }, 40 "lexer": { 41 "description": "Positioned character scans and first-match lexical dispatch.", 42 "alias": "Lexer" 43 }, 44 "graph": { 45 "description": "Dependency ordering and cycle reporting for caller-validated graphs.", 46 "alias": "Graph" 47 }, 48 "http": { 49 "description": "HTTP request/response parsing, formatting and Result protocols.", 50 "alias": "HTTP" 51 }, 52 "socket": { 53 "description": "Native-host socket action constructors.", 54 "alias": "Socket" 55 }, 56 "binary": { 57 "description": "Binary encodings and decoding helpers.", 58 "alias": "Binary" 59 }, 60 "intensional": { 61 "description": "Contracts and structural inspection of executable trees.", 62 "alias": "Intensional" 63 }, 64 "binary64": { 65 "version": "0.12.0", 66 "description": "Pure Tree Calculus binary64 arithmetic with nearest-even rounding and explicit IEEE exception flags.", 67 "alias": "F", 68 "usage": "`fromBits word` returns a checked Result containing a private Value; `fromBitsC word remainder` composes with base contracts. Words are canonical naturals in 0..2^64-1 containing exact IEEE bits. `toBits value` exports exactly. `add`, `subtract`, `multiply`, and `divide` take Values and return `(Value, Flags)`; `value reply` and `flags reply` project the pair. `addBits`, `subtractBits`, `multiplyBits`, and `divideBits` take Words and return `Result (Word, Flags)`. Unwrap Results with base.matchResult or base.bindResult. Each operation rounds separately. `mergeFlags` ORs flag sets; `invalid`, `divideByZero`, `overflow`, `underflow`, and `inexact` inspect them. Arithmetic NaNs and infinities are successful results; malformed Words are contract errors. See the binary64 guide for NaN selection and after-rounding tininess." 69 }, 70 "io@0.12.0": { 71 "description": "Structured host-interpreted interaction trees, sequencing and effect helpers.", 72 "alias": "IO", 73 "usage": "`IO.io action` wraps a version-2 interaction. `IO.pure value` returns a value; `IO.bind action next` sequences; `IO.onOk action next` sequences successful Result payloads. `IO.stdout` obtains the standard writer; `IO.encodeUTF8 text` produces bytes; `IO.writeAll writer bytes` writes them. `do IO.onOk` composes these checked requests. Browser execution uses the structured terminal; native execution uses OS process authority. See the host ABI for facility versions, resources, cancellation and effects. `IO.require` sequences successful Result payloads and raises failed diagnostics; `io-text.writeText writer text` encodes and writes text.", 74 "version": "0.12.0" 75 } 76 }