From a4b64bf1cdf47160b6b615d2c6493039abfd7a94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 28 Jul 2022 17:39:01 -0400 Subject: Extracted unit-testing machinery into its own module. --- stdlib/source/documentation/lux/data.lux | 4 +- stdlib/source/documentation/lux/data/binary.lux | 487 +++++++------- stdlib/source/documentation/lux/data/bit.lux | 35 +- .../source/documentation/lux/data/collection.lux | 4 +- .../documentation/lux/data/collection/array.lux | 175 ++--- .../documentation/lux/data/collection/bits.lux | 79 +-- .../lux/data/collection/dictionary.lux | 151 ++--- .../lux/data/collection/dictionary/ordered.lux | 87 +-- .../documentation/lux/data/collection/list.lux | 19 +- .../lux/data/collection/list/property.lux | 71 ++- .../documentation/lux/data/collection/queue.lux | 82 +-- .../lux/data/collection/queue/priority.lux | 43 +- .../documentation/lux/data/collection/sequence.lux | 101 +-- .../documentation/lux/data/collection/set.lux | 89 +-- .../lux/data/collection/set/multi.lux | 97 +-- .../lux/data/collection/set/ordered.lux | 87 +-- .../documentation/lux/data/collection/stack.lux | 45 +- .../documentation/lux/data/collection/stream.lux | 103 +-- .../documentation/lux/data/collection/tree.lux | 141 ++-- .../lux/data/collection/tree/finger.lux | 61 +- .../lux/data/collection/tree/zipper.lux | 87 +-- stdlib/source/documentation/lux/data/color.lux | 177 +++--- .../source/documentation/lux/data/color/named.lux | 311 ++++----- stdlib/source/documentation/lux/data/format.lux | 4 +- .../source/documentation/lux/data/format/json.lux | 242 +++---- .../source/documentation/lux/data/format/tar.lux | 135 ++-- .../source/documentation/lux/data/format/xml.lux | 132 ++-- stdlib/source/documentation/lux/data/identity.lux | 25 +- stdlib/source/documentation/lux/data/product.lux | 55 +- stdlib/source/documentation/lux/data/sum.lux | 43 +- stdlib/source/documentation/lux/data/text.lux | 708 +++++++++++---------- .../source/documentation/lux/data/text/buffer.lux | 23 +- .../documentation/lux/data/text/encoding.lux | 311 ++++----- .../documentation/lux/data/text/encoding/utf8.lux | 15 +- .../source/documentation/lux/data/text/escape.lux | 45 +- .../source/documentation/lux/data/text/regex.lux | 125 ++-- .../source/documentation/lux/data/text/unicode.lux | 4 +- .../documentation/lux/data/text/unicode/block.lux | 269 ++++---- .../documentation/lux/data/text/unicode/set.lux | 51 +- 39 files changed, 2408 insertions(+), 2315 deletions(-) (limited to 'stdlib/source/documentation') diff --git a/stdlib/source/documentation/lux/data.lux b/stdlib/source/documentation/lux/data.lux index 088366a27..93ecf8753 100644 --- a/stdlib/source/documentation/lux/data.lux +++ b/stdlib/source/documentation/lux/data.lux @@ -16,8 +16,8 @@ ["[1][0]" sum] ["[1][0]" text]]) -(.def .public documentation - (.List $.Module) +(def .public documentation + (List $.Documentation) (list.together (list /binary.documentation /bit.documentation diff --git a/stdlib/source/documentation/lux/data/binary.lux b/stdlib/source/documentation/lux/data/binary.lux index 6a660752e..34b12a2b6 100644 --- a/stdlib/source/documentation/lux/data/binary.lux +++ b/stdlib/source/documentation/lux/data/binary.lux @@ -4,247 +4,256 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" monoid)]]]]] ["[0]" \\format] ["[0]" \\parser] [\\library ["[0]" /]]) -(`` (.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.binary_was_not_fully_read) - ($.definition \\parser.size_8) - ($.definition \\parser.size_16) - ($.definition \\parser.size_32) - ($.definition \\parser.size_64) - ($.definition \\parser.bits_8) - ($.definition \\parser.bits_16) - ($.definition \\parser.bits_32) - ($.definition \\parser.bits_64) - ($.definition \\parser.nat) - ($.definition \\parser.int) - ($.definition \\parser.rev) - ($.definition \\parser.frac) - ($.definition \\parser.invalid_tag) - ($.definition \\parser.or) - ($.definition \\parser.not_a_bit) - ($.definition \\parser.bit) - ($.definition \\parser.text) - ($.definition \\parser.maybe) - ($.definition \\parser.set_elements_are_not_unique) - ($.definition \\parser.symbol) - ($.definition \\parser.type) - ($.definition \\parser.location) - ($.definition \\parser.code) - - ($.definition \\parser.Offset - "An offset for reading within binary data.") - - ($.definition (\\parser.Parser it) - "A parser for raw binary data.") - - ($.definition \\parser.result - "Runs a parser and checks that all the binary data was read by it." - [(result parser input)]) - - ($.definition \\parser.end? - "Checks whether there is no more data to read.") - - ($.definition \\parser.offset - "The current offset (i.e. how much data has been read).") - - ($.definition \\parser.remaining - "How much of the data remains to be read.") - - ($.definition \\parser.Size - "The size of a chunk of data within a binary array.") - - ($.definition \\parser.rec - "Tie the knot for a recursive parser.") - - ($.definition \\parser.any - "Does no parsing, and just returns a dummy value.") - - ($.definition \\parser.segment - "Parses a chunk of data of a given size." - [(segment size)]) - - (,, (with_template [ ] - [($.definition - (format "Parses a block of data prefixed with a size that is " (%.nat ) " bytes long."))] - - [08 \\parser.binary_8] - [16 \\parser.binary_16] - [32 \\parser.binary_32] - [64 \\parser.binary_64] - )) - - (,, (with_template [ ] - [($.definition - (format "Parses a block of (UTF-8 encoded) text prefixed with a size that is " (%.nat ) " bytes long."))] - - [08 \\parser.utf8_8] - [16 \\parser.utf8_16] - [32 \\parser.utf8_32] - [64 \\parser.utf8_64] - )) - - (,, (with_template [ ] - [($.definition - (format "Parses a sequence of values prefixed with a size that is " (%.nat ) " bytes long."))] - - [08 \\parser.sequence_8] - [16 \\parser.sequence_16] - [32 \\parser.sequence_32] - [64 \\parser.sequence_64] - )) - - ($.definition \\parser.list - "Parses an arbitrarily long list of values." - [(list value)]) - - ($.definition \\parser.set - "" - [(set hash value)])] - []))) - -(.def \\format - (.List $.Module) - ($.module \\format._ - "" - [($.definition \\format.monoid) - ($.definition \\format.bits_8) - ($.definition \\format.bits_16) - ($.definition \\format.bits_32) - ($.definition \\format.bits_64) - ($.definition \\format.any) - ($.definition \\format.bit) - ($.definition \\format.nat) - ($.definition \\format.int) - ($.definition \\format.rev) - ($.definition \\format.frac) - ($.definition \\format.binary_8) - ($.definition \\format.binary_16) - ($.definition \\format.binary_32) - ($.definition \\format.binary_64) - ($.definition \\format.utf8_8) - ($.definition \\format.utf8_16) - ($.definition \\format.utf8_32) - ($.definition \\format.utf8_64) - ($.definition \\format.text) - ($.definition \\format.sequence_8) - ($.definition \\format.sequence_16) - ($.definition \\format.sequence_32) - ($.definition \\format.sequence_64) - ($.definition \\format.maybe) - ($.definition \\format.list) - ($.definition \\format.set) - ($.definition \\format.symbol) - ($.definition \\format.type) - ($.definition \\format.location) - ($.definition \\format.code) - - ($.definition \\format.Mutation - "A mutation of binary data, tracking where in the data to transform.") - - ($.definition \\format.Specification - "A description of how to transform binary data.") - - ($.definition \\format.no_op - "A specification for empty binary data.") - - ($.definition \\format.instance - "Given a specification of how to construct binary data, yields a binary blob that matches it.") - - ($.definition (\\format.Format it) - "An operation that knows how to write information into a binary blob.") - - ($.definition \\format.result - "Yields a binary blob with all the information written to it." - [(result format value)]) - - ($.definition \\format.or - "" - [(or left right)]) - - ($.definition \\format.and - "" - [(and pre post)]) - - ($.definition \\format.rec - "A combinator for recursive formats." - [(rec body)]) - - ($.definition \\format.segment - "Writes at most 'size' bytes of an input binary blob." - [(segment size)])] - [])) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.index_out_of_bounds) - ($.definition /.slice_out_of_bounds) - ($.definition /.size) - ($.definition /.equivalence) - ($.definition /.monoid) - - ($.definition /.Binary - "A binary BLOB of data.") - - ($.definition /.empty - "A fresh/empty binary BLOB of the specified size." - [(empty size)]) - - ($.definition /.mix - "" - [(mix f init binary)]) - - ($.definition /.bits_8 - "Read 1 byte (8 bits) at the given index." - [(bits_8 index binary)]) - - ($.definition /.bits_16 - "Read 2 bytes (16 bits) at the given index." - [(bits_16 index binary)]) - - ($.definition /.bits_32 - "Read 4 bytes (32 bits) at the given index." - [(bits_32 index binary)]) - - ($.definition /.bits_64 - "Read 8 bytes (64 bits) at the given index." - [(bits_64 index binary)]) - - ($.definition /.has_8! - "Write 1 byte (8 bits) at the given index." - [(has_8! index value binary)]) - - ($.definition /.has_16! - "Write 2 bytes (16 bits) at the given index." - [(has_16! index value binary)]) - - ($.definition /.has_32! - "Write 4 bytes (32 bits) at the given index." - [(has_32! index value binary)]) - - ($.definition /.has_64! - "Write 8 bytes (64 bits) at the given index." - [(has_64! index value binary)]) - - ($.definition /.copy! - "Mutates the target binary BLOB by copying bytes from the source BLOB to it." - [(copy! bytes source_offset source target_offset target)]) - - ($.definition /.slice - "Yields a subset of the binary BLOB, so long as the specified range is valid." - [(slice offset length binary)]) - - ($.definition /.after - "Yields a binary BLOB with at most the specified number of bytes removed." - [(after bytes binary)])] - [..\\format - ..\\parser])) +(`` (def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") + + ($.definition \\parser.binary_was_not_fully_read) + ($.definition \\parser.size_8) + ($.definition \\parser.size_16) + ($.definition \\parser.size_32) + ($.definition \\parser.size_64) + ($.definition \\parser.bits_8) + ($.definition \\parser.bits_16) + ($.definition \\parser.bits_32) + ($.definition \\parser.bits_64) + ($.definition \\parser.nat) + ($.definition \\parser.int) + ($.definition \\parser.rev) + ($.definition \\parser.frac) + ($.definition \\parser.invalid_tag) + ($.definition \\parser.or) + ($.definition \\parser.not_a_bit) + ($.definition \\parser.bit) + ($.definition \\parser.text) + ($.definition \\parser.maybe) + ($.definition \\parser.set_elements_are_not_unique) + ($.definition \\parser.symbol) + ($.definition \\parser.type) + ($.definition \\parser.location) + ($.definition \\parser.code) + + ($.definition \\parser.Offset + "An offset for reading within binary data.") + + ($.definition (\\parser.Parser it) + "A parser for raw binary data.") + + ($.definition \\parser.result + "Runs a parser and checks that all the binary data was read by it." + [(result parser input)]) + + ($.definition \\parser.end? + "Checks whether there is no more data to read.") + + ($.definition \\parser.offset + "The current offset (i.e. how much data has been read).") + + ($.definition \\parser.remaining + "How much of the data remains to be read.") + + ($.definition \\parser.Size + "The size of a chunk of data within a binary array.") + + ($.definition \\parser.rec + "Tie the knot for a recursive parser.") + + ($.definition \\parser.any + "Does no parsing, and just returns a dummy value.") + + ($.definition \\parser.segment + "Parses a chunk of data of a given size." + [(segment size)]) + + (,, (with_template [ ] + [($.definition + (format "Parses a block of data prefixed with a size that is " (%.nat ) " bytes long."))] + + [08 \\parser.binary_8] + [16 \\parser.binary_16] + [32 \\parser.binary_32] + [64 \\parser.binary_64] + )) + + (,, (with_template [ ] + [($.definition + (format "Parses a block of (UTF-8 encoded) text prefixed with a size that is " (%.nat ) " bytes long."))] + + [08 \\parser.utf8_8] + [16 \\parser.utf8_16] + [32 \\parser.utf8_32] + [64 \\parser.utf8_64] + )) + + (,, (with_template [ ] + [($.definition + (format "Parses a sequence of values prefixed with a size that is " (%.nat ) " bytes long."))] + + [08 \\parser.sequence_8] + [16 \\parser.sequence_16] + [32 \\parser.sequence_32] + [64 \\parser.sequence_64] + )) + + ($.definition \\parser.list + "Parses an arbitrarily long list of values." + [(list value)]) + + ($.definition \\parser.set + "" + [(set hash value)]) + ))) + +(def \\format + (List $.Documentation) + (list ($.module \\format._ + "") + + ($.definition \\format.monoid) + ($.definition \\format.bits_8) + ($.definition \\format.bits_16) + ($.definition \\format.bits_32) + ($.definition \\format.bits_64) + ($.definition \\format.any) + ($.definition \\format.bit) + ($.definition \\format.nat) + ($.definition \\format.int) + ($.definition \\format.rev) + ($.definition \\format.frac) + ($.definition \\format.binary_8) + ($.definition \\format.binary_16) + ($.definition \\format.binary_32) + ($.definition \\format.binary_64) + ($.definition \\format.utf8_8) + ($.definition \\format.utf8_16) + ($.definition \\format.utf8_32) + ($.definition \\format.utf8_64) + ($.definition \\format.text) + ($.definition \\format.sequence_8) + ($.definition \\format.sequence_16) + ($.definition \\format.sequence_32) + ($.definition \\format.sequence_64) + ($.definition \\format.maybe) + ($.definition \\format.list) + ($.definition \\format.set) + ($.definition \\format.symbol) + ($.definition \\format.type) + ($.definition \\format.location) + ($.definition \\format.code) + + ($.definition \\format.Mutation + "A mutation of binary data, tracking where in the data to transform.") + + ($.definition \\format.Specification + "A description of how to transform binary data.") + + ($.definition \\format.no_op + "A specification for empty binary data.") + + ($.definition \\format.instance + "Given a specification of how to construct binary data, yields a binary blob that matches it.") + + ($.definition (\\format.Format it) + "An operation that knows how to write information into a binary blob.") + + ($.definition \\format.result + "Yields a binary blob with all the information written to it." + [(result format value)]) + + ($.definition \\format.or + "" + [(or left right)]) + + ($.definition \\format.and + "" + [(and pre post)]) + + ($.definition \\format.rec + "A combinator for recursive formats." + [(rec body)]) + + ($.definition \\format.segment + "Writes at most 'size' bytes of an input binary blob." + [(segment size)]) + )) + +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.index_out_of_bounds) + ($.definition /.slice_out_of_bounds) + ($.definition /.size) + ($.definition /.equivalence) + ($.definition /.monoid) + + ($.definition /.Binary + "A binary BLOB of data.") + + ($.definition /.empty + "A fresh/empty binary BLOB of the specified size." + [(empty size)]) + + ($.definition /.mix + "" + [(mix f init binary)]) + + ($.definition /.bits_8 + "Read 1 byte (8 bits) at the given index." + [(bits_8 index binary)]) + + ($.definition /.bits_16 + "Read 2 bytes (16 bits) at the given index." + [(bits_16 index binary)]) + + ($.definition /.bits_32 + "Read 4 bytes (32 bits) at the given index." + [(bits_32 index binary)]) + + ($.definition /.bits_64 + "Read 8 bytes (64 bits) at the given index." + [(bits_64 index binary)]) + + ($.definition /.has_8! + "Write 1 byte (8 bits) at the given index." + [(has_8! index value binary)]) + + ($.definition /.has_16! + "Write 2 bytes (16 bits) at the given index." + [(has_16! index value binary)]) + + ($.definition /.has_32! + "Write 4 bytes (32 bits) at the given index." + [(has_32! index value binary)]) + + ($.definition /.has_64! + "Write 8 bytes (64 bits) at the given index." + [(has_64! index value binary)]) + + ($.definition /.copy! + "Mutates the target binary BLOB by copying bytes from the source BLOB to it." + [(copy! bytes source_offset source target_offset target)]) + + ($.definition /.slice + "Yields a subset of the binary BLOB, so long as the specified range is valid." + [(slice offset length binary)]) + + ($.definition /.after + "Yields a binary BLOB with at most the specified number of bytes removed." + [(after bytes binary)]) + + (all list#composite + ..\\format + ..\\parser + ) + )) diff --git a/stdlib/source/documentation/lux/data/bit.lux b/stdlib/source/documentation/lux/data/bit.lux index 99238c240..bb6f5430e 100644 --- a/stdlib/source/documentation/lux/data/bit.lux +++ b/stdlib/source/documentation/lux/data/bit.lux @@ -8,21 +8,22 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.no) - ($.definition /.yes) - ($.definition /.off) - ($.definition /.on) - ($.definition /.equivalence) - ($.definition /.hash) - ($.definition /.disjunction) - ($.definition /.conjunction) - ($.definition /.codec) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.complement - (format "Generates the complement of a predicate." - \n "That is a predicate that returns the oposite of the original predicate."))] - [])) + ($.definition /.no) + ($.definition /.yes) + ($.definition /.off) + ($.definition /.on) + ($.definition /.equivalence) + ($.definition /.hash) + ($.definition /.disjunction) + ($.definition /.conjunction) + ($.definition /.codec) + + ($.definition /.complement + (format "Generates the complement of a predicate." + \n "That is a predicate that returns the oposite of the original predicate.")) + )) diff --git a/stdlib/source/documentation/lux/data/collection.lux b/stdlib/source/documentation/lux/data/collection.lux index 5712aa398..8920b36e7 100644 --- a/stdlib/source/documentation/lux/data/collection.lux +++ b/stdlib/source/documentation/lux/data/collection.lux @@ -19,8 +19,8 @@ ["[1][0]" set] ["[1][0]" tree]]) -(.def .public documentation - (.List $.Module) +(def .public documentation + (List $.Documentation) (list.together (list /array.documentation /bits.documentation diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux index 164e10326..e821b976c 100644 --- a/stdlib/source/documentation/lux/data/collection/array.lux +++ b/stdlib/source/documentation/lux/data/collection/array.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -10,89 +10,90 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.primitive) - ($.definition /.equivalence) - ($.definition /.monoid) - ($.definition /.functor) - ($.definition /.mix) - ($.definition /.every?) - ($.definition /.any?) - - ($.definition (/.Array it) - "Mutable arrays.") - - ($.definition /.empty - "An empty array of the specified size." - [(empty size)]) - - ($.definition /.size - "" - [(size array)]) - - ($.definition /.item - "" - [(item index array)]) - - ($.definition /.has! - "Mutate the array by writing a value to the specified index." - [(has! index value array)]) - - ($.definition /.lacks! - "Mutate the array by deleting the value at the specified index." - [(lacks! index array)]) - - ($.definition /.has? - "" - [(has? index array)]) - - ($.definition /.revised! - "Mutate the array by updating the value at the specified index." - [(revised! index transform array)]) - - ($.definition /.upsert! - (format "Mutate the array by updating the value at the specified index." - \n "If there is no value, update and write the default value given.") - [(upsert! index default transform array)]) - - ($.definition /.copy! - "Writes the contents of one array into the other." - [(copy! length src_start src_array dest_start dest_array)]) - - ($.definition /.occupancy - "Finds out how many cells in an array are occupied." - [(occupancy array)]) - - ($.definition /.vacancy - "Finds out how many cells in an array are vacant." - [(vacancy array)]) - - ($.definition /.only! - "Delete every item of the array that fails to satisfy the predicate." - [(only! p xs)]) - - ($.definition /.example - "Yields the first item in the array that satisfies the predicate." - [(example p xs)]) - - ($.definition /.example' - "Just like 'example', but with access to the index of each value." - [(example' p xs)]) - - ($.definition /.clone - "Yields a shallow clone of the array." - [(clone xs)]) - - ($.definition /.of_list - "" - [(of_list xs)]) - - ($.definition /.list - (format "Yields a list with every non-empty item in the array." - \n "Can use the optional default value when encountering an empty cell in the array.") - [(list {.#None} array) - (list {.#Some default} array)])] - [])) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.primitive) + ($.definition /.equivalence) + ($.definition /.monoid) + ($.definition /.functor) + ($.definition /.mix) + ($.definition /.every?) + ($.definition /.any?) + + ($.definition (/.Array it) + "Mutable arrays.") + + ($.definition /.empty + "An empty array of the specified size." + [(empty size)]) + + ($.definition /.size + "" + [(size array)]) + + ($.definition /.item + "" + [(item index array)]) + + ($.definition /.has! + "Mutate the array by writing a value to the specified index." + [(has! index value array)]) + + ($.definition /.lacks! + "Mutate the array by deleting the value at the specified index." + [(lacks! index array)]) + + ($.definition /.has? + "" + [(has? index array)]) + + ($.definition /.revised! + "Mutate the array by updating the value at the specified index." + [(revised! index transform array)]) + + ($.definition /.upsert! + (format "Mutate the array by updating the value at the specified index." + \n "If there is no value, update and write the default value given.") + [(upsert! index default transform array)]) + + ($.definition /.copy! + "Writes the contents of one array into the other." + [(copy! length src_start src_array dest_start dest_array)]) + + ($.definition /.occupancy + "Finds out how many cells in an array are occupied." + [(occupancy array)]) + + ($.definition /.vacancy + "Finds out how many cells in an array are vacant." + [(vacancy array)]) + + ($.definition /.only! + "Delete every item of the array that fails to satisfy the predicate." + [(only! p xs)]) + + ($.definition /.example + "Yields the first item in the array that satisfies the predicate." + [(example p xs)]) + + ($.definition /.example' + "Just like 'example', but with access to the index of each value." + [(example' p xs)]) + + ($.definition /.clone + "Yields a shallow clone of the array." + [(clone xs)]) + + ($.definition /.of_list + "" + [(of_list xs)]) + + ($.definition /.list + (format "Yields a list with every non-empty item in the array." + \n "Can use the optional default value when encountering an empty cell in the array.") + [(list {.#None} array) + (list {.#Some default} array)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/bits.lux b/stdlib/source/documentation/lux/data/collection/bits.lux index 4a4fa900d..296d9f087 100644 --- a/stdlib/source/documentation/lux/data/collection/bits.lux +++ b/stdlib/source/documentation/lux/data/collection/bits.lux @@ -5,42 +5,43 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.Chunk) - ($.definition /.chunk_size) - ($.definition /.empty) - ($.definition /.empty?) - ($.definition /.equivalence) - ($.definition /.one) - ($.definition /.zero) - ($.definition /.flipped) - ($.definition /.and) - ($.definition /.or) - ($.definition /.xor) - - ($.definition /.Bits - "A bit-map.") - - ($.definition /.size - "Measures the size of a bit-map by counting all the 1s in the bit-map." - [(size bits)]) - - ($.definition /.capacity - "" - [(capacity bits)]) - - ($.definition /.bit - "" - [(bit index bits)]) - - ($.definition /.intersects? - "" - [(intersects? reference sample)]) - - ($.definition /.not - "" - [(not input)])] - [])) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.Chunk) + ($.definition /.chunk_size) + ($.definition /.empty) + ($.definition /.empty?) + ($.definition /.equivalence) + ($.definition /.one) + ($.definition /.zero) + ($.definition /.flipped) + ($.definition /.and) + ($.definition /.or) + ($.definition /.xor) + + ($.definition /.Bits + "A bit-map.") + + ($.definition /.size + "Measures the size of a bit-map by counting all the 1s in the bit-map." + [(size bits)]) + + ($.definition /.capacity + "" + [(capacity bits)]) + + ($.definition /.bit + "" + [(bit index bits)]) + + ($.definition /.intersects? + "" + [(intersects? reference sample)]) + + ($.definition /.not + "" + [(not input)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/dictionary.lux b/stdlib/source/documentation/lux/data/collection/dictionary.lux index dcf2afce1..da8bd13e8 100644 --- a/stdlib/source/documentation/lux/data/collection/dictionary.lux +++ b/stdlib/source/documentation/lux/data/collection/dictionary.lux @@ -4,81 +4,86 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" ordered]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.key_hash) - ($.definition /.key_already_exists) - ($.definition /.size) - ($.definition /.empty?) - ($.definition /.entries) - ($.definition /.keys) - ($.definition /.values) - ($.definition /.equivalence) - ($.definition /.functor) - - ($.definition (/.Dictionary key value) - "A dictionary implemented as a Hash-Array Mapped Trie (HAMT).") - - ($.definition /.empty - "An empty dictionary." - [(empty key_hash)]) - - ($.definition /.has - "" - [(has key val dict)]) - - ($.definition /.lacks - "" - [(lacks key dict)]) - - ($.definition /.value - "" - [(value key dict)]) - - ($.definition /.key? - "" - [(key? dict key)]) - - ($.definition /.has' - "Only puts the KV-pair if the key is not already present." - [(has' key val dict)]) - - ($.definition /.revised - "Transforms the value located at key (if available), using the given function." - [(revised key f dict)]) - - ($.definition /.revised' - (format "Updates the value at the key; if it exists." - \n "Otherwise, puts a value by applying the function to a default.") - [(revised' key default f dict)]) - - ($.definition /.of_list - "" - [(of_list key_hash kvs)]) - - ($.definition /.composite - (format "Merges 2 dictionaries." - \n "If any collisions with keys occur, the values of dict2 will overwrite those of dict1.") - [(composite dict2 dict1)]) - - ($.definition /.composite_with - (format "Merges 2 dictionaries." - \n "If any collisions with keys occur, a new value will be computed by applying 'f' to the values of dict2 and dict1.") - [(composite_with f dict2 dict1)]) - - ($.definition /.re_bound - "If there is a value under 'from_key', remove 'from_key' and store the value under 'to_key'." - [(re_bound from_key to_key dict)]) - - ($.definition /.sub - "A sub-dictionary, with only the specified keys." - [(sub keys dict)])] - [/ordered.documentation])) +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.key_hash) + ($.definition /.key_already_exists) + ($.definition /.size) + ($.definition /.empty?) + ($.definition /.entries) + ($.definition /.keys) + ($.definition /.values) + ($.definition /.equivalence) + ($.definition /.functor) + + ($.definition (/.Dictionary key value) + "A dictionary implemented as a Hash-Array Mapped Trie (HAMT).") + + ($.definition /.empty + "An empty dictionary." + [(empty key_hash)]) + + ($.definition /.has + "" + [(has key val dict)]) + + ($.definition /.lacks + "" + [(lacks key dict)]) + + ($.definition /.value + "" + [(value key dict)]) + + ($.definition /.key? + "" + [(key? dict key)]) + + ($.definition /.has' + "Only puts the KV-pair if the key is not already present." + [(has' key val dict)]) + + ($.definition /.revised + "Transforms the value located at key (if available), using the given function." + [(revised key f dict)]) + + ($.definition /.revised' + (format "Updates the value at the key; if it exists." + \n "Otherwise, puts a value by applying the function to a default.") + [(revised' key default f dict)]) + + ($.definition /.of_list + "" + [(of_list key_hash kvs)]) + + ($.definition /.composite + (format "Merges 2 dictionaries." + \n "If any collisions with keys occur, the values of dict2 will overwrite those of dict1.") + [(composite dict2 dict1)]) + + ($.definition /.composite_with + (format "Merges 2 dictionaries." + \n "If any collisions with keys occur, a new value will be computed by applying 'f' to the values of dict2 and dict1.") + [(composite_with f dict2 dict1)]) + + ($.definition /.re_bound + "If there is a value under 'from_key', remove 'from_key' and store the value under 'to_key'." + [(re_bound from_key to_key dict)]) + + ($.definition /.sub + "A sub-dictionary, with only the specified keys." + [(sub keys dict)]) + + /ordered.documentation + )) diff --git a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux index c264b55f6..d44fe0863 100644 --- a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except has revised) + [lux (.except) ["$" documentation] [data [text @@ -11,56 +11,57 @@ [\\library ["[0]" /]]) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty?) - ($.definition /.entries) - ($.definition /.keys) - ($.definition /.values) - ($.definition /.equivalence) +(`` (def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Dictionary key value) - "A dictionary data-structure with ordered entries.") + ($.definition /.empty?) + ($.definition /.entries) + ($.definition /.keys) + ($.definition /.values) + ($.definition /.equivalence) - ($.definition /.empty - "An empty dictionary, employing the given order." - [(empty order)]) + ($.definition (/.Dictionary key value) + "A dictionary data-structure with ordered entries.") - ($.definition /.value - "" - [(value key dict)]) + ($.definition /.empty + "An empty dictionary, employing the given order." + [(empty order)]) - ($.definition /.key? - "" - [(key? dict key)]) + ($.definition /.value + "" + [(value key dict)]) - (,, (with_template [] - [(`` ($.definition - (format "Yields value under the " (,, (template.text [])) "imum key.")))] + ($.definition /.key? + "" + [(key? dict key)]) - [/.min] - [/.max] - )) + (,, (with_template [] + [(`` ($.definition + (format "Yields value under the " (,, (template.text [])) "imum key.")))] - ($.definition /.size - "" - [(size dict)]) + [/.min] + [/.max] + )) - ($.definition /.has - "" - [(has key value dict)]) + ($.definition /.size + "" + [(size dict)]) - ($.definition /.lacks - "" - [(lacks key dict)]) + ($.definition /.has + "" + [(has key value dict)]) - ($.definition /.revised - "" - [(revised key transform dict)]) + ($.definition /.lacks + "" + [(lacks key dict)]) - ($.definition /.of_list - "" - [(of_list order list)])] - []))) + ($.definition /.revised + "" + [(revised key transform dict)]) + + ($.definition /.of_list + "" + [(of_list order list)]) + ))) diff --git a/stdlib/source/documentation/lux/data/collection/list.lux b/stdlib/source/documentation/lux/data/collection/list.lux index bd4cf4a7d..cf08192c2 100644 --- a/stdlib/source/documentation/lux/data/collection/list.lux +++ b/stdlib/source/documentation/lux/data/collection/list.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except all) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -10,11 +10,12 @@ ["[0]" / ["[1][0]" property]]) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.mix) +(`` (def .public documentation + (List $.Documentation) + (/.partial ($.module /._ + "") + + ($.definition /.mix) ($.definition /.equivalence) ($.definition /.hash) ($.definition /.monoid) @@ -163,5 +164,7 @@ [(do monad [value (do_something 1 2 3) .when (passes_test? value)] - (do_something_else 4 5 6))])] - [/property.documentation]))) + (do_something_else 4 5 6))]) + + /property.documentation + ))) diff --git a/stdlib/source/documentation/lux/data/collection/list/property.lux b/stdlib/source/documentation/lux/data/collection/list/property.lux index 1d8ac9892..c2d694d62 100644 --- a/stdlib/source/documentation/lux/data/collection/list/property.lux +++ b/stdlib/source/documentation/lux/data/collection/list/property.lux @@ -8,38 +8,39 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.size) - ($.definition /.empty?) - ($.definition /.keys) - ($.definition /.values) - ($.definition /.equivalence) - - ($.definition (/.List it) - (format "A property list." - \n "It's a simple dictionary-like structure with Text keys.")) - - ($.definition /.value - "" - [(value key properties)]) - - ($.definition /.contains? - "" - [(contains? key properties)]) - - ($.definition /.has - "" - [(has key val properties)]) - - ($.definition /.revised - "" - [(revised key f properties)]) - - ($.definition /.lacks - "" - [(lacks key properties)])] - [])) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.empty) + ($.definition /.size) + ($.definition /.empty?) + ($.definition /.keys) + ($.definition /.values) + ($.definition /.equivalence) + + ($.definition (/.List it) + (format "A property list." + \n "It's a simple dictionary-like structure with Text keys.")) + + ($.definition /.value + "" + [(value key properties)]) + + ($.definition /.contains? + "" + [(contains? key properties)]) + + ($.definition /.has + "" + [(has key val properties)]) + + ($.definition /.revised + "" + [(revised key f properties)]) + + ($.definition /.lacks + "" + [(lacks key properties)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/queue.lux b/stdlib/source/documentation/lux/data/collection/queue.lux index d61c7dae6..44dd7f209 100644 --- a/stdlib/source/documentation/lux/data/collection/queue.lux +++ b/stdlib/source/documentation/lux/data/collection/queue.lux @@ -1,45 +1,51 @@ (.require [library - [lux (.except list) - ["$" documentation]]] + [lux (.except) + ["$" documentation] + [data + [collection + ["[0]" list]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" priority]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.size) - ($.definition /.empty?) - ($.definition /.equivalence) - ($.definition /.functor) - - ($.definition (/.Queue it) - "A first-in, first-out sequential data-structure.") - - ($.definition /.of_list - "" - [(of_list entries)]) - - ($.definition /.list - "" - [(list queue)]) - - ($.definition /.front - "Yields the first value in the queue, if any.") - - ($.definition /.member? - "" - [(member? equivalence queue member)]) - - ($.definition /.next - "" - [(next queue)]) - - ($.definition /.end - "" - [(end val queue)])] - [/priority.documentation])) +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.empty) + ($.definition /.size) + ($.definition /.empty?) + ($.definition /.equivalence) + ($.definition /.functor) + + ($.definition (/.Queue it) + "A first-in, first-out sequential data-structure.") + + ($.definition /.of_list + "" + [(of_list entries)]) + + ($.definition /.list + "" + [(list queue)]) + + ($.definition /.front + "Yields the first value in the queue, if any.") + + ($.definition /.member? + "" + [(member? equivalence queue member)]) + + ($.definition /.next + "" + [(next queue)]) + + ($.definition /.end + "" + [(end val queue)]) + + /priority.documentation + )) diff --git a/stdlib/source/documentation/lux/data/collection/queue/priority.lux b/stdlib/source/documentation/lux/data/collection/queue/priority.lux index 94eb7dc59..e08056fe3 100644 --- a/stdlib/source/documentation/lux/data/collection/queue/priority.lux +++ b/stdlib/source/documentation/lux/data/collection/queue/priority.lux @@ -1,29 +1,30 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation]]] [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.Priority) - ($.definition /.max) - ($.definition /.min) - ($.definition (/.Queue it)) - ($.definition /.empty) - ($.definition /.front) - ($.definition /.size) - ($.definition /.next) - ($.definition /.empty?) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") - ($.definition /.member? - "" - [(member? equivalence queue member)]) + ($.definition /.Priority) + ($.definition /.max) + ($.definition /.min) + ($.definition (/.Queue it)) + ($.definition /.empty) + ($.definition /.front) + ($.definition /.size) + ($.definition /.next) + ($.definition /.empty?) - ($.definition /.end - "" - [(end priority value queue)])] - [])) + ($.definition /.member? + "" + [(member? equivalence queue member)]) + + ($.definition /.end + "" + [(end priority value queue)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/sequence.lux b/stdlib/source/documentation/lux/data/collection/sequence.lux index 2db4aba19..5dbbe420f 100644 --- a/stdlib/source/documentation/lux/data/collection/sequence.lux +++ b/stdlib/source/documentation/lux/data/collection/sequence.lux @@ -1,66 +1,67 @@ (.require [library - [lux (.except list has revised) + [lux (.except) ["$" documentation]]] [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.size) - ($.definition /.index_out_of_bounds) - ($.definition /.of_list) - ($.definition /.empty?) - ($.definition /.equivalence) - ($.definition /.mix) - ($.definition /.monoid) - ($.definition /.functor) - ($.definition /.apply) - ($.definition /.monad) - ($.definition /.reversed) - ($.definition /.every?) - ($.definition /.any?) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Sequence it) - "A sequential data-structure with fast random access.") + ($.definition /.empty) + ($.definition /.size) + ($.definition /.index_out_of_bounds) + ($.definition /.of_list) + ($.definition /.empty?) + ($.definition /.equivalence) + ($.definition /.mix) + ($.definition /.monoid) + ($.definition /.functor) + ($.definition /.apply) + ($.definition /.monad) + ($.definition /.reversed) + ($.definition /.every?) + ($.definition /.any?) - ($.definition /.suffix - "" - [(suffix val sequence)]) + ($.definition (/.Sequence it) + "A sequential data-structure with fast random access.") - ($.definition /.within_bounds? - "Determines whether the index is within the bounds of the sequence." - [(within_bounds? sequence idx)]) + ($.definition /.suffix + "" + [(suffix val sequence)]) - ($.definition /.item - "" - [(item idx sequence)]) + ($.definition /.within_bounds? + "Determines whether the index is within the bounds of the sequence." + [(within_bounds? sequence idx)]) - ($.definition /.has - "" - [(has idx val sequence)]) + ($.definition /.item + "" + [(item idx sequence)]) - ($.definition /.revised - "" - [(revised idx f sequence)]) + ($.definition /.has + "" + [(has idx val sequence)]) - ($.definition /.prefix - "" - [(prefix sequence)]) + ($.definition /.revised + "" + [(revised idx f sequence)]) - ($.definition /.list - "" - [(list sequence)]) + ($.definition /.prefix + "" + [(prefix sequence)]) - ($.definition /.member? - "" - [(member? equivalence sequence val)]) + ($.definition /.list + "" + [(list sequence)]) - ($.definition /.sequence - "Sequence literals." - [(is (Sequence Nat) - (sequence 12 34 56 78 90))])] - [])) + ($.definition /.member? + "" + [(member? equivalence sequence val)]) + + ($.definition /.sequence + "Sequence literals." + [(is (Sequence Nat) + (sequence 12 34 56 78 90))]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/set.lux b/stdlib/source/documentation/lux/data/collection/set.lux index c9c02c488..94ad8e8d9 100644 --- a/stdlib/source/documentation/lux/data/collection/set.lux +++ b/stdlib/source/documentation/lux/data/collection/set.lux @@ -4,50 +4,57 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" monoid)]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" multi] ["[1][0]" ordered]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition (/.Set it)) - ($.definition /.member_hash) - ($.definition /.empty) - ($.definition /.size) - ($.definition /.lacks) - ($.definition /.member?) - ($.definition /.list) - ($.definition /.union) - ($.definition /.equivalence) - ($.definition /.hash) - ($.definition /.monoid) - ($.definition /.empty?) - ($.definition /.of_list) - ($.definition /.predicate) - - ($.definition /.has - "" - [(has elem set)]) - - ($.definition /.difference - "" - [(difference sub base)]) - - ($.definition /.intersection - "" - [(intersection filter base)]) - - ($.definition /.sub? - "" - [(sub? super sub)]) - - ($.definition /.super? - "" - [(super? sub super)])] - [/multi.documentation - /ordered.documentation])) +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition (/.Set it)) + ($.definition /.member_hash) + ($.definition /.empty) + ($.definition /.size) + ($.definition /.lacks) + ($.definition /.member?) + ($.definition /.list) + ($.definition /.union) + ($.definition /.equivalence) + ($.definition /.hash) + ($.definition /.monoid) + ($.definition /.empty?) + ($.definition /.of_list) + ($.definition /.predicate) + + ($.definition /.has + "" + [(has elem set)]) + + ($.definition /.difference + "" + [(difference sub base)]) + + ($.definition /.intersection + "" + [(intersection filter base)]) + + ($.definition /.sub? + "" + [(sub? super sub)]) + + ($.definition /.super? + "" + [(super? sub super)]) + + (all list#composite + /multi.documentation + /ordered.documentation + ) + )) diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux index 77944599e..8c84efe56 100644 --- a/stdlib/source/documentation/lux/data/collection/set/multi.lux +++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list has) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -8,50 +8,51 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.size) - ($.definition /.list) - ($.definition /.equivalence) - ($.definition /.hash) - ($.definition /.empty?) - ($.definition /.of_list) - ($.definition /.of_set) - ($.definition /.union) - ($.definition /.sum) - ($.definition /.intersection) - ($.definition /.difference) - - ($.definition (/.Set it) - "A set that keeps track of repetition in its entries.") - - ($.definition /.has - "" - [(has multiplicity elem set)]) - - ($.definition /.lacks - "" - [(lacks multiplicity elem set)]) - - ($.definition /.multiplicity - "" - [(multiplicity set elem)]) - - ($.definition /.sub? - "Is 'subject' a sub-set of 'reference'?" - [(sub? reference subject)]) - - ($.definition /.support - "A set of the unique (non repeated) members." - [(support set)]) - - ($.definition /.member? - "" - [(member? set elem)]) - - ($.definition /.super? - "Is 'subject' a super-set of 'reference'?")] - [])) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.empty) + ($.definition /.size) + ($.definition /.list) + ($.definition /.equivalence) + ($.definition /.hash) + ($.definition /.empty?) + ($.definition /.of_list) + ($.definition /.of_set) + ($.definition /.union) + ($.definition /.sum) + ($.definition /.intersection) + ($.definition /.difference) + + ($.definition (/.Set it) + "A set that keeps track of repetition in its entries.") + + ($.definition /.has + "" + [(has multiplicity elem set)]) + + ($.definition /.lacks + "" + [(lacks multiplicity elem set)]) + + ($.definition /.multiplicity + "" + [(multiplicity set elem)]) + + ($.definition /.sub? + "Is 'subject' a sub-set of 'reference'?" + [(sub? reference subject)]) + + ($.definition /.support + "A set of the unique (non repeated) members." + [(support set)]) + + ($.definition /.member? + "" + [(member? set elem)]) + + ($.definition /.super? + "Is 'subject' a super-set of 'reference'?") + )) diff --git a/stdlib/source/documentation/lux/data/collection/set/ordered.lux b/stdlib/source/documentation/lux/data/collection/set/ordered.lux index a34ad7bb2..82f29e9d9 100644 --- a/stdlib/source/documentation/lux/data/collection/set/ordered.lux +++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list has) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -8,45 +8,46 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.min) - ($.definition /.max) - ($.definition /.size) - ($.definition /.empty?) - ($.definition /.list) - ($.definition /.of_list) - ($.definition /.union) - ($.definition /.intersection) - ($.definition /.equivalence) - - ($.definition (/.Set it) - "A set with ordered entries.") - - ($.definition /.member? - "" - [(member? set elem)]) - - ($.definition /.has - "" - [(has elem set)]) - - ($.definition /.lacks - "" - [(lacks elem set)]) - - ($.definition /.difference - "" - [(difference param subject)]) - - ($.definition /.sub? - "Is 'sub' a sub-set of 'super'?" - [(sub? super sub)]) - - ($.definition /.super? - "Is 'super' a super-set of 'sub'?" - [(super? sub super)])] - [])) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.empty) + ($.definition /.min) + ($.definition /.max) + ($.definition /.size) + ($.definition /.empty?) + ($.definition /.list) + ($.definition /.of_list) + ($.definition /.union) + ($.definition /.intersection) + ($.definition /.equivalence) + + ($.definition (/.Set it) + "A set with ordered entries.") + + ($.definition /.member? + "" + [(member? set elem)]) + + ($.definition /.has + "" + [(has elem set)]) + + ($.definition /.lacks + "" + [(lacks elem set)]) + + ($.definition /.difference + "" + [(difference param subject)]) + + ($.definition /.sub? + "Is 'sub' a sub-set of 'super'?" + [(sub? super sub)]) + + ($.definition /.super? + "Is 'super' a super-set of 'sub'?" + [(super? sub super)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux index 5a334c846..e882391c7 100644 --- a/stdlib/source/documentation/lux/data/collection/stack.lux +++ b/stdlib/source/documentation/lux/data/collection/stack.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -8,28 +8,29 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.size) - ($.definition /.empty?) - ($.definition /.equivalence) - ($.definition /.functor) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Stack it) - "A first-in, last-out sequential data-structure.") + ($.definition /.empty) + ($.definition /.size) + ($.definition /.empty?) + ($.definition /.equivalence) + ($.definition /.functor) - ($.definition /.value - "Yields the top value in the stack, if any." - [(value stack)]) + ($.definition (/.Stack it) + "A first-in, last-out sequential data-structure.") - ($.definition /.next - "" - [(next stack)]) + ($.definition /.value + "Yields the top value in the stack, if any." + [(value stack)]) - ($.definition /.top - "" - [(top value stack)])] - [])) + ($.definition /.next + "" + [(next stack)]) + + ($.definition /.top + "" + [(top value stack)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/stream.lux b/stdlib/source/documentation/lux/data/collection/stream.lux index 095642068..d32960d0d 100644 --- a/stdlib/source/documentation/lux/data/collection/stream.lux +++ b/stdlib/source/documentation/lux/data/collection/stream.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list pattern) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -8,53 +8,54 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.head) - ($.definition /.tail) - ($.definition /.functor) - ($.definition /.comonad) - ($.definition /.while) - ($.definition /.until) - ($.definition /.first) - ($.definition /.after) - ($.definition /.split_when) - ($.definition /.split_at) - - ($.definition (/.Stream it) - "An infinite sequence of values.") - - ($.definition /.iterations - "A stateful way of infinitely calculating the values of a stream." - [(iterations step init)]) - - ($.definition /.repeated - "Repeat a value forever." - [(repeated x)]) - - ($.definition /.cycle - "Go over the elements of a list forever." - [(cycle [start next])]) - - ($.definition /.item - "" - [(item idx stream)]) - - ($.definition /.only - "A new stream only with items that satisfy the predicate." - [(only predicate stream)]) - - ($.definition /.partition - (format "Split a stream in two based on a predicate." - \n "The left side contains all entries for which the predicate is #1." - \n "The right side contains all entries for which the predicate is #0.") - [(partition left? xs)]) - - ($.definition /.pattern - (format "Allows destructuring of streams in pattern-matching expressions." - \n "Caveat emptor: Only use it for destructuring, and not for testing values within the streams.") - [(let [(pattern x y z _tail) (some_stream_func +1 +2 +3)] - (func x y z))])] - [])) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.head) + ($.definition /.tail) + ($.definition /.functor) + ($.definition /.comonad) + ($.definition /.while) + ($.definition /.until) + ($.definition /.first) + ($.definition /.after) + ($.definition /.split_when) + ($.definition /.split_at) + + ($.definition (/.Stream it) + "An infinite sequence of values.") + + ($.definition /.iterations + "A stateful way of infinitely calculating the values of a stream." + [(iterations step init)]) + + ($.definition /.repeated + "Repeat a value forever." + [(repeated x)]) + + ($.definition /.cycle + "Go over the elements of a list forever." + [(cycle [start next])]) + + ($.definition /.item + "" + [(item idx stream)]) + + ($.definition /.only + "A new stream only with items that satisfy the predicate." + [(only predicate stream)]) + + ($.definition /.partition + (format "Split a stream in two based on a predicate." + \n "The left side contains all entries for which the predicate is #1." + \n "The right side contains all entries for which the predicate is #0.") + [(partition left? xs)]) + + ($.definition /.pattern + (format "Allows destructuring of streams in pattern-matching expressions." + \n "Caveat emptor: Only use it for destructuring, and not for testing values within the streams.") + [(let [(pattern x y z _tail) (some_stream_func +1 +2 +3)] + (func x y z))]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux index 139d88ca3..ef03b419c 100644 --- a/stdlib/source/documentation/lux/data/collection/tree.lux +++ b/stdlib/source/documentation/lux/data/collection/tree.lux @@ -1,10 +1,12 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list (.use "[1]#[0]" monoid)]]]]] ["[0]" \\parser] [\\library ["[0]" /]] @@ -12,78 +14,83 @@ ["[1][0]" finger] ["[1][0]" zipper]]) -(`` (.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.cannot_move_further) +(`` (def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") - ($.definition (\\parser.Parser it) - "A parser of arbitrary trees.") + ($.definition \\parser.cannot_move_further) - ($.definition \\parser.result' - "Applies the parser against a tree zipper." - [(result' parser zipper)]) + ($.definition (\\parser.Parser it) + "A parser of arbitrary trees.") - ($.definition \\parser.result - "Applies the parser against a tree." - [(result parser tree)]) + ($.definition \\parser.result' + "Applies the parser against a tree zipper." + [(result' parser zipper)]) - ($.definition \\parser.value - "Yields the value inside the current tree node.") + ($.definition \\parser.result + "Applies the parser against a tree." + [(result parser tree)]) - (,, (with_template [ ] - [($.definition - )] + ($.definition \\parser.value + "Yields the value inside the current tree node.") - [\\parser.down "Move down."] - [\\parser.up "Move up."] + (,, (with_template [ ] + [($.definition + )] - [\\parser.right "Move to the right."] - [\\parser.rightmost "Move to the rightmost node."] + [\\parser.down "Move down."] + [\\parser.up "Move up."] - [\\parser.left "Move to the left."] - [\\parser.leftmost "Move to the leftmost node."] - - [\\parser.next "Move to the next node."] - [\\parser.end "Move to the last node."] - - [\\parser.previous "Move to the previous node."] - [\\parser.start "Move to the root node."] - ))] - []))) + [\\parser.right "Move to the right."] + [\\parser.rightmost "Move to the rightmost node."] + + [\\parser.left "Move to the left."] + [\\parser.leftmost "Move to the leftmost node."] + + [\\parser.next "Move to the next node."] + [\\parser.end "Move to the last node."] + + [\\parser.previous "Move to the previous node."] + [\\parser.start "Move to the root node."] + )) + ))) (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.equivalence) - ($.definition /.functor) - ($.definition /.mix) - - ($.definition (/.Tree it) - "A generic tree data-structure.") - - ($.definition /.flat - "All the leaf values of the tree, in order." - [(flat tree)]) - - ($.definition /.leaf - "" - [(leaf value)]) - - ($.definition /.branch - "" - [(branch value children)]) - - ($.definition /.tree - "Tree literals." - [(is (Tree Nat) - (tree 12 - {34 {} - 56 {} - 78 {90 {}}}))])] - [..\\parser - - /finger.documentation - /zipper.documentation])) + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.equivalence) + ($.definition /.functor) + ($.definition /.mix) + + ($.definition (/.Tree it) + "A generic tree data-structure.") + + ($.definition /.flat + "All the leaf values of the tree, in order." + [(flat tree)]) + + ($.definition /.leaf + "" + [(leaf value)]) + + ($.definition /.branch + "" + [(branch value children)]) + + ($.definition /.tree + "Tree literals." + [(is (Tree Nat) + (tree 12 + {34 {} + 56 {} + 78 {90 {}}}))]) + + (all list#composite + ..\\parser + /finger.documentation + /zipper.documentation + ) + )) diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux index cc6573633..dacba465b 100644 --- a/stdlib/source/documentation/lux/data/collection/tree/finger.lux +++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -8,40 +8,41 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.tag) - ($.definition /.root) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Tree @ tag value) - "A finger tree.") + ($.definition /.tag) + ($.definition /.root) - ($.definition (/.Builder @ tag) - "A builder for finter tree structures.") + ($.definition (/.Tree @ tag value) + "A finger tree.") - ($.definition /.builder - "A new builder using the given monoid." - [(builder monoid)]) + ($.definition (/.Builder @ tag) + "A builder for finter tree structures.") - ($.definition /.value - "" - [(value tree)]) + ($.definition /.builder + "A new builder using the given monoid." + [(builder monoid)]) - ($.definition /.tags - "" - [(tags tree)]) + ($.definition /.value + "" + [(value tree)]) - ($.definition /.values - "" - [(values tree)]) + ($.definition /.tags + "" + [(tags tree)]) - ($.definition /.one - "Finds one value that meets the predicate." - [(one predicate tree)]) + ($.definition /.values + "" + [(values tree)]) - ($.definition /.exists? - "Verifies that a value exists which meets the predicate." - [(exists? predicate tree)])] - [])) + ($.definition /.one + "Finds one value that meets the predicate." + [(one predicate tree)]) + + ($.definition /.exists? + "Verifies that a value exists which meets the predicate." + [(exists? predicate tree)]) + )) diff --git a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux index 7d33d944a..052f816fb 100644 --- a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except list) + [lux (.except) ["$" documentation] [data ["[0]" text (.only \n) @@ -8,50 +8,51 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.equivalence) - ($.definition /.zipper) - ($.definition /.tree) - ($.definition /.value) - ($.definition /.leaf?) - ($.definition /.branch?) - ($.definition /.start?) - ($.definition /.down) - ($.definition /.up) - ($.definition /.right) - ($.definition /.rightmost) - ($.definition /.left) - ($.definition /.leftmost) - ($.definition /.next) - ($.definition /.previous) - ($.definition /.end) - ($.definition /.start) - ($.definition /.end?) - ($.definition /.remove) - ($.definition /.insert_left) - ($.definition /.insert_right) - ($.definition /.functor) - ($.definition /.comonad) +(def .public documentation + (.List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Zipper it) - "Tree zippers, for easy navigation and editing of trees.") + ($.definition /.equivalence) + ($.definition /.zipper) + ($.definition /.tree) + ($.definition /.value) + ($.definition /.leaf?) + ($.definition /.branch?) + ($.definition /.start?) + ($.definition /.down) + ($.definition /.up) + ($.definition /.right) + ($.definition /.rightmost) + ($.definition /.left) + ($.definition /.leftmost) + ($.definition /.next) + ($.definition /.previous) + ($.definition /.end) + ($.definition /.start) + ($.definition /.end?) + ($.definition /.remove) + ($.definition /.insert_left) + ($.definition /.insert_right) + ($.definition /.functor) + ($.definition /.comonad) - ($.definition /.set - "" - [(set value zipper)]) + ($.definition (/.Zipper it) + "Tree zippers, for easy navigation and editing of trees.") - ($.definition /.update - "" - [(update transform zipper)]) + ($.definition /.set + "" + [(set value zipper)]) - ($.definition /.interpose - "" - [(interpose value zipper)]) + ($.definition /.update + "" + [(update transform zipper)]) - ($.definition /.adopt - "" - [(adopt value zipper)])] - [])) + ($.definition /.interpose + "" + [(interpose value zipper)]) + + ($.definition /.adopt + "" + [(adopt value zipper)]) + )) diff --git a/stdlib/source/documentation/lux/data/color.lux b/stdlib/source/documentation/lux/data/color.lux index 5c2f37e09..b6ed59dab 100644 --- a/stdlib/source/documentation/lux/data/color.lux +++ b/stdlib/source/documentation/lux/data/color.lux @@ -4,7 +4,9 @@ ["$" documentation] [data ["[0]" text (.only \n) - ["%" \\format (.only format)]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]] [meta ["[0]" code (.only) ["<[1]>" \\parser]] @@ -20,88 +22,91 @@ (syntax (_ [[_ name] .symbol]) (in (list (code.text (format "A " (text.replaced "_" "-" name) " palette.")))))) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.of_rgb) - ($.definition /.rgb) - ($.definition /.equivalence) - ($.definition /.hash) - ($.definition /.black) - ($.definition /.white) - ($.definition /.addition) - ($.definition /.subtraction) - ($.definition /.hsl) - ($.definition /.of_hsl) - ($.definition /.hsb) - ($.definition /.of_hsb) - ($.definition /.cmyk) - ($.definition /.of_cmyk) - ($.definition /.gray_scale) - ($.definition /.Spread) - ($.definition /.Palette) - ($.definition /.darker) - ($.definition /.brighter) - ($.definition /.saturated) - ($.definition /.un_saturated) - - ($.definition /.RGB - "Red-Green-Blue color format.") - - ($.definition /.HSL - "Hue-Saturation-Lightness color format.") - - ($.definition /.CMYK - "Cyan-Magenta-Yellow-Key color format.") - - ($.definition /.HSB - "Hue-Saturation-Brightness color format.") - - ($.definition /.Color - "A color value, independent of color format.") - - ($.definition /.complement - "The opposite color." - [(complement color)]) - - ($.definition /.interpolated - "" - [(interpolated ratio end start)]) - - ($.definition /.analogous - (palette_documentation /.analogous) - [(analogous spread variations color)]) - - ($.definition /.monochromatic - (palette_documentation /.monochromatic) - [(monochromatic spread variations color)]) - - ($.definition /.Alpha - "The degree of transparency of a pigment.") - - ($.definition /.transparent - "The maximum degree of transparency.") - - ($.definition /.translucent - "The average degree of transparency.") - - ($.definition /.opaque - "The minimum degree of transparency.") - - ($.definition /.Pigment - "A color with some degree of transparency.") - - (,, (with_template [] - [(`` ($.definition - (format "A " - (text.replaced "_" "-" (,, (template.text []))) - " color scheme.")))] - - [/.triad] - [/.clash] - [/.split_complement] - [/.square] - [/.tetradic] - ))] - [/named.documentation]))) +(`` (def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.of_rgb) + ($.definition /.rgb) + ($.definition /.equivalence) + ($.definition /.hash) + ($.definition /.black) + ($.definition /.white) + ($.definition /.addition) + ($.definition /.subtraction) + ($.definition /.hsl) + ($.definition /.of_hsl) + ($.definition /.hsb) + ($.definition /.of_hsb) + ($.definition /.cmyk) + ($.definition /.of_cmyk) + ($.definition /.gray_scale) + ($.definition /.Spread) + ($.definition /.Palette) + ($.definition /.darker) + ($.definition /.brighter) + ($.definition /.saturated) + ($.definition /.un_saturated) + + ($.definition /.RGB + "Red-Green-Blue color format.") + + ($.definition /.HSL + "Hue-Saturation-Lightness color format.") + + ($.definition /.CMYK + "Cyan-Magenta-Yellow-Key color format.") + + ($.definition /.HSB + "Hue-Saturation-Brightness color format.") + + ($.definition /.Color + "A color value, independent of color format.") + + ($.definition /.complement + "The opposite color." + [(complement color)]) + + ($.definition /.interpolated + "" + [(interpolated ratio end start)]) + + ($.definition /.analogous + (palette_documentation /.analogous) + [(analogous spread variations color)]) + + ($.definition /.monochromatic + (palette_documentation /.monochromatic) + [(monochromatic spread variations color)]) + + ($.definition /.Alpha + "The degree of transparency of a pigment.") + + ($.definition /.transparent + "The maximum degree of transparency.") + + ($.definition /.translucent + "The average degree of transparency.") + + ($.definition /.opaque + "The minimum degree of transparency.") + + ($.definition /.Pigment + "A color with some degree of transparency.") + + (,, (with_template [] + [(`` ($.definition + (format "A " + (text.replaced "_" "-" (,, (template.text []))) + " color scheme.")))] + + [/.triad] + [/.clash] + [/.split_complement] + [/.square] + [/.tetradic] + )) + + /named.documentation + ))) diff --git a/stdlib/source/documentation/lux/data/color/named.lux b/stdlib/source/documentation/lux/data/color/named.lux index 239281ab1..4ed4c3324 100644 --- a/stdlib/source/documentation/lux/data/color/named.lux +++ b/stdlib/source/documentation/lux/data/color/named.lux @@ -12,159 +12,160 @@ ["[0]" / (.only) ["/[1]" //]]]) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [(,, (with_template [] - [($.definition - (let [[red green blue] (//.rgb ) - [_ name] (symbol )] - (format "R:" (hex#encoded red) - " G:" (hex#encoded green) - " B:" (hex#encoded blue) - " | " (text.replaced "_" " " name))))] +(`` (def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - [/.alice_blue] - [/.antique_white] - [/.aqua] - [/.aquamarine] - [/.azure] - [/.beige] - [/.bisque] - [/.black] - [/.blanched_almond] - [/.blue] - [/.blue_violet] - [/.brown] - [/.burly_wood] - [/.cadet_blue] - [/.chartreuse] - [/.chocolate] - [/.coral] - [/.cornflower_blue] - [/.cornsilk] - [/.crimson] - [/.cyan] - [/.dark_blue] - [/.dark_cyan] - [/.dark_goldenrod] - [/.dark_gray] - [/.dark_green] - [/.dark_khaki] - [/.dark_magenta] - [/.dark_olive_green] - [/.dark_orange] - [/.dark_orchid] - [/.dark_red] - [/.dark_salmon] - [/.dark_sea_green] - [/.dark_slate_blue] - [/.dark_slate_gray] - [/.dark_turquoise] - [/.dark_violet] - [/.deep_pink] - [/.deep_sky_blue] - [/.dim_gray] - [/.dodger_blue] - [/.fire_brick] - [/.floral_white] - [/.forest_green] - [/.fuchsia] - [/.gainsboro] - [/.ghost_white] - [/.gold] - [/.goldenrod] - [/.gray] - [/.green] - [/.green_yellow] - [/.honey_dew] - [/.hot_pink] - [/.indian_red] - [/.indigo] - [/.ivory] - [/.khaki] - [/.lavender] - [/.lavender_blush] - [/.lawn_green] - [/.lemon_chiffon] - [/.light_blue] - [/.light_coral] - [/.light_cyan] - [/.light_goldenrod_yellow] - [/.light_gray] - [/.light_green] - [/.light_pink] - [/.light_salmon] - [/.light_sea_green] - [/.light_sky_blue] - [/.light_slate_gray] - [/.light_steel_blue] - [/.light_yellow] - [/.lime] - [/.lime_green] - [/.linen] - [/.magenta] - [/.maroon] - [/.medium_aquamarine] - [/.medium_blue] - [/.medium_orchid] - [/.medium_purple] - [/.medium_sea_green] - [/.medium_slate_blue] - [/.medium_spring_green] - [/.medium_turquoise] - [/.medium_violet_red] - [/.midnight_blue] - [/.mint_cream] - [/.misty_rose] - [/.moccasin] - [/.navajo_white] - [/.navy] - [/.old_lace] - [/.olive] - [/.olive_drab] - [/.orange] - [/.orange_red] - [/.orchid] - [/.pale_goldenrod] - [/.pale_green] - [/.pale_turquoise] - [/.pale_violet_red] - [/.papaya_whip] - [/.peach_puff] - [/.peru] - [/.pink] - [/.plum] - [/.powder_blue] - [/.purple] - [/.rebecca_purple] - [/.red] - [/.rosy_brown] - [/.royal_blue] - [/.saddle_brown] - [/.salmon] - [/.sandy_brown] - [/.sea_green] - [/.sea_shell] - [/.sienna] - [/.silver] - [/.sky_blue] - [/.slate_blue] - [/.slate_gray] - [/.snow] - [/.spring_green] - [/.steel_blue] - [/.tan] - [/.teal] - [/.thistle] - [/.tomato] - [/.turquoise] - [/.violet] - [/.wheat] - [/.white] - [/.white_smoke] - [/.yellow] - [/.yellow_green] - ))] - []))) + (,, (with_template [] + [($.definition + (let [[red green blue] (//.rgb ) + [_ name] (symbol )] + (format "R:" (hex#encoded red) + " G:" (hex#encoded green) + " B:" (hex#encoded blue) + " | " (text.replaced "_" " " name))))] + + [/.alice_blue] + [/.antique_white] + [/.aqua] + [/.aquamarine] + [/.azure] + [/.beige] + [/.bisque] + [/.black] + [/.blanched_almond] + [/.blue] + [/.blue_violet] + [/.brown] + [/.burly_wood] + [/.cadet_blue] + [/.chartreuse] + [/.chocolate] + [/.coral] + [/.cornflower_blue] + [/.cornsilk] + [/.crimson] + [/.cyan] + [/.dark_blue] + [/.dark_cyan] + [/.dark_goldenrod] + [/.dark_gray] + [/.dark_green] + [/.dark_khaki] + [/.dark_magenta] + [/.dark_olive_green] + [/.dark_orange] + [/.dark_orchid] + [/.dark_red] + [/.dark_salmon] + [/.dark_sea_green] + [/.dark_slate_blue] + [/.dark_slate_gray] + [/.dark_turquoise] + [/.dark_violet] + [/.deep_pink] + [/.deep_sky_blue] + [/.dim_gray] + [/.dodger_blue] + [/.fire_brick] + [/.floral_white] + [/.forest_green] + [/.fuchsia] + [/.gainsboro] + [/.ghost_white] + [/.gold] + [/.goldenrod] + [/.gray] + [/.green] + [/.green_yellow] + [/.honey_dew] + [/.hot_pink] + [/.indian_red] + [/.indigo] + [/.ivory] + [/.khaki] + [/.lavender] + [/.lavender_blush] + [/.lawn_green] + [/.lemon_chiffon] + [/.light_blue] + [/.light_coral] + [/.light_cyan] + [/.light_goldenrod_yellow] + [/.light_gray] + [/.light_green] + [/.light_pink] + [/.light_salmon] + [/.light_sea_green] + [/.light_sky_blue] + [/.light_slate_gray] + [/.light_steel_blue] + [/.light_yellow] + [/.lime] + [/.lime_green] + [/.linen] + [/.magenta] + [/.maroon] + [/.medium_aquamarine] + [/.medium_blue] + [/.medium_orchid] + [/.medium_purple] + [/.medium_sea_green] + [/.medium_slate_blue] + [/.medium_spring_green] + [/.medium_turquoise] + [/.medium_violet_red] + [/.midnight_blue] + [/.mint_cream] + [/.misty_rose] + [/.moccasin] + [/.navajo_white] + [/.navy] + [/.old_lace] + [/.olive] + [/.olive_drab] + [/.orange] + [/.orange_red] + [/.orchid] + [/.pale_goldenrod] + [/.pale_green] + [/.pale_turquoise] + [/.pale_violet_red] + [/.papaya_whip] + [/.peach_puff] + [/.peru] + [/.pink] + [/.plum] + [/.powder_blue] + [/.purple] + [/.rebecca_purple] + [/.red] + [/.rosy_brown] + [/.royal_blue] + [/.saddle_brown] + [/.salmon] + [/.sandy_brown] + [/.sea_green] + [/.sea_shell] + [/.sienna] + [/.silver] + [/.sky_blue] + [/.slate_blue] + [/.slate_gray] + [/.snow] + [/.spring_green] + [/.steel_blue] + [/.tan] + [/.teal] + [/.thistle] + [/.tomato] + [/.turquoise] + [/.violet] + [/.wheat] + [/.white] + [/.white_smoke] + [/.yellow] + [/.yellow_green] + )) + ))) diff --git a/stdlib/source/documentation/lux/data/format.lux b/stdlib/source/documentation/lux/data/format.lux index 7dbf22055..b1aaea3b6 100644 --- a/stdlib/source/documentation/lux/data/format.lux +++ b/stdlib/source/documentation/lux/data/format.lux @@ -12,8 +12,8 @@ ["[1][0]" tar] ["[1][0]" xml]]) -(.def .public documentation - (.List $.Module) +(def .public documentation + (List $.Documentation) (list.together (list /json.documentation /tar.documentation diff --git a/stdlib/source/documentation/lux/data/format/json.lux b/stdlib/source/documentation/lux/data/format/json.lux index 93bc3add9..48a62f2e0 100644 --- a/stdlib/source/documentation/lux/data/format/json.lux +++ b/stdlib/source/documentation/lux/data/format/json.lux @@ -4,7 +4,9 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]] [meta [macro ["[0]" template]]]]] @@ -12,122 +14,126 @@ [\\library ["[0]" /]]) -(`` (.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.unconsumed_input) - ($.definition \\parser.empty_input) - ($.definition \\parser.unexpected_value) - ($.definition \\parser.value_mismatch) - - ($.definition (\\parser.Parser it) - "A JSON parser.") - - ($.definition \\parser.result - (format "Executes the parser against a JSON object." - \n "Verifies that all of the JSON was consumed by the parser.") - [(result parser json)]) - - ($.definition \\parser.any - "Just returns the JSON input without applying any logic.") - - (,, (with_template [] - [(`` ($.definition - (format "Reads a JSON value as " (,, (template.text [])) ".")))] - - [\\parser.null] - [\\parser.boolean] - [\\parser.number] - [\\parser.string] - )) - - (,, (with_template [ ] - [(`` ($.definition - (format "Asks whether a JSON value is a " (,, (template.text [])) "."))) - (`` ($.definition - (format "Ensures a JSON value is a " (,, (template.text [])) ".")))] - - [\\parser.boolean? \\parser.this_boolean ..boolean] - [\\parser.number? \\parser.this_number ..number] - [\\parser.string? \\parser.this_string ..string] - )) - - ($.definition \\parser.nullable - "Enhances parser by adding NULL-handling." - [(nullable parser)]) - - ($.definition \\parser.array - "Parses the contents of a JSON array." - [(array parser)]) - - ($.definition \\parser.object - (format "Parses the contents of a JSON object." - \n "Use this with the 'field' combinator.") - [(object parser)]) - - ($.definition \\parser.field - (format "Parses a field inside a JSON object." - \n "Use this inside the 'object' combinator.") - [(field field_name parser)]) - - ($.definition \\parser.dictionary - "Parses a dictionary-like JSON object.")] - []))) +(`` (def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") + + ($.definition \\parser.unconsumed_input) + ($.definition \\parser.empty_input) + ($.definition \\parser.unexpected_value) + ($.definition \\parser.value_mismatch) + + ($.definition (\\parser.Parser it) + "A JSON parser.") + + ($.definition \\parser.result + (format "Executes the parser against a JSON object." + \n "Verifies that all of the JSON was consumed by the parser.") + [(result parser json)]) + + ($.definition \\parser.any + "Just returns the JSON input without applying any logic.") + + (,, (with_template [] + [(`` ($.definition + (format "Reads a JSON value as " (,, (template.text [])) ".")))] + + [\\parser.null] + [\\parser.boolean] + [\\parser.number] + [\\parser.string] + )) + + (,, (with_template [ ] + [(`` ($.definition + (format "Asks whether a JSON value is a " (,, (template.text [])) "."))) + (`` ($.definition + (format "Ensures a JSON value is a " (,, (template.text [])) ".")))] + + [\\parser.boolean? \\parser.this_boolean ..boolean] + [\\parser.number? \\parser.this_number ..number] + [\\parser.string? \\parser.this_string ..string] + )) + + ($.definition \\parser.nullable + "Enhances parser by adding NULL-handling." + [(nullable parser)]) + + ($.definition \\parser.array + "Parses the contents of a JSON array." + [(array parser)]) + + ($.definition \\parser.object + (format "Parses the contents of a JSON object." + \n "Use this with the 'field' combinator.") + [(object parser)]) + + ($.definition \\parser.field + (format "Parses a field inside a JSON object." + \n "Use this inside the 'object' combinator.") + [(field field_name parser)]) + + ($.definition \\parser.dictionary + "Parses a dictionary-like JSON object.") + ))) (`` (.def .public documentation - (.List $.Module) - ($.module /._ - (format "Functionality for reading and writing values in the JSON format." - \n "For more information, please see: http://www.json.org/") - [($.definition /.Null) - ($.definition /.Boolean) - ($.definition /.Number) - ($.definition /.String) - ($.definition /.JSON) - ($.definition /.Array) - ($.definition /.Object) - ($.definition /.null?) - ($.definition /.object) - ($.definition /.equivalence) - ($.definition /.format) - ($.definition /.codec) - - ($.definition /.json - "A simple way to produce JSON literals." - ["null" - (json #null)] - ["true" - (json #1)] - ["123.456" - (json +123.456)] - ["'this is a string'" - (json "this is a string")] - ["['this' 'is' 'an' 'array']" - (json ["this" "is" "an" "array"])] - ["{'this' 'is', 'an' 'object'}" - (json {"this" "is" "an" "object"})]) - - ($.definition /.fields - "Get all the fields in a JSON object." - [(fields json)]) - - ($.definition /.field - "A JSON object field getter." - [(field key json)]) - - ($.definition /.has - "A JSON object field setter." - [(has key value json)]) - - (,, (with_template [ ] - [($.definition - (format "A JSON object field getter for " "."))] - - [/.boolean_field "booleans"] - [/.number_field "numbers"] - [/.string_field "strings"] - [/.array_field "arrays"] - [/.object_field "objects"] - ))] - [..\\parser]))) + (List $.Documentation) + (list.partial ($.module /._ + (format "Functionality for reading and writing values in the JSON format." + \n "For more information, please see: http://www.json.org/")) + + ($.definition /.Null) + ($.definition /.Boolean) + ($.definition /.Number) + ($.definition /.String) + ($.definition /.JSON) + ($.definition /.Array) + ($.definition /.Object) + ($.definition /.null?) + ($.definition /.object) + ($.definition /.equivalence) + ($.definition /.format) + ($.definition /.codec) + + ($.definition /.json + "A simple way to produce JSON literals." + ["null" + (json #null)] + ["true" + (json #1)] + ["123.456" + (json +123.456)] + ["'this is a string'" + (json "this is a string")] + ["['this' 'is' 'an' 'array']" + (json ["this" "is" "an" "array"])] + ["{'this' 'is', 'an' 'object'}" + (json {"this" "is" "an" "object"})]) + + ($.definition /.fields + "Get all the fields in a JSON object." + [(fields json)]) + + ($.definition /.field + "A JSON object field getter." + [(field key json)]) + + ($.definition /.has + "A JSON object field setter." + [(has key value json)]) + + (,, (with_template [ ] + [($.definition + (format "A JSON object field getter for " "."))] + + [/.boolean_field "booleans"] + [/.number_field "numbers"] + [/.string_field "strings"] + [/.array_field "arrays"] + [/.object_field "objects"] + )) + + ..\\parser + ))) diff --git a/stdlib/source/documentation/lux/data/format/tar.lux b/stdlib/source/documentation/lux/data/format/tar.lux index 9de7d8ca9..ec8c7f373 100644 --- a/stdlib/source/documentation/lux/data/format/tar.lux +++ b/stdlib/source/documentation/lux/data/format/tar.lux @@ -8,79 +8,80 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.not_a_small_number) - ($.definition /.small_limit) - ($.definition /.Small) - ($.definition /.small) - ($.definition /.from_small) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.not_a_big_number) - ($.definition /.big_limit) - ($.definition /.Big) - ($.definition /.big) - ($.definition /.from_big) + ($.definition /.not_a_small_number) + ($.definition /.small_limit) + ($.definition /.Small) + ($.definition /.small) + ($.definition /.from_small) - ($.definition /.wrong_character) - ($.definition /.not_ascii) - ($.definition /.name_size) - ($.definition /.path_size) + ($.definition /.not_a_big_number) + ($.definition /.big_limit) + ($.definition /.Big) + ($.definition /.big) + ($.definition /.from_big) - ($.definition /.Name) - ($.definition /.name_is_too_long) - ($.definition /.name) - ($.definition /.from_name) - ($.definition /.anonymous) + ($.definition /.wrong_character) + ($.definition /.not_ascii) + ($.definition /.name_size) + ($.definition /.path_size) - ($.definition /.Path) - ($.definition /.path_is_too_long) - ($.definition /.path) - ($.definition /.from_path) - ($.definition /.no_path) + ($.definition /.Name) + ($.definition /.name_is_too_long) + ($.definition /.name) + ($.definition /.from_name) + ($.definition /.anonymous) - ($.definition /.invalid_link_flag) - ($.definition /.Mode) - ($.definition /.mode) - ($.definition /.and) - ($.definition /.invalid_mode) + ($.definition /.Path) + ($.definition /.path_is_too_long) + ($.definition /.path) + ($.definition /.from_path) + ($.definition /.no_path) - ($.definition /.none) - - ($.definition /.execute_by_other) - ($.definition /.write_by_other) - ($.definition /.read_by_other) + ($.definition /.invalid_link_flag) + ($.definition /.Mode) + ($.definition /.mode) + ($.definition /.and) + ($.definition /.invalid_mode) - ($.definition /.execute_by_group) - ($.definition /.write_by_group) - ($.definition /.read_by_group) + ($.definition /.none) + + ($.definition /.execute_by_other) + ($.definition /.write_by_other) + ($.definition /.read_by_other) - ($.definition /.execute_by_owner) - ($.definition /.write_by_owner) - ($.definition /.read_by_owner) + ($.definition /.execute_by_group) + ($.definition /.write_by_group) + ($.definition /.read_by_group) - ($.definition /.save_text) - ($.definition /.set_group_id_on_execution) - ($.definition /.set_user_id_on_execution) - - ($.definition /.Content) - ($.definition /.content) - ($.definition /.data) - ($.definition /.ID) - ($.definition /.no_id) - ($.definition /.Owner) - ($.definition /.Ownership) - ($.definition /.File) - ($.definition /.Normal) - ($.definition /.Symbolic_Link) - ($.definition /.Directory) - ($.definition /.Contiguous) - ($.definition /.Entry) - ($.definition /.Tar) - ($.definition /.format) - ($.definition /.wrong_checksum) - ($.definition /.invalid_end_of_archive) - ($.definition /.parser)] - [])) + ($.definition /.execute_by_owner) + ($.definition /.write_by_owner) + ($.definition /.read_by_owner) + + ($.definition /.save_text) + ($.definition /.set_group_id_on_execution) + ($.definition /.set_user_id_on_execution) + + ($.definition /.Content) + ($.definition /.content) + ($.definition /.data) + ($.definition /.ID) + ($.definition /.no_id) + ($.definition /.Owner) + ($.definition /.Ownership) + ($.definition /.File) + ($.definition /.Normal) + ($.definition /.Symbolic_Link) + ($.definition /.Directory) + ($.definition /.Contiguous) + ($.definition /.Entry) + ($.definition /.Tar) + ($.definition /.format) + ($.definition /.wrong_checksum) + ($.definition /.invalid_end_of_archive) + ($.definition /.parser) + )) diff --git a/stdlib/source/documentation/lux/data/format/xml.lux b/stdlib/source/documentation/lux/data/format/xml.lux index 60c2841e9..22c80ea1f 100644 --- a/stdlib/source/documentation/lux/data/format/xml.lux +++ b/stdlib/source/documentation/lux/data/format/xml.lux @@ -4,70 +4,76 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] ["[0]" \\parser] [\\library ["[0]" /]]) -(.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.empty_input) - ($.definition \\parser.unexpected_input) - ($.definition \\parser.wrong_tag) - ($.definition \\parser.unknown_attribute) - ($.definition \\parser.unconsumed_inputs) - ($.definition \\parser.nowhere) - - ($.definition (\\parser.Parser it) - "A parser of XML-encoded data.") - - ($.definition \\parser.result - (format "Applies a parser against a stream of XML documents." - \n "Verifies that all of the inputs are consumed by the parser.") - [(result parser documents)]) - - ($.definition \\parser.text - "Yields text from a text node.") - - ($.definition \\parser.tag - "Yields the tag from the next node.") - - ($.definition \\parser.attribute - "Yields the value of an attribute in the current node." - [(attribute name)]) - - ($.definition \\parser.node - "Parses the contents of the next node if the tag matches." - [(node expected parser)]) - - ($.definition \\parser.any - "Yields the next node.") - - ($.definition \\parser.somewhere - "Applies the parser somewhere among the remaining inputs; instead of demanding that the parser succeeds against the immediate inputs." - [(somewhere parser)])] - [])) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.Tag) - ($.definition /.Attribute) - ($.definition /.Attrs) - ($.definition /.XML) - ($.definition /.codec) - ($.definition /.equivalence) - - ($.definition /.attributes - "An empty set of XML attributes.") - - ($.definition /.tag - "The text format of a XML tag." - [(tag name)]) - - ($.definition /.attribute - "The text format of a XML attribute.")] - [..\\parser])) +(def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") + + ($.definition \\parser.empty_input) + ($.definition \\parser.unexpected_input) + ($.definition \\parser.wrong_tag) + ($.definition \\parser.unknown_attribute) + ($.definition \\parser.unconsumed_inputs) + ($.definition \\parser.nowhere) + + ($.definition (\\parser.Parser it) + "A parser of XML-encoded data.") + + ($.definition \\parser.result + (format "Applies a parser against a stream of XML documents." + \n "Verifies that all of the inputs are consumed by the parser.") + [(result parser documents)]) + + ($.definition \\parser.text + "Yields text from a text node.") + + ($.definition \\parser.tag + "Yields the tag from the next node.") + + ($.definition \\parser.attribute + "Yields the value of an attribute in the current node." + [(attribute name)]) + + ($.definition \\parser.node + "Parses the contents of the next node if the tag matches." + [(node expected parser)]) + + ($.definition \\parser.any + "Yields the next node.") + + ($.definition \\parser.somewhere + "Applies the parser somewhere among the remaining inputs; instead of demanding that the parser succeeds against the immediate inputs." + [(somewhere parser)]) + )) + +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.Tag) + ($.definition /.Attribute) + ($.definition /.Attrs) + ($.definition /.XML) + ($.definition /.codec) + ($.definition /.equivalence) + + ($.definition /.attributes + "An empty set of XML attributes.") + + ($.definition /.tag + "The text format of a XML tag." + [(tag name)]) + + ($.definition /.attribute + "The text format of a XML attribute.") + + ..\\parser + )) diff --git a/stdlib/source/documentation/lux/data/identity.lux b/stdlib/source/documentation/lux/data/identity.lux index acf3d9bed..c150d7d97 100644 --- a/stdlib/source/documentation/lux/data/identity.lux +++ b/stdlib/source/documentation/lux/data/identity.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except nat int rev list or and) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -8,15 +8,16 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.functor) - ($.definition /.apply) - ($.definition /.monad) - ($.definition /.comonad) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition (/.Identity it) - "A value, as is, without any extra structure super-imposed on it.")] - [])) + ($.definition /.functor) + ($.definition /.apply) + ($.definition /.monad) + ($.definition /.comonad) + + ($.definition (/.Identity it) + "A value, as is, without any extra structure super-imposed on it.") + )) diff --git a/stdlib/source/documentation/lux/data/product.lux b/stdlib/source/documentation/lux/data/product.lux index 05cb39ca8..a589fdd9c 100644 --- a/stdlib/source/documentation/lux/data/product.lux +++ b/stdlib/source/documentation/lux/data/product.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except left right) + [lux (.except) ["$" documentation] [data [text @@ -8,36 +8,37 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "Functionality for working with tuples (particularly 2-tuples/pairs)." - [($.definition /.equivalence) - ($.definition /.hash) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "Functionality for working with tuples (particularly 2-tuples/pairs).") - ($.definition /.left - "The left side of a pair.") + ($.definition /.equivalence) + ($.definition /.hash) - ($.definition /.right - "The right side of a pair.") + ($.definition /.left + "The left side of a pair.") - ($.definition /.curried - "Converts a 2-argument function into nested single-argument functions." - [(curried f)]) + ($.definition /.right + "The right side of a pair.") - ($.definition /.uncurried - "Converts nested single-argument functions into a 2-argument function." - [(uncurried f)]) + ($.definition /.curried + "Converts a 2-argument function into nested single-argument functions." + [(curried f)]) - ($.definition /.swapped - "" - [(swapped [left right])]) + ($.definition /.uncurried + "Converts nested single-argument functions into a 2-argument function." + [(uncurried f)]) - ($.definition /.then - "Apply functions to both sides of a pair." - [(then f g)]) + ($.definition /.swapped + "" + [(swapped [left right])]) - ($.definition /.forked - "Yields a pair by applying both functions to a single value." - [(forked f g)])] - [])) + ($.definition /.then + "Apply functions to both sides of a pair." + [(then f g)]) + + ($.definition /.forked + "Yields a pair by applying both functions to a single value." + [(forked f g)]) + )) diff --git a/stdlib/source/documentation/lux/data/sum.lux b/stdlib/source/documentation/lux/data/sum.lux index b7a41851d..973522394 100644 --- a/stdlib/source/documentation/lux/data/sum.lux +++ b/stdlib/source/documentation/lux/data/sum.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except left right) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -8,27 +8,28 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "Functionality for working with variants (particularly 2-variants)." - [($.definition /.lefts) - ($.definition /.rights) - ($.definition /.partition) - ($.definition /.equivalence) - ($.definition /.hash) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "Functionality for working with variants (particularly 2-variants).") - ($.definition /.left - "Lifts value to the left side of a 2-variant.") + ($.definition /.lefts) + ($.definition /.rights) + ($.definition /.partition) + ($.definition /.equivalence) + ($.definition /.hash) - ($.definition /.right - "Lifts value to the right side of a 2-variant.") + ($.definition /.left + "Lifts value to the left side of a 2-variant.") - ($.definition /.either - "Applies a function to either side of a 2-variant." - [(either on_left on_right)]) + ($.definition /.right + "Lifts value to the right side of a 2-variant.") - ($.definition /.then - "Applies functions to both sides of a 2-variant." - [(then on_left on_right)])] - [])) + ($.definition /.either + "Applies a function to either side of a 2-variant." + [(either on_left on_right)]) + + ($.definition /.then + "Applies functions to both sides of a 2-variant." + [(then on_left on_right)]) + )) diff --git a/stdlib/source/documentation/lux/data/text.lux b/stdlib/source/documentation/lux/data/text.lux index f5271ed99..10b2616a7 100644 --- a/stdlib/source/documentation/lux/data/text.lux +++ b/stdlib/source/documentation/lux/data/text.lux @@ -2,6 +2,9 @@ [library [lux (.except) ["$" documentation] + [data + [collection + ["[0]" list (.use "[1]#[0]" monoid)]]] [meta [macro ["[0]" template]]]]] @@ -16,352 +19,359 @@ [\\library ["[0]" / (.only \n)]]) -(.def \\format - (.List $.Module) - ($.module \\format._ - "" - [($.definition \\format.functor) - - ($.definition \\format.bit) - ($.definition \\format.nat) - ($.definition \\format.int) - ($.definition \\format.rev) - ($.definition \\format.frac) - ($.definition \\format.text) - - ($.definition \\format.ratio) - ($.definition \\format.symbol) - ($.definition \\format.location) - ($.definition \\format.code) - ($.definition \\format.type) - - ($.definition \\format.instant) - ($.definition \\format.duration) - ($.definition \\format.date) - ($.definition \\format.time) - ($.definition \\format.day) - ($.definition \\format.month) - - ($.definition \\format.xml) - ($.definition \\format.json) - - ($.definition \\format.nat_2) - ($.definition \\format.nat_8) - ($.definition \\format.nat_10) - ($.definition \\format.nat_16) - ($.definition \\format.int_2) - ($.definition \\format.int_8) - ($.definition \\format.int_10) - ($.definition \\format.int_16) - ($.definition \\format.rev_2) - ($.definition \\format.rev_8) - ($.definition \\format.rev_10) - ($.definition \\format.rev_16) - ($.definition \\format.frac_2) - ($.definition \\format.frac_8) - ($.definition \\format.frac_10) - ($.definition \\format.frac_16) - - ($.definition \\format.mod) - ($.definition \\format.list) - ($.definition \\format.maybe) - - ($.definition (\\format.Format it) - "A way to produce readable text from values.") - - ($.definition \\format.format - "Text interpolation." - [(format "Static part " (text static) " does not match URI: " uri)])] - [])) - -(`` (.def \\parser - (.List $.Module) - ($.module \\parser._ - "" - [($.definition \\parser.unconsumed_input) - ($.definition \\parser.expected_to_fail) - ($.definition \\parser.cannot_parse) - ($.definition \\parser.cannot_slice) - ($.definition \\parser.cannot_match) - ($.definition \\parser.character_should_be) - ($.definition \\parser.character_should_not_be) - ($.definition \\parser.character_does_not_satisfy_predicate) - - ($.definition \\parser.Offset - "An offset into a block of text.") - - ($.definition (\\parser.Parser it) - "A parser for text.") - - ($.definition \\parser.Slice - "A slice of a block of text.") - - ($.definition \\parser.result - (format "Executes a parser against a block of text." - \n "Verifies that the entire input has been processed.") - [(result parser input)]) - - ($.definition \\parser.offset - "Yields the current offset into the input.") - - ($.definition \\parser.any - "Yields the next character without applying any logic.") - - ($.definition \\parser.any! - "Yields the next character (as a slice) without applying any logic.") - - (,, (with_template [ ] - [(`` ($.definition - (format "Produce a character" (,, (template.text [])) " if the parser fails.")))] - - [\\parser.not ""] - [\\parser.not! " (as a slice)"] - )) - - ($.definition \\parser.this - "Checks that a specific text shows up in the input." - [(this reference)]) - - ($.definition \\parser.end - "Ensure the parser's input is empty.") - - ($.definition \\parser.next - "Yields the next character (without consuming it from the input).") - - ($.definition \\parser.remaining - "Get all of the remaining input (without consuming it).") - - ($.definition \\parser.range - "Only yields characters within a range." - [(range bottom top)]) - - (,, (with_template [ ] - [($.definition - (format "Only yields " " characters."))] - - [\\parser.upper "uppercase"] - [\\parser.lower "lowercase"] - [\\parser.decimal "decimal"] - [\\parser.octal "octal"] - )) - - ($.definition \\parser.alpha - "Yields alphabetic characters.") - - ($.definition \\parser.alpha_num - "Yields alphanumeric characters.") - - ($.definition \\parser.hexadecimal - "Yields hexadecimal digits.") - - (,, (with_template [ ] - [($.definition - (format "Yields characters that are" " part of a piece of text."))] - - [\\parser.one_of ""] - [\\parser.none_of " not"] - )) - - (,, (with_template [ ] - [($.definition - (format "Yields characters (as a slice) that are" " part of a piece of text."))] - - [\\parser.one_of! ""] - [\\parser.none_of! " not"] - )) - - ($.definition \\parser.satisfies - "Yields characters that satisfy a predicate." - [(satisfies parser)]) - - ($.definition \\parser.space - "Yields white-space.") - - ($.definition \\parser.and - "Yields the outputs of both parsers composed together." - [(and left right)]) - - ($.definition \\parser.and! - "Yields the outputs of both parsers composed together (as a slice)." - [(and! left right)]) - - (,, (with_template [ ] - [(`` ($.definition - (format "Yields " (,, (template.text [])) " characters as a single continuous text."))) - (`` ($.definition - (format "Yields " (,, (template.text [])) " characters as a single continuous text (as a slice).")))] - - [\\parser.some \\parser.some!] - [\\parser.many \\parser.many!] - )) - - (,, (with_template [ ] - [(`` ($.definition - (format "Yields " " N characters."))) - (`` ($.definition - (format "Yields " " N characters (as a slice).")))] - - [\\parser.exactly \\parser.exactly! "exactly"] - [\\parser.at_most \\parser.at_most! "at most"] - [\\parser.at_least \\parser.at_least! "at least"] - )) - - ($.definition \\parser.between - "" - [(between minimum additional parser)]) - - ($.definition \\parser.between! - "" - [(between! minimum additional parser)]) - - ($.definition \\parser.enclosed - "" - [(enclosed [start end] parser)]) - - ($.definition \\parser.local - "Applies a parser against the given input." - [(local local_input parser)]) - - ($.definition \\parser.slice - "Converts a slice to a block of text." - [(slice parser)]) - - ($.definition \\parser.then - "Embeds a text parser into an arbitrary parser that yields text." - [(then structured text)])] - []))) - -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.of_char) - - ($.definition /.\0) - ($.definition /.null) - ($.definition /.\a) - ($.definition /.alarm) - ($.definition /.\b) - ($.definition /.back_space) - ($.definition /.\t) - ($.definition /.tab) - ($.definition /.\n) - ($.definition /.new_line) - ($.definition /.\v) - ($.definition /.vertical_tab) - ($.definition /.\f) - ($.definition /.form_feed) - ($.definition /.\r) - ($.definition /.carriage_return) - ($.definition /.\'') - ($.definition /.double_quote) - - ($.definition /.size) - ($.definition /.format) - ($.definition /.equivalence) - ($.definition /.order) - ($.definition /.monoid) - ($.definition /.hash) - ($.definition /.together) - ($.definition /.empty?) - ($.definition /.space) - ($.definition /.lower_cased) - ($.definition /.upper_cased) - - ($.definition /.Char - "A character code number.") - - ($.definition /.line_feed - "Same as 'new_line'.") - - ($.definition /.char - "Yields the character at the specified index." - [(char index input)]) - - ($.definition /.index_since - "" - [(index_since from pattern input)]) - - ($.definition /.index - "" - [(index pattern input)]) - - ($.definition /.last_index - "" - [(last_index part text)]) - - ($.definition /.starts_with? - "" - [(starts_with? prefix x)]) - - ($.definition /.ends_with? - "" - [(ends_with? postfix x)]) - - ($.definition /.enclosed_by? - "" - [(enclosed_by? boundary value)]) - - ($.definition /.contains? - "" - [(contains? sub text)]) - - ($.definition /.prefix - "" - [(prefix param subject)]) - - ($.definition /.suffix - "" - [(suffix param subject)]) - - ($.definition /.enclosed - "Surrounds the given content text with left and right side additions." - [(enclosed [left right] content)]) - - ($.definition /.enclosed' - "Surrounds the given content text with the same boundary text." - [(enclosed' boundary content)]) - - ($.definition /.clip - "Clips a chunk of text from the input at the specified offset and of the specified size." - [(clip offset size input)]) - - ($.definition /.clip_since - "Clips the remaining text from the input at the specified offset." - [(clip_since offset input)]) - - ($.definition /.split_at - "" - [(split_at at x)]) - - ($.definition /.split_by - "" - [(split_by token sample)]) - - ($.definition /.all_split_by - "" - [(all_split_by token sample)]) - - ($.definition /.replaced_once - "" - [(replaced_once pattern replacement template)]) - - ($.definition /.replaced - "" - [(replaced pattern replacement template)]) - - ($.definition /.interposed - "" - [(interposed separator texts)]) - - ($.definition /.space? - "Checks whether the character is white-space." - [(space? char)])] - [..\\format - ..\\parser - - /buffer.documentation - /encoding.documentation - /escape.documentation - /regex.documentation - /unicode.documentation])) +(def \\format + (List $.Documentation) + (list ($.module \\format._ + "") + + ($.definition \\format.functor) + + ($.definition \\format.bit) + ($.definition \\format.nat) + ($.definition \\format.int) + ($.definition \\format.rev) + ($.definition \\format.frac) + ($.definition \\format.text) + + ($.definition \\format.ratio) + ($.definition \\format.symbol) + ($.definition \\format.location) + ($.definition \\format.code) + ($.definition \\format.type) + + ($.definition \\format.instant) + ($.definition \\format.duration) + ($.definition \\format.date) + ($.definition \\format.time) + ($.definition \\format.day) + ($.definition \\format.month) + + ($.definition \\format.xml) + ($.definition \\format.json) + + ($.definition \\format.nat_2) + ($.definition \\format.nat_8) + ($.definition \\format.nat_10) + ($.definition \\format.nat_16) + ($.definition \\format.int_2) + ($.definition \\format.int_8) + ($.definition \\format.int_10) + ($.definition \\format.int_16) + ($.definition \\format.rev_2) + ($.definition \\format.rev_8) + ($.definition \\format.rev_10) + ($.definition \\format.rev_16) + ($.definition \\format.frac_2) + ($.definition \\format.frac_8) + ($.definition \\format.frac_10) + ($.definition \\format.frac_16) + + ($.definition \\format.mod) + ($.definition \\format.list) + ($.definition \\format.maybe) + + ($.definition (\\format.Format it) + "A way to produce readable text from values.") + + ($.definition \\format.format + "Text interpolation." + [(format "Static part " (text static) " does not match URI: " uri)]) + )) + +(`` (def \\parser + (List $.Documentation) + (list ($.module \\parser._ + "") + + ($.definition \\parser.unconsumed_input) + ($.definition \\parser.expected_to_fail) + ($.definition \\parser.cannot_parse) + ($.definition \\parser.cannot_slice) + ($.definition \\parser.cannot_match) + ($.definition \\parser.character_should_be) + ($.definition \\parser.character_should_not_be) + ($.definition \\parser.character_does_not_satisfy_predicate) + + ($.definition \\parser.Offset + "An offset into a block of text.") + + ($.definition (\\parser.Parser it) + "A parser for text.") + + ($.definition \\parser.Slice + "A slice of a block of text.") + + ($.definition \\parser.result + (format "Executes a parser against a block of text." + \n "Verifies that the entire input has been processed.") + [(result parser input)]) + + ($.definition \\parser.offset + "Yields the current offset into the input.") + + ($.definition \\parser.any + "Yields the next character without applying any logic.") + + ($.definition \\parser.any! + "Yields the next character (as a slice) without applying any logic.") + + (,, (with_template [ ] + [(`` ($.definition + (format "Produce a character" (,, (template.text [])) " if the parser fails.")))] + + [\\parser.not ""] + [\\parser.not! " (as a slice)"] + )) + + ($.definition \\parser.this + "Checks that a specific text shows up in the input." + [(this reference)]) + + ($.definition \\parser.end + "Ensure the parser's input is empty.") + + ($.definition \\parser.next + "Yields the next character (without consuming it from the input).") + + ($.definition \\parser.remaining + "Get all of the remaining input (without consuming it).") + + ($.definition \\parser.range + "Only yields characters within a range." + [(range bottom top)]) + + (,, (with_template [ ] + [($.definition + (format "Only yields " " characters."))] + + [\\parser.upper "uppercase"] + [\\parser.lower "lowercase"] + [\\parser.decimal "decimal"] + [\\parser.octal "octal"] + )) + + ($.definition \\parser.alpha + "Yields alphabetic characters.") + + ($.definition \\parser.alpha_num + "Yields alphanumeric characters.") + + ($.definition \\parser.hexadecimal + "Yields hexadecimal digits.") + + (,, (with_template [ ] + [($.definition + (format "Yields characters that are" " part of a piece of text."))] + + [\\parser.one_of ""] + [\\parser.none_of " not"] + )) + + (,, (with_template [ ] + [($.definition + (format "Yields characters (as a slice) that are" " part of a piece of text."))] + + [\\parser.one_of! ""] + [\\parser.none_of! " not"] + )) + + ($.definition \\parser.satisfies + "Yields characters that satisfy a predicate." + [(satisfies parser)]) + + ($.definition \\parser.space + "Yields white-space.") + + ($.definition \\parser.and + "Yields the outputs of both parsers composed together." + [(and left right)]) + + ($.definition \\parser.and! + "Yields the outputs of both parsers composed together (as a slice)." + [(and! left right)]) + + (,, (with_template [ ] + [(`` ($.definition + (format "Yields " (,, (template.text [])) " characters as a single continuous text."))) + (`` ($.definition + (format "Yields " (,, (template.text [])) " characters as a single continuous text (as a slice).")))] + + [\\parser.some \\parser.some!] + [\\parser.many \\parser.many!] + )) + + (,, (with_template [ ] + [(`` ($.definition + (format "Yields " " N characters."))) + (`` ($.definition + (format "Yields " " N characters (as a slice).")))] + + [\\parser.exactly \\parser.exactly! "exactly"] + [\\parser.at_most \\parser.at_most! "at most"] + [\\parser.at_least \\parser.at_least! "at least"] + )) + + ($.definition \\parser.between + "" + [(between minimum additional parser)]) + + ($.definition \\parser.between! + "" + [(between! minimum additional parser)]) + + ($.definition \\parser.enclosed + "" + [(enclosed [start end] parser)]) + + ($.definition \\parser.local + "Applies a parser against the given input." + [(local local_input parser)]) + + ($.definition \\parser.slice + "Converts a slice to a block of text." + [(slice parser)]) + + ($.definition \\parser.then + "Embeds a text parser into an arbitrary parser that yields text." + [(then structured text)]) + ))) + +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.of_char) + + ($.definition /.\0) + ($.definition /.null) + ($.definition /.\a) + ($.definition /.alarm) + ($.definition /.\b) + ($.definition /.back_space) + ($.definition /.\t) + ($.definition /.tab) + ($.definition /.\n) + ($.definition /.new_line) + ($.definition /.\v) + ($.definition /.vertical_tab) + ($.definition /.\f) + ($.definition /.form_feed) + ($.definition /.\r) + ($.definition /.carriage_return) + ($.definition /.\'') + ($.definition /.double_quote) + + ($.definition /.size) + ($.definition /.format) + ($.definition /.equivalence) + ($.definition /.order) + ($.definition /.monoid) + ($.definition /.hash) + ($.definition /.together) + ($.definition /.empty?) + ($.definition /.space) + ($.definition /.lower_cased) + ($.definition /.upper_cased) + + ($.definition /.Char + "A character code number.") + + ($.definition /.line_feed + "Same as 'new_line'.") + + ($.definition /.char + "Yields the character at the specified index." + [(char index input)]) + + ($.definition /.index_since + "" + [(index_since from pattern input)]) + + ($.definition /.index + "" + [(index pattern input)]) + + ($.definition /.last_index + "" + [(last_index part text)]) + + ($.definition /.starts_with? + "" + [(starts_with? prefix x)]) + + ($.definition /.ends_with? + "" + [(ends_with? postfix x)]) + + ($.definition /.enclosed_by? + "" + [(enclosed_by? boundary value)]) + + ($.definition /.contains? + "" + [(contains? sub text)]) + + ($.definition /.prefix + "" + [(prefix param subject)]) + + ($.definition /.suffix + "" + [(suffix param subject)]) + + ($.definition /.enclosed + "Surrounds the given content text with left and right side additions." + [(enclosed [left right] content)]) + + ($.definition /.enclosed' + "Surrounds the given content text with the same boundary text." + [(enclosed' boundary content)]) + + ($.definition /.clip + "Clips a chunk of text from the input at the specified offset and of the specified size." + [(clip offset size input)]) + + ($.definition /.clip_since + "Clips the remaining text from the input at the specified offset." + [(clip_since offset input)]) + + ($.definition /.split_at + "" + [(split_at at x)]) + + ($.definition /.split_by + "" + [(split_by token sample)]) + + ($.definition /.all_split_by + "" + [(all_split_by token sample)]) + + ($.definition /.replaced_once + "" + [(replaced_once pattern replacement template)]) + + ($.definition /.replaced + "" + [(replaced pattern replacement template)]) + + ($.definition /.interposed + "" + [(interposed separator texts)]) + + ($.definition /.space? + "Checks whether the character is white-space." + [(space? char)]) + + (all list#composite + ..\\format + ..\\parser + + /buffer.documentation + /encoding.documentation + /escape.documentation + /regex.documentation + /unicode.documentation + ) + )) diff --git a/stdlib/source/documentation/lux/data/text/buffer.lux b/stdlib/source/documentation/lux/data/text/buffer.lux index 6c8fc5c5f..be0eff147 100644 --- a/stdlib/source/documentation/lux/data/text/buffer.lux +++ b/stdlib/source/documentation/lux/data/text/buffer.lux @@ -8,15 +8,16 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.empty) - ($.definition /.then) - ($.definition /.size) - ($.definition /.text) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.Buffer - "Immutable text buffer for efficient text concatenation.")] - [])) + ($.definition /.empty) + ($.definition /.then) + ($.definition /.size) + ($.definition /.text) + + ($.definition /.Buffer + "Immutable text buffer for efficient text concatenation.") + )) diff --git a/stdlib/source/documentation/lux/data/text/encoding.lux b/stdlib/source/documentation/lux/data/text/encoding.lux index 2acadb26e..e5e324f22 100644 --- a/stdlib/source/documentation/lux/data/text/encoding.lux +++ b/stdlib/source/documentation/lux/data/text/encoding.lux @@ -4,167 +4,172 @@ ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" utf8]]) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.name) +(`` (def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") - ($.definition /.Encoding - "Encoding formats for text.") + ($.definition /.name) - (,, (with_template [] - [($.definition - (format "'" (/.name ) "' text encoding. "))] + ($.definition /.Encoding + "Encoding formats for text.") - [/.ascii] + (,, (with_template [] + [($.definition + (format "'" (/.name ) "' text encoding. "))] - [/.ibm_037] - [/.ibm_273] - [/.ibm_277] - [/.ibm_278] - [/.ibm_280] - [/.ibm_284] - [/.ibm_285] - [/.ibm_290] - [/.ibm_297] - [/.ibm_300] - [/.ibm_420] - [/.ibm_424] - [/.ibm_437] - [/.ibm_500] - [/.ibm_737] - [/.ibm_775] - [/.ibm_833] - [/.ibm_834] - [/.ibm_838] - [/.ibm_850] - [/.ibm_852] - [/.ibm_855] - [/.ibm_856] - [/.ibm_857] - [/.ibm_858] - [/.ibm_860] - [/.ibm_861] - [/.ibm_862] - [/.ibm_863] - [/.ibm_864] - [/.ibm_865] - [/.ibm_866] - [/.ibm_868] - [/.ibm_869] - [/.ibm_870] - [/.ibm_871] - [/.ibm_874] - [/.ibm_875] - [/.ibm_918] - [/.ibm_921] - [/.ibm_922] - [/.ibm_930] - [/.ibm_933] - [/.ibm_935] - [/.ibm_937] - [/.ibm_939] - [/.ibm_942] - [/.ibm_942c] - [/.ibm_943] - [/.ibm_943c] - [/.ibm_948] - [/.ibm_949] - [/.ibm_949c] - [/.ibm_950] - [/.ibm_964] - [/.ibm_970] - [/.ibm_1006] - [/.ibm_1025] - [/.ibm_1026] - [/.ibm_1046] - [/.ibm_1047] - [/.ibm_1097] - [/.ibm_1098] - [/.ibm_1112] - [/.ibm_1122] - [/.ibm_1123] - [/.ibm_1124] - [/.ibm_1140] - [/.ibm_1141] - [/.ibm_1142] - [/.ibm_1143] - [/.ibm_1144] - [/.ibm_1145] - [/.ibm_1146] - [/.ibm_1147] - [/.ibm_1148] - [/.ibm_1149] - [/.ibm_1166] - [/.ibm_1364] - [/.ibm_1381] - [/.ibm_1383] - [/.ibm_33722] - - [/.iso_2022_cn] - [/.iso2022_cn_cns] - [/.iso2022_cn_gb] - [/.iso_2022_jp] - [/.iso_2022_jp_2] - [/.iso_2022_kr] - [/.iso_8859_1] - [/.iso_8859_2] - [/.iso_8859_3] - [/.iso_8859_4] - [/.iso_8859_5] - [/.iso_8859_6] - [/.iso_8859_7] - [/.iso_8859_8] - [/.iso_8859_9] - [/.iso_8859_11] - [/.iso_8859_13] - [/.iso_8859_15] + [/.ascii] - [/.mac_arabic] - [/.mac_central_europe] - [/.mac_croatian] - [/.mac_cyrillic] - [/.mac_dingbat] - [/.mac_greek] - [/.mac_hebrew] - [/.mac_iceland] - [/.mac_roman] - [/.mac_romania] - [/.mac_symbol] - [/.mac_thai] - [/.mac_turkish] - [/.mac_ukraine] - - [/.utf_8] - [/.utf_16] - [/.utf_32] + [/.ibm_037] + [/.ibm_273] + [/.ibm_277] + [/.ibm_278] + [/.ibm_280] + [/.ibm_284] + [/.ibm_285] + [/.ibm_290] + [/.ibm_297] + [/.ibm_300] + [/.ibm_420] + [/.ibm_424] + [/.ibm_437] + [/.ibm_500] + [/.ibm_737] + [/.ibm_775] + [/.ibm_833] + [/.ibm_834] + [/.ibm_838] + [/.ibm_850] + [/.ibm_852] + [/.ibm_855] + [/.ibm_856] + [/.ibm_857] + [/.ibm_858] + [/.ibm_860] + [/.ibm_861] + [/.ibm_862] + [/.ibm_863] + [/.ibm_864] + [/.ibm_865] + [/.ibm_866] + [/.ibm_868] + [/.ibm_869] + [/.ibm_870] + [/.ibm_871] + [/.ibm_874] + [/.ibm_875] + [/.ibm_918] + [/.ibm_921] + [/.ibm_922] + [/.ibm_930] + [/.ibm_933] + [/.ibm_935] + [/.ibm_937] + [/.ibm_939] + [/.ibm_942] + [/.ibm_942c] + [/.ibm_943] + [/.ibm_943c] + [/.ibm_948] + [/.ibm_949] + [/.ibm_949c] + [/.ibm_950] + [/.ibm_964] + [/.ibm_970] + [/.ibm_1006] + [/.ibm_1025] + [/.ibm_1026] + [/.ibm_1046] + [/.ibm_1047] + [/.ibm_1097] + [/.ibm_1098] + [/.ibm_1112] + [/.ibm_1122] + [/.ibm_1123] + [/.ibm_1124] + [/.ibm_1140] + [/.ibm_1141] + [/.ibm_1142] + [/.ibm_1143] + [/.ibm_1144] + [/.ibm_1145] + [/.ibm_1146] + [/.ibm_1147] + [/.ibm_1148] + [/.ibm_1149] + [/.ibm_1166] + [/.ibm_1364] + [/.ibm_1381] + [/.ibm_1383] + [/.ibm_33722] + + [/.iso_2022_cn] + [/.iso2022_cn_cns] + [/.iso2022_cn_gb] + [/.iso_2022_jp] + [/.iso_2022_jp_2] + [/.iso_2022_kr] + [/.iso_8859_1] + [/.iso_8859_2] + [/.iso_8859_3] + [/.iso_8859_4] + [/.iso_8859_5] + [/.iso_8859_6] + [/.iso_8859_7] + [/.iso_8859_8] + [/.iso_8859_9] + [/.iso_8859_11] + [/.iso_8859_13] + [/.iso_8859_15] - [/.windows_31j] - [/.windows_874] - [/.windows_949] - [/.windows_950] - [/.windows_1250] - [/.windows_1252] - [/.windows_1251] - [/.windows_1253] - [/.windows_1254] - [/.windows_1255] - [/.windows_1256] - [/.windows_1257] - [/.windows_1258] - [/.windows_iso2022jp] - [/.windows_50220] - [/.windows_50221] - - [/.cesu_8] - [/.koi8_r] - [/.koi8_u] - ))] - [/utf8.documentation]))) + [/.mac_arabic] + [/.mac_central_europe] + [/.mac_croatian] + [/.mac_cyrillic] + [/.mac_dingbat] + [/.mac_greek] + [/.mac_hebrew] + [/.mac_iceland] + [/.mac_roman] + [/.mac_romania] + [/.mac_symbol] + [/.mac_thai] + [/.mac_turkish] + [/.mac_ukraine] + + [/.utf_8] + [/.utf_16] + [/.utf_32] + + [/.windows_31j] + [/.windows_874] + [/.windows_949] + [/.windows_950] + [/.windows_1250] + [/.windows_1252] + [/.windows_1251] + [/.windows_1253] + [/.windows_1254] + [/.windows_1255] + [/.windows_1256] + [/.windows_1257] + [/.windows_1258] + [/.windows_iso2022jp] + [/.windows_50220] + [/.windows_50221] + + [/.cesu_8] + [/.koi8_r] + [/.koi8_u] + )) + + /utf8.documentation + ))) diff --git a/stdlib/source/documentation/lux/data/text/encoding/utf8.lux b/stdlib/source/documentation/lux/data/text/encoding/utf8.lux index afe5d2b41..7a22b7cf5 100644 --- a/stdlib/source/documentation/lux/data/text/encoding/utf8.lux +++ b/stdlib/source/documentation/lux/data/text/encoding/utf8.lux @@ -8,10 +8,11 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.codec - "A codec for binary encoding of text as UTF-8.")] - [])) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") + + ($.definition /.codec + "A codec for binary encoding of text as UTF-8.") + )) diff --git a/stdlib/source/documentation/lux/data/text/escape.lux b/stdlib/source/documentation/lux/data/text/escape.lux index 91c23806d..5b85c8359 100644 --- a/stdlib/source/documentation/lux/data/text/escape.lux +++ b/stdlib/source/documentation/lux/data/text/escape.lux @@ -8,28 +8,29 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.escapable?) - ($.definition /.dangling_escape) - ($.definition /.invalid_escape) - ($.definition /.invalid_unicode_escape) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.escaped - "Yields a escaped version of the text." - [(escaped text)]) + ($.definition /.escapable?) + ($.definition /.dangling_escape) + ($.definition /.invalid_escape) + ($.definition /.invalid_unicode_escape) - ($.definition /.un_escaped - (format "Yields an un-escaped text." - \n "Fails if it was improperly escaped.") - [(un_escaped text)]) + ($.definition /.escaped + "Yields a escaped version of the text." + [(escaped text)]) - ($.definition /.literal - "If given a escaped text literal, expands to an un-escaped version." - [(/.literal "Line 1\nLine 2") - "=>" - (format "Line 1" \n - "Line 2")])] - [])) + ($.definition /.un_escaped + (format "Yields an un-escaped text." + \n "Fails if it was improperly escaped.") + [(un_escaped text)]) + + ($.definition /.literal + "If given a escaped text literal, expands to an un-escaped version." + [(/.literal "Line 1\nLine 2") + "=>" + (format "Line 1" \n + "Line 2")]) + )) diff --git a/stdlib/source/documentation/lux/data/text/regex.lux b/stdlib/source/documentation/lux/data/text/regex.lux index cd8511743..090b88c41 100644 --- a/stdlib/source/documentation/lux/data/text/regex.lux +++ b/stdlib/source/documentation/lux/data/text/regex.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except pattern) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -8,68 +8,69 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.incorrect_quantification) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.regex - "Create lexers using regular-expression syntax." - ["Literals" - (regex "a")] - ["Wildcards" - (regex ".")] - ["Escaping" - (regex "\.")] - ["Character classes" - (regex "\d") - (regex "\p{Lower}") - (regex "[abc]") - (regex "[a-z]") - (regex "[a-zA-Z]") - (regex "[a-z&&[def]]")] - ["Negation" - (regex "[^abc]") - (regex "[^a-z]") - (regex "[^a-zA-Z]") - (regex "[a-z&&[^bc]]") - (regex "[a-z&&[^m-p]]")] - ["Combinations" - (regex "aa") - (regex "a?") - (regex "a*") - (regex "a+")] - ["Specific amounts" - (regex "a{2}")] - ["At least" - (regex "a{1,}")] - ["At most" - (regex "a{,1}")] - ["Between" - (regex "a{1,2}")] - ["Groups" - (regex "a(.)c") - (regex "a(b+)c") - (regex "(\d{3})-(\d{3})-(\d{4})") - (regex "(\d{3})-(?:\d{3})-(\d{4})") - (regex "(?\d{3})-\k-(\d{4})") - (regex "(?\d{3})-\k-(\d{4})-\0") - (regex "(\d{3})-((\d{3})-(\d{4}))")] - ["Alternation" - (regex "a|b") - (regex "a(.)(.)|b(.)(.)")]) + ($.definition /.incorrect_quantification) - ($.definition /.pattern - "Allows you to test text against regular expressions." - [(case some_text - (pattern "(\d{3})-(\d{3})-(\d{4})" - [_ country_code area_code place_code]) - do_some_thing_when_number + ($.definition /.regex + "Create lexers using regular-expression syntax." + ["Literals" + (regex "a")] + ["Wildcards" + (regex ".")] + ["Escaping" + (regex "\.")] + ["Character classes" + (regex "\d") + (regex "\p{Lower}") + (regex "[abc]") + (regex "[a-z]") + (regex "[a-zA-Z]") + (regex "[a-z&&[def]]")] + ["Negation" + (regex "[^abc]") + (regex "[^a-z]") + (regex "[^a-zA-Z]") + (regex "[a-z&&[^bc]]") + (regex "[a-z&&[^m-p]]")] + ["Combinations" + (regex "aa") + (regex "a?") + (regex "a*") + (regex "a+")] + ["Specific amounts" + (regex "a{2}")] + ["At least" + (regex "a{1,}")] + ["At most" + (regex "a{,1}")] + ["Between" + (regex "a{1,2}")] + ["Groups" + (regex "a(.)c") + (regex "a(b+)c") + (regex "(\d{3})-(\d{3})-(\d{4})") + (regex "(\d{3})-(?:\d{3})-(\d{4})") + (regex "(?\d{3})-\k-(\d{4})") + (regex "(?\d{3})-\k-(\d{4})-\0") + (regex "(\d{3})-((\d{3})-(\d{4}))")] + ["Alternation" + (regex "a|b") + (regex "a(.)(.)|b(.)(.)")]) - (pattern "\w+") - do_some_thing_when_word + ($.definition /.pattern + "Allows you to test text against regular expressions." + [(case some_text + (pattern "(\d{3})-(\d{3})-(\d{4})" + [_ country_code area_code place_code]) + do_some_thing_when_number - _ - do_something_else)])] - [])) + (pattern "\w+") + do_some_thing_when_word + + _ + do_something_else)]) + )) diff --git a/stdlib/source/documentation/lux/data/text/unicode.lux b/stdlib/source/documentation/lux/data/text/unicode.lux index 6248d9bb9..df6b2a4d9 100644 --- a/stdlib/source/documentation/lux/data/text/unicode.lux +++ b/stdlib/source/documentation/lux/data/text/unicode.lux @@ -11,8 +11,8 @@ ["[1][0]" block] ["[1][0]" set]]) -(.def .public documentation - (.List $.Module) +(def .public documentation + (List $.Documentation) (list.together (list /block.documentation /set.documentation diff --git a/stdlib/source/documentation/lux/data/text/unicode/block.lux b/stdlib/source/documentation/lux/data/text/unicode/block.lux index 3c5ea5c8f..7aa0355ab 100644 --- a/stdlib/source/documentation/lux/data/text/unicode/block.lux +++ b/stdlib/source/documentation/lux/data/text/unicode/block.lux @@ -11,142 +11,143 @@ [\\library ["[0]" /]]) -(`` (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.monoid) - ($.definition /.start) - ($.definition /.end) - ($.definition /.size) - ($.definition /.equivalence) - ($.definition /.hash) +(`` (def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.Block - "A block of valid unicode characters.") + ($.definition /.monoid) + ($.definition /.start) + ($.definition /.end) + ($.definition /.size) + ($.definition /.equivalence) + ($.definition /.hash) - ($.definition /.block - "" - [(block start additional)]) + ($.definition /.Block + "A block of valid unicode characters.") - ($.definition /.within? - "" - [(within? block char)]) + ($.definition /.block + "" + [(block start additional)]) - (,, (with_template [] - [($.definition - (let [[_ name] (symbol )] - (format (hex#encoded (/.start )) - "-" (hex#encoded (/.end )) - " | " (text.replaced "_" " " name))))] + ($.definition /.within? + "" + [(within? block char)]) - [/.basic_latin] - [/.latin_1_supplement] - [/.latin_extended_a] - [/.latin_extended_b] - [/.ipa_extensions] - [/.spacing_modifier_letters] - [/.combining_diacritical_marks] - [/.greek_and_coptic] - [/.cyrillic] - [/.cyrillic_supplementary] - [/.armenian] - [/.hebrew] - [/.arabic] - [/.syriac] - [/.thaana] - [/.devanagari] - [/.bengali] - [/.gurmukhi] - [/.gujarati] - [/.oriya] - [/.tamil] - [/.telugu] - [/.kannada] - [/.malayalam] - [/.sinhala] - [/.thai] - [/.lao] - [/.tibetan] - [/.myanmar] - [/.georgian] - [/.hangul_jamo] - [/.ethiopic] - [/.cherokee] - [/.unified_canadian_aboriginal_syllabics] - [/.ogham] - [/.runic] - [/.tagalog] - [/.hanunoo] - [/.buhid] - [/.tagbanwa] - [/.khmer] - [/.mongolian] - [/.limbu] - [/.tai_le] - [/.khmer_symbols] - [/.phonetic_extensions] - [/.latin_extended_additional] - [/.greek_extended] - [/.general_punctuation] - [/.superscripts_and_subscripts] - [/.currency_symbols] - [/.combining_diacritical_marks_for_symbols] - [/.letterlike_symbols] - [/.number_forms] - [/.arrows] - [/.mathematical_operators] - [/.miscellaneous_technical] - [/.control_pictures] - [/.optical_character_recognition] - [/.enclosed_alphanumerics] - [/.box_drawing] - [/.block_elements] - [/.geometric_shapes] - [/.miscellaneous_symbols] - [/.dingbats] - [/.miscellaneous_mathematical_symbols_a] - [/.supplemental_arrows_a] - [/.braille_patterns] - [/.supplemental_arrows_b] - [/.miscellaneous_mathematical_symbols_b] - [/.supplemental_mathematical_operators] - [/.miscellaneous_symbols_and_arrows] - [/.cjk_radicals_supplement] - [/.kangxi_radicals] - [/.ideographic_description_characters] - [/.cjk_symbols_and_punctuation] - [/.hiragana] - [/.katakana] - [/.bopomofo] - [/.hangul_compatibility_jamo] - [/.kanbun] - [/.bopomofo_extended] - [/.katakana_phonetic_extensions] - [/.enclosed_cjk_letters_and_months] - [/.cjk_compatibility] - [/.cjk_unified_ideographs_extension_a] - [/.yijing_hexagram_symbols] - [/.cjk_unified_ideographs] - [/.yi_syllables] - [/.yi_radicals] - [/.hangul_syllables] - [/.high_surrogates] - [/.high_private_use_surrogates] - [/.low_surrogates] - [/.private_use_area] - [/.cjk_compatibility_ideographs] - [/.alphabetic_presentation_forms] - [/.arabic_presentation_forms_a] - [/.variation_selectors] - [/.combining_half_marks] - [/.cjk_compatibility_forms] - [/.small_form_variants] - [/.arabic_presentation_forms_b] - [/.halfwidth_and_fullwidth_forms] - [/.specials] - [/.numeric] - [/.upper_case] - [/.lower_case] - ))] - []))) + (,, (with_template [] + [($.definition + (let [[_ name] (symbol )] + (format (hex#encoded (/.start )) + "-" (hex#encoded (/.end )) + " | " (text.replaced "_" " " name))))] + + [/.basic_latin] + [/.latin_1_supplement] + [/.latin_extended_a] + [/.latin_extended_b] + [/.ipa_extensions] + [/.spacing_modifier_letters] + [/.combining_diacritical_marks] + [/.greek_and_coptic] + [/.cyrillic] + [/.cyrillic_supplementary] + [/.armenian] + [/.hebrew] + [/.arabic] + [/.syriac] + [/.thaana] + [/.devanagari] + [/.bengali] + [/.gurmukhi] + [/.gujarati] + [/.oriya] + [/.tamil] + [/.telugu] + [/.kannada] + [/.malayalam] + [/.sinhala] + [/.thai] + [/.lao] + [/.tibetan] + [/.myanmar] + [/.georgian] + [/.hangul_jamo] + [/.ethiopic] + [/.cherokee] + [/.unified_canadian_aboriginal_syllabics] + [/.ogham] + [/.runic] + [/.tagalog] + [/.hanunoo] + [/.buhid] + [/.tagbanwa] + [/.khmer] + [/.mongolian] + [/.limbu] + [/.tai_le] + [/.khmer_symbols] + [/.phonetic_extensions] + [/.latin_extended_additional] + [/.greek_extended] + [/.general_punctuation] + [/.superscripts_and_subscripts] + [/.currency_symbols] + [/.combining_diacritical_marks_for_symbols] + [/.letterlike_symbols] + [/.number_forms] + [/.arrows] + [/.mathematical_operators] + [/.miscellaneous_technical] + [/.control_pictures] + [/.optical_character_recognition] + [/.enclosed_alphanumerics] + [/.box_drawing] + [/.block_elements] + [/.geometric_shapes] + [/.miscellaneous_symbols] + [/.dingbats] + [/.miscellaneous_mathematical_symbols_a] + [/.supplemental_arrows_a] + [/.braille_patterns] + [/.supplemental_arrows_b] + [/.miscellaneous_mathematical_symbols_b] + [/.supplemental_mathematical_operators] + [/.miscellaneous_symbols_and_arrows] + [/.cjk_radicals_supplement] + [/.kangxi_radicals] + [/.ideographic_description_characters] + [/.cjk_symbols_and_punctuation] + [/.hiragana] + [/.katakana] + [/.bopomofo] + [/.hangul_compatibility_jamo] + [/.kanbun] + [/.bopomofo_extended] + [/.katakana_phonetic_extensions] + [/.enclosed_cjk_letters_and_months] + [/.cjk_compatibility] + [/.cjk_unified_ideographs_extension_a] + [/.yijing_hexagram_symbols] + [/.cjk_unified_ideographs] + [/.yi_syllables] + [/.yi_radicals] + [/.hangul_syllables] + [/.high_surrogates] + [/.high_private_use_surrogates] + [/.low_surrogates] + [/.private_use_area] + [/.cjk_compatibility_ideographs] + [/.alphabetic_presentation_forms] + [/.arabic_presentation_forms_a] + [/.variation_selectors] + [/.combining_half_marks] + [/.cjk_compatibility_forms] + [/.small_form_variants] + [/.arabic_presentation_forms_b] + [/.halfwidth_and_fullwidth_forms] + [/.specials] + [/.numeric] + [/.upper_case] + [/.lower_case] + )) + ))) diff --git a/stdlib/source/documentation/lux/data/text/unicode/set.lux b/stdlib/source/documentation/lux/data/text/unicode/set.lux index 268affa1b..68fbb3446 100644 --- a/stdlib/source/documentation/lux/data/text/unicode/set.lux +++ b/stdlib/source/documentation/lux/data/text/unicode/set.lux @@ -8,31 +8,32 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.Set) - ($.definition /.composite) - ($.definition /.character) - ($.definition /.non_character) - ($.definition /.full) - ($.definition /.start) - ($.definition /.end) - ($.definition /.equivalence) +(def .public documentation + (List $.Documentation) + (list ($.module /._ + "") - ($.definition /.ascii) - ($.definition /.alphabetic) - ($.definition /.alpha_numeric) - ($.definition /.numeric) - ($.definition /.upper_case) - ($.definition /.lower_case) + ($.definition /.Set) + ($.definition /.composite) + ($.definition /.character) + ($.definition /.non_character) + ($.definition /.full) + ($.definition /.start) + ($.definition /.end) + ($.definition /.equivalence) - ($.definition /.set - "" - [(set [head tail])]) + ($.definition /.ascii) + ($.definition /.alphabetic) + ($.definition /.alpha_numeric) + ($.definition /.numeric) + ($.definition /.upper_case) + ($.definition /.lower_case) - ($.definition /.member? - "" - [(member? set character)])] - [])) + ($.definition /.set + "" + [(set [head tail])]) + + ($.definition /.member? + "" + [(member? set character)]) + )) -- cgit v1.2.3