tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

libraries.json (4189B)


      1 {
      2   "base": {"description":"Lists and strings, Booleans, checked natural arithmetic, Maybe/Result protocols and contracts.","alias":"B","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."},
      3   "native-math": {"description":"Compact natural arithmetic, ordering and ASCII classification.","alias":"N","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."},
      4   "conversions": {"description":"Decimal text formatting for natural numbers.","alias":"C","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."},
      5   "prelude": {"description":"Combined public interfaces of base, bytes and conversions.","alias":"P","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."},
      6   "bytes": {"description":"Byte-oriented string helpers and codecs.","alias":"Bytes"},
      7   "io": {"description":"Host-interpreted interaction trees, sequencing and effect helpers.","alias":"IO","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. Select Text / line IO for these wrapped actions. The browser supports these core actions; file, socket, concurrency and other host actions need the native host and its permissions. `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."},
      8   "patterns": {"description":"Predicate-based matching and conditional dispatch.","alias":"Patterns","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."},
      9   "parser": {"description":"Parser combinators with positioned diagnostics, commitment and rollback.","alias":"Parser"},
     10   "lexer": {"description":"Positioned character scans and first-match lexical dispatch.","alias":"Lexer"},
     11   "graph": {"description":"Dependency ordering and cycle reporting for caller-validated graphs.","alias":"Graph"},
     12   "http": {"description":"HTTP request/response parsing, formatting and Result protocols.","alias":"HTTP"},
     13   "socket": {"description":"Native-host socket action constructors.","alias":"Socket"},
     14   "binary": {"description":"Binary encodings and decoding helpers.","alias":"Binary"},
     15   "intensional": {"description":"Contracts and structural inspection of executable trees.","alias":"Intensional"}
     16 }