aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation/lux/data')
-rw-r--r--stdlib/source/documentation/lux/data/binary.lux44
-rw-r--r--stdlib/source/documentation/lux/data/collection/array.lux36
-rw-r--r--stdlib/source/documentation/lux/data/collection/bits.lux10
-rw-r--r--stdlib/source/documentation/lux/data/collection/dictionary.lux26
-rw-r--r--stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux16
-rw-r--r--stdlib/source/documentation/lux/data/collection/list.lux74
-rw-r--r--stdlib/source/documentation/lux/data/collection/list/property.lux10
-rw-r--r--stdlib/source/documentation/lux/data/collection/queue.lux10
-rw-r--r--stdlib/source/documentation/lux/data/collection/queue/priority.lux4
-rw-r--r--stdlib/source/documentation/lux/data/collection/sequence.lux20
-rw-r--r--stdlib/source/documentation/lux/data/collection/set.lux10
-rw-r--r--stdlib/source/documentation/lux/data/collection/set/multi.lux12
-rw-r--r--stdlib/source/documentation/lux/data/collection/set/ordered.lux12
-rw-r--r--stdlib/source/documentation/lux/data/collection/stack.lux6
-rw-r--r--stdlib/source/documentation/lux/data/collection/stream.lux16
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree.lux20
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree/finger.lux12
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree/zipper.lux8
-rw-r--r--stdlib/source/documentation/lux/data/color.lux8
-rw-r--r--stdlib/source/documentation/lux/data/format/json.lux45
-rw-r--r--stdlib/source/documentation/lux/data/format/xml.lux10
-rw-r--r--stdlib/source/documentation/lux/data/product.lux10
-rw-r--r--stdlib/source/documentation/lux/data/sum.lux4
-rw-r--r--stdlib/source/documentation/lux/data/text.lux78
-rw-r--r--stdlib/source/documentation/lux/data/text/escape.lux12
-rw-r--r--stdlib/source/documentation/lux/data/text/regex.lux114
-rw-r--r--stdlib/source/documentation/lux/data/text/unicode/block.lux4
-rw-r--r--stdlib/source/documentation/lux/data/text/unicode/set.lux4
28 files changed, 326 insertions, 309 deletions
diff --git a/stdlib/source/documentation/lux/data/binary.lux b/stdlib/source/documentation/lux/data/binary.lux
index b5bb6660a..14d84dc55 100644
--- a/stdlib/source/documentation/lux/data/binary.lux
+++ b/stdlib/source/documentation/lux/data/binary.lux
@@ -40,7 +40,7 @@
($.definition \\parser.segment
"Parses a chunk of data of a given size."
- [(segment size)])
+ ($.example (segment size)))
(,, (with_template [<size> <name>]
[($.definition <name>
@@ -74,11 +74,11 @@
($.definition \\parser.list
"Parses an arbitrarily long list of values."
- [(list value)])
+ ($.example (list value)))
($.definition \\parser.set
""
- [(set hash value)]))]
+ ($.example (set hash value))))]
(list.partial ($.module \\parser._
"")
@@ -92,7 +92,7 @@
($.definition \\parser.result
"Runs a parser and checks that all the binary data was read by it."
- [(result parser input)])
+ ($.example (result parser input)))
($.definition \\parser.end?
"Checks whether there is no more data to read.")
@@ -150,7 +150,7 @@
($.definition \\format.segment
"Writes at most 'size' bytes of an input binary blob."
- [(segment size)]))]
+ ($.example (segment size))))]
(list.partial ($.module \\format._
"")
@@ -173,19 +173,19 @@
($.definition \\format.result
"Yields a binary blob with all the information written to it."
- [(result format value)])
+ ($.example (result format value)))
($.definition \\format.or
""
- [(or left right)])
+ ($.example (or left right)))
($.definition \\format.and
""
- [(and pre post)])
+ ($.example (and pre post)))
($.definition \\format.rec
"A combinator for recursive formats."
- [(rec body)])
+ ($.example (rec body)))
specific
)))
@@ -206,55 +206,55 @@
($.definition /.empty
"A fresh/empty binary BLOB of the specified size."
- [(empty size)])
+ ($.example (empty size)))
($.definition /.mix
""
- [(mix f init binary)])
+ ($.example (mix f init binary)))
($.definition /.bits_8
"Read 1 byte (8 bits) at the given index."
- [(bits_8 index binary)])
+ ($.example (bits_8 index binary)))
($.definition /.bits_16
"Read 2 bytes (16 bits) at the given index."
- [(bits_16 index binary)])
+ ($.example (bits_16 index binary)))
($.definition /.bits_32
"Read 4 bytes (32 bits) at the given index."
- [(bits_32 index binary)])
+ ($.example (bits_32 index binary)))
($.definition /.bits_64
"Read 8 bytes (64 bits) at the given index."
- [(bits_64 index binary)])
+ ($.example (bits_64 index binary)))
($.definition /.has_8!
"Write 1 byte (8 bits) at the given index."
- [(has_8! index value binary)])
+ ($.example (has_8! index value binary)))
($.definition /.has_16!
"Write 2 bytes (16 bits) at the given index."
- [(has_16! index value binary)])
+ ($.example (has_16! index value binary)))
($.definition /.has_32!
"Write 4 bytes (32 bits) at the given index."
- [(has_32! index value binary)])
+ ($.example (has_32! index value binary)))
($.definition /.has_64!
"Write 8 bytes (64 bits) at the given index."
- [(has_64! index value binary)])
+ ($.example (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)])
+ ($.example (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)])
+ ($.example (slice offset length binary)))
($.definition /.after
"Yields a binary BLOB with at most the specified number of bytes removed."
- [(after bytes binary)])
+ ($.example (after bytes binary)))
(all list#composite
..\\format
diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux
index e821b976c..0f2c5094f 100644
--- a/stdlib/source/documentation/lux/data/collection/array.lux
+++ b/stdlib/source/documentation/lux/data/collection/array.lux
@@ -28,72 +28,72 @@
($.definition /.empty
"An empty array of the specified size."
- [(empty size)])
+ ($.example (empty size)))
($.definition /.size
""
- [(size array)])
+ ($.example (size array)))
($.definition /.item
""
- [(item index array)])
+ ($.example (item index array)))
($.definition /.has!
"Mutate the array by writing a value to the specified index."
- [(has! index value array)])
+ ($.example (has! index value array)))
($.definition /.lacks!
"Mutate the array by deleting the value at the specified index."
- [(lacks! index array)])
+ ($.example (lacks! index array)))
($.definition /.has?
""
- [(has? index array)])
+ ($.example (has? index array)))
($.definition /.revised!
"Mutate the array by updating the value at the specified index."
- [(revised! index transform array)])
+ ($.example (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)])
+ ($.example (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)])
+ ($.example (copy! length src_start src_array dest_start dest_array)))
($.definition /.occupancy
"Finds out how many cells in an array are occupied."
- [(occupancy array)])
+ ($.example (occupancy array)))
($.definition /.vacancy
"Finds out how many cells in an array are vacant."
- [(vacancy array)])
+ ($.example (vacancy array)))
($.definition /.only!
"Delete every item of the array that fails to satisfy the predicate."
- [(only! p xs)])
+ ($.example (only! p xs)))
($.definition /.example
"Yields the first item in the array that satisfies the predicate."
- [(example p xs)])
+ ($.example (example p xs)))
($.definition /.example'
"Just like 'example', but with access to the index of each value."
- [(example' p xs)])
+ ($.example (example' p xs)))
($.definition /.clone
"Yields a shallow clone of the array."
- [(clone xs)])
+ ($.example (clone xs)))
($.definition /.of_list
""
- [(of_list xs)])
+ ($.example (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)])
+ ($.example (list {.#None} array))
+ ($.example (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 296d9f087..98e02080f 100644
--- a/stdlib/source/documentation/lux/data/collection/bits.lux
+++ b/stdlib/source/documentation/lux/data/collection/bits.lux
@@ -27,21 +27,21 @@
($.definition /.size
"Measures the size of a bit-map by counting all the 1s in the bit-map."
- [(size bits)])
+ ($.example (size bits)))
($.definition /.capacity
""
- [(capacity bits)])
+ ($.example (capacity bits)))
($.definition /.bit
""
- [(bit index bits)])
+ ($.example (bit index bits)))
($.definition /.intersects?
""
- [(intersects? reference sample)])
+ ($.example (intersects? reference sample)))
($.definition /.not
""
- [(not input)])
+ ($.example (not input)))
))
diff --git a/stdlib/source/documentation/lux/data/collection/dictionary.lux b/stdlib/source/documentation/lux/data/collection/dictionary.lux
index da8bd13e8..eaabd8c26 100644
--- a/stdlib/source/documentation/lux/data/collection/dictionary.lux
+++ b/stdlib/source/documentation/lux/data/collection/dictionary.lux
@@ -32,58 +32,58 @@
($.definition /.empty
"An empty dictionary."
- [(empty key_hash)])
+ ($.example (empty key_hash)))
($.definition /.has
""
- [(has key val dict)])
+ ($.example (has key val dict)))
($.definition /.lacks
""
- [(lacks key dict)])
+ ($.example (lacks key dict)))
($.definition /.value
""
- [(value key dict)])
+ ($.example (value key dict)))
($.definition /.key?
""
- [(key? dict key)])
+ ($.example (key? dict key)))
($.definition /.has'
"Only puts the KV-pair if the key is not already present."
- [(has' key val dict)])
+ ($.example (has' key val dict)))
($.definition /.revised
"Transforms the value located at key (if available), using the given function."
- [(revised key f dict)])
+ ($.example (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)])
+ ($.example (revised' key default f dict)))
($.definition /.of_list
""
- [(of_list key_hash kvs)])
+ ($.example (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)])
+ ($.example (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)])
+ ($.example (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)])
+ ($.example (re_bound from_key to_key dict)))
($.definition /.sub
"A sub-dictionary, with only the specified keys."
- [(sub keys dict)])
+ ($.example (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 d44fe0863..a9da85140 100644
--- a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux
@@ -27,15 +27,15 @@
($.definition /.empty
"An empty dictionary, employing the given order."
- [(empty order)])
+ ($.example (empty order)))
($.definition /.value
""
- [(value key dict)])
+ ($.example (value key dict)))
($.definition /.key?
""
- [(key? dict key)])
+ ($.example (key? dict key)))
(,, (with_template [<name>]
[(`` ($.definition <name>
@@ -47,21 +47,21 @@
($.definition /.size
""
- [(size dict)])
+ ($.example (size dict)))
($.definition /.has
""
- [(has key value dict)])
+ ($.example (has key value dict)))
($.definition /.lacks
""
- [(lacks key dict)])
+ ($.example (lacks key dict)))
($.definition /.revised
""
- [(revised key transform dict)])
+ ($.example (revised key transform dict)))
($.definition /.of_list
""
- [(of_list order list)])
+ ($.example (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 9726f5d39..8d75d3a63 100644
--- a/stdlib/source/documentation/lux/data/collection/list.lux
+++ b/stdlib/source/documentation/lux/data/collection/list.lux
@@ -14,17 +14,17 @@
(List $.Documentation)
(let [zipped (list ($.definition /.zipped
"Create list zippers with the specified number of input lists."
- [(def zipped_2 (zipped 2))
- (def zipped_3 (zipped 3))
- (zipped_3 xs ys zs)
- ((zipped 3) xs ys zs)])
+ ($.example (def zipped_2 (zipped 2)))
+ ($.example (def zipped_3 (zipped 3)))
+ ($.example (zipped_3 xs ys zs))
+ ($.example ((zipped 3) xs ys zs)))
($.definition /.zipped_with
"Create list zippers with the specified number of input lists."
- [(def zipped_with_2 (zipped_with 2))
- (def zipped_with_3 (zipped_with 3))
- (zipped_with_2 + xs ys)
- ((zipped_with 2) + xs ys)])
+ ($.example (def zipped_with_2 (zipped_with 2)))
+ ($.example (def zipped_with_3 (zipped_with 3)))
+ ($.example (zipped_with_2 + xs ys))
+ ($.example ((zipped_with 2) + xs ys)))
($.definition /.zipped_2)
($.definition /.zipped_3)
@@ -50,79 +50,79 @@
($.definition /.mixes
""
- [(mixes f init inputs)])
+ ($.example (mixes f init inputs)))
($.definition /.reversed
""
- [(reversed xs)])
+ ($.example (reversed xs)))
($.definition /.only
"A list with only values that satisfy the predicate."
- [(only keep? xs)])
+ ($.example (only keep? xs)))
($.definition /.partition
"Divide the list into all elements that satisfy a predicate, and all elements that do not."
- [(partition satisfies? list)])
+ ($.example (partition satisfies? list)))
($.definition /.pairs
"Cut the list into pairs of 2."
- [(pairs list)])
+ ($.example (pairs list)))
($.definition /.split_at
""
- [(split_at n xs)])
+ ($.example (split_at n xs)))
($.definition /.split_when
"Segment the list by using a predicate to tell when to cut."
- [(split_when predicate xs)])
+ ($.example (split_when predicate xs)))
($.definition /.sub
"Segment the list into sub-lists of (at most) the given size."
- [(sub size list)])
+ ($.example (sub size list)))
($.definition /.repeated
"A list of the value x, repeated n times."
- [(repeated n x)])
+ ($.example (repeated n x)))
($.definition /.iterations
"Generates a list element by element until the function returns .#None."
- [(iterations f x)])
+ ($.example (iterations f x)))
($.definition /.one
""
- [(one check xs)])
+ ($.example (one check xs)))
($.definition /.all
""
- [(all check xs)])
+ ($.example (all check xs)))
($.definition /.example
"Yields the first value in the list that satisfies the predicate."
- [(example predicate xs)])
+ ($.example (example predicate xs)))
($.definition /.interposed
"Puts a value between every two elements in the list."
- [(interposed sep xs)])
+ ($.example (interposed sep xs)))
($.definition /.size
""
- [(size list)])
+ ($.example (size list)))
($.definition /.item
"Fetches the element at the specified index."
- [(item i xs)])
+ ($.example (item i xs)))
($.definition /.sorted
"A list ordered by a comparison function."
- [(sorted < xs)])
+ ($.example (sorted < xs)))
($.definition /.empty?
""
- [(empty? xs)])
+ ($.example (empty? xs)))
($.definition /.member?
""
- [(member? eq xs x)])
+ ($.example (member? eq xs x)))
(,, (with_template [<name> <doc>]
[($.definition <name>
@@ -134,38 +134,38 @@
($.definition /.indices
"Produces all the valid indices for a given size."
- [(indices size)])
+ ($.example (indices size)))
($.definition /.last
""
- [(last xs)])
+ ($.example (last xs)))
($.definition /.inits
(format "For a list of size N, yields the first N-1 elements."
\n "Will yield a .#None for empty lists.")
- [(inits xs)])
+ ($.example (inits xs)))
($.definition /.together
"The sequential combination of all the lists.")
($.definition /.with
"Enhances a monad with List functionality."
- [(with monad)])
+ ($.example (with monad)))
($.definition /.lifted
"Wraps a monadic value with List machinery."
- [(lifted monad)])
+ ($.example (lifted monad)))
($.definition /.enumeration
"Pairs every element in the list with its index, starting at 0."
- [(enumeration xs)])
+ ($.example (enumeration xs)))
($.definition /.when
"Can be used as a guard in (co)monadic be/do expressions."
- [(do monad
- [value (do_something 1 2 3)
- .when (passes_test? value)]
- (do_something_else 4 5 6))])
+ ($.example (do monad
+ [value (do_something 1 2 3)
+ .when (passes_test? value)]
+ (do_something_else 4 5 6))))
(all /#composite
zipped
diff --git a/stdlib/source/documentation/lux/data/collection/list/property.lux b/stdlib/source/documentation/lux/data/collection/list/property.lux
index c2d694d62..faa7a79a1 100644
--- a/stdlib/source/documentation/lux/data/collection/list/property.lux
+++ b/stdlib/source/documentation/lux/data/collection/list/property.lux
@@ -26,21 +26,21 @@
($.definition /.value
""
- [(value key properties)])
+ ($.example (value key properties)))
($.definition /.contains?
""
- [(contains? key properties)])
+ ($.example (contains? key properties)))
($.definition /.has
""
- [(has key val properties)])
+ ($.example (has key val properties)))
($.definition /.revised
""
- [(revised key f properties)])
+ ($.example (revised key f properties)))
($.definition /.lacks
""
- [(lacks key properties)])
+ ($.example (lacks key properties)))
))
diff --git a/stdlib/source/documentation/lux/data/collection/queue.lux b/stdlib/source/documentation/lux/data/collection/queue.lux
index 44dd7f209..87d5bf4db 100644
--- a/stdlib/source/documentation/lux/data/collection/queue.lux
+++ b/stdlib/source/documentation/lux/data/collection/queue.lux
@@ -26,26 +26,26 @@
($.definition /.of_list
""
- [(of_list entries)])
+ ($.example (of_list entries)))
($.definition /.list
""
- [(list queue)])
+ ($.example (list queue)))
($.definition /.front
"Yields the first value in the queue, if any.")
($.definition /.member?
""
- [(member? equivalence queue member)])
+ ($.example (member? equivalence queue member)))
($.definition /.next
""
- [(next queue)])
+ ($.example (next queue)))
($.definition /.end
""
- [(end val queue)])
+ ($.example (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 e08056fe3..8a61d7122 100644
--- a/stdlib/source/documentation/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/documentation/lux/data/collection/queue/priority.lux
@@ -22,9 +22,9 @@
($.definition /.member?
""
- [(member? equivalence queue member)])
+ ($.example (member? equivalence queue member)))
($.definition /.end
""
- [(end priority value queue)])
+ ($.example (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 5dbbe420f..0d6e71629 100644
--- a/stdlib/source/documentation/lux/data/collection/sequence.lux
+++ b/stdlib/source/documentation/lux/data/collection/sequence.lux
@@ -30,38 +30,38 @@
($.definition /.suffix
""
- [(suffix val sequence)])
+ ($.example (suffix val sequence)))
($.definition /.within_bounds?
"Determines whether the index is within the bounds of the sequence."
- [(within_bounds? sequence idx)])
+ ($.example (within_bounds? sequence idx)))
($.definition /.item
""
- [(item idx sequence)])
+ ($.example (item idx sequence)))
($.definition /.has
""
- [(has idx val sequence)])
+ ($.example (has idx val sequence)))
($.definition /.revised
""
- [(revised idx f sequence)])
+ ($.example (revised idx f sequence)))
($.definition /.prefix
""
- [(prefix sequence)])
+ ($.example (prefix sequence)))
($.definition /.list
""
- [(list sequence)])
+ ($.example (list sequence)))
($.definition /.member?
""
- [(member? equivalence sequence val)])
+ ($.example (member? equivalence sequence val)))
($.definition /.sequence
"Sequence literals."
- [(is (Sequence Nat)
- (sequence 12 34 56 78 90))])
+ ($.example (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 94ad8e8d9..f9033964f 100644
--- a/stdlib/source/documentation/lux/data/collection/set.lux
+++ b/stdlib/source/documentation/lux/data/collection/set.lux
@@ -35,23 +35,23 @@
($.definition /.has
""
- [(has elem set)])
+ ($.example (has elem set)))
($.definition /.difference
""
- [(difference sub base)])
+ ($.example (difference sub base)))
($.definition /.intersection
""
- [(intersection filter base)])
+ ($.example (intersection filter base)))
($.definition /.sub?
""
- [(sub? super sub)])
+ ($.example (sub? super sub)))
($.definition /.super?
""
- [(super? sub super)])
+ ($.example (super? sub super)))
(all list#composite
/multi.documentation
diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux
index 8c84efe56..1f9cd1e98 100644
--- a/stdlib/source/documentation/lux/data/collection/set/multi.lux
+++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux
@@ -31,27 +31,27 @@
($.definition /.has
""
- [(has multiplicity elem set)])
+ ($.example (has multiplicity elem set)))
($.definition /.lacks
""
- [(lacks multiplicity elem set)])
+ ($.example (lacks multiplicity elem set)))
($.definition /.multiplicity
""
- [(multiplicity set elem)])
+ ($.example (multiplicity set elem)))
($.definition /.sub?
"Is 'subject' a sub-set of 'reference'?"
- [(sub? reference subject)])
+ ($.example (sub? reference subject)))
($.definition /.support
"A set of the unique (non repeated) members."
- [(support set)])
+ ($.example (support set)))
($.definition /.member?
""
- [(member? set elem)])
+ ($.example (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 82f29e9d9..d3abe10a4 100644
--- a/stdlib/source/documentation/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux
@@ -29,25 +29,25 @@
($.definition /.member?
""
- [(member? set elem)])
+ ($.example (member? set elem)))
($.definition /.has
""
- [(has elem set)])
+ ($.example (has elem set)))
($.definition /.lacks
""
- [(lacks elem set)])
+ ($.example (lacks elem set)))
($.definition /.difference
""
- [(difference param subject)])
+ ($.example (difference param subject)))
($.definition /.sub?
"Is 'sub' a sub-set of 'super'?"
- [(sub? super sub)])
+ ($.example (sub? super sub)))
($.definition /.super?
"Is 'super' a super-set of 'sub'?"
- [(super? sub super)])
+ ($.example (super? sub super)))
))
diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux
index e882391c7..9364c54c0 100644
--- a/stdlib/source/documentation/lux/data/collection/stack.lux
+++ b/stdlib/source/documentation/lux/data/collection/stack.lux
@@ -24,13 +24,13 @@
($.definition /.value
"Yields the top value in the stack, if any."
- [(value stack)])
+ ($.example (value stack)))
($.definition /.next
""
- [(next stack)])
+ ($.example (next stack)))
($.definition /.top
""
- [(top value stack)])
+ ($.example (top value stack)))
))
diff --git a/stdlib/source/documentation/lux/data/collection/stream.lux b/stdlib/source/documentation/lux/data/collection/stream.lux
index d32960d0d..cef25618b 100644
--- a/stdlib/source/documentation/lux/data/collection/stream.lux
+++ b/stdlib/source/documentation/lux/data/collection/stream.lux
@@ -29,33 +29,33 @@
($.definition /.iterations
"A stateful way of infinitely calculating the values of a stream."
- [(iterations step init)])
+ ($.example (iterations step init)))
($.definition /.repeated
"Repeat a value forever."
- [(repeated x)])
+ ($.example (repeated x)))
($.definition /.cycle
"Go over the elements of a list forever."
- [(cycle [start next])])
+ ($.example (cycle [start next])))
($.definition /.item
""
- [(item idx stream)])
+ ($.example (item idx stream)))
($.definition /.only
"A new stream only with items that satisfy the predicate."
- [(only predicate stream)])
+ ($.example (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)])
+ ($.example (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))])
+ ($.example (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 ef03b419c..35108c6c5 100644
--- a/stdlib/source/documentation/lux/data/collection/tree.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree.lux
@@ -26,11 +26,11 @@
($.definition \\parser.result'
"Applies the parser against a tree zipper."
- [(result' parser zipper)])
+ ($.example (result' parser zipper)))
($.definition \\parser.result
"Applies the parser against a tree."
- [(result parser tree)])
+ ($.example (result parser tree)))
($.definition \\parser.value
"Yields the value inside the current tree node.")
@@ -70,23 +70,23 @@
($.definition /.flat
"All the leaf values of the tree, in order."
- [(flat tree)])
+ ($.example (flat tree)))
($.definition /.leaf
""
- [(leaf value)])
+ ($.example (leaf value)))
($.definition /.branch
""
- [(branch value children)])
+ ($.example (branch value children)))
($.definition /.tree
"Tree literals."
- [(is (Tree Nat)
- (tree 12
- {34 {}
- 56 {}
- 78 {90 {}}}))])
+ ($.example (is (Tree Nat)
+ (tree 12
+ {34 {}
+ 56 {}
+ 78 {90 {}}}))))
(all list#composite
..\\parser
diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux
index dacba465b..08ca4d639 100644
--- a/stdlib/source/documentation/lux/data/collection/tree/finger.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux
@@ -24,25 +24,25 @@
($.definition /.builder
"A new builder using the given monoid."
- [(builder monoid)])
+ ($.example (builder monoid)))
($.definition /.value
""
- [(value tree)])
+ ($.example (value tree)))
($.definition /.tags
""
- [(tags tree)])
+ ($.example (tags tree)))
($.definition /.values
""
- [(values tree)])
+ ($.example (values tree)))
($.definition /.one
"Finds one value that meets the predicate."
- [(one predicate tree)])
+ ($.example (one predicate tree)))
($.definition /.exists?
"Verifies that a value exists which meets the predicate."
- [(exists? predicate tree)])
+ ($.example (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 052f816fb..c4a3d730c 100644
--- a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux
@@ -42,17 +42,17 @@
($.definition /.set
""
- [(set value zipper)])
+ ($.example (set value zipper)))
($.definition /.update
""
- [(update transform zipper)])
+ ($.example (update transform zipper)))
($.definition /.interpose
""
- [(interpose value zipper)])
+ ($.example (interpose value zipper)))
($.definition /.adopt
""
- [(adopt value zipper)])
+ ($.example (adopt value zipper)))
))
diff --git a/stdlib/source/documentation/lux/data/color.lux b/stdlib/source/documentation/lux/data/color.lux
index a1ffc67fb..77162cec2 100644
--- a/stdlib/source/documentation/lux/data/color.lux
+++ b/stdlib/source/documentation/lux/data/color.lux
@@ -55,11 +55,11 @@
($.definition /.complement
"The opposite color."
- [(complement color)])
+ ($.example (complement color)))
($.definition /.interpolated
""
- [(interpolated ratio end start)]))
+ ($.example (interpolated ratio end start))))
alpha (list ($.definition /.Alpha
"The degree of transparency of a pigment.")
@@ -76,11 +76,11 @@
($.definition /.analogous
(palette_documentation /.analogous)
- [(analogous spread variations color)])
+ ($.example (analogous spread variations color)))
($.definition /.monochromatic
(palette_documentation /.monochromatic)
- [(monochromatic spread variations color)])
+ ($.example (monochromatic spread variations color)))
(,, (with_template [<name>]
[(`` ($.definition <name>
diff --git a/stdlib/source/documentation/lux/data/format/json.lux b/stdlib/source/documentation/lux/data/format/json.lux
index 48a62f2e0..b65139927 100644
--- a/stdlib/source/documentation/lux/data/format/json.lux
+++ b/stdlib/source/documentation/lux/data/format/json.lux
@@ -30,7 +30,7 @@
($.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)])
+ ($.example (result parser json)))
($.definition \\parser.any
"Just returns the JSON input without applying any logic.")
@@ -58,21 +58,21 @@
($.definition \\parser.nullable
"Enhances parser by adding NULL-handling."
- [(nullable parser)])
+ ($.example (nullable parser)))
($.definition \\parser.array
"Parses the contents of a JSON array."
- [(array parser)])
+ ($.example (array parser)))
($.definition \\parser.object
(format "Parses the contents of a JSON object."
\n "Use this with the 'field' combinator.")
- [(object parser)])
+ ($.example (object parser)))
($.definition \\parser.field
(format "Parses a field inside a JSON object."
\n "Use this inside the 'object' combinator.")
- [(field field_name parser)])
+ ($.example (field field_name parser)))
($.definition \\parser.dictionary
"Parses a dictionary-like JSON object.")
@@ -99,30 +99,35 @@
($.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"})])
+ ($.comment "null")
+ ($.example (json #null))
+
+ ($.comment "true")
+ ($.example (json #1))
+
+ ($.comment "123.456")
+ ($.example (json +123.456))
+
+ ($.comment "'this is a string'")
+ ($.example (json "this is a string"))
+
+ ($.comment "['this' 'is' 'an' 'array']")
+ ($.example (json ["this" "is" "an" "array"]))
+
+ ($.comment "{'this' 'is', 'an' 'object'}")
+ ($.example (json {"this" "is" "an" "object"})))
($.definition /.fields
"Get all the fields in a JSON object."
- [(fields json)])
+ ($.example (fields json)))
($.definition /.field
"A JSON object field getter."
- [(field key json)])
+ ($.example (field key json)))
($.definition /.has
"A JSON object field setter."
- [(has key value json)])
+ ($.example (has key value json)))
(,, (with_template [<name> <desc>]
[($.definition <name>
diff --git a/stdlib/source/documentation/lux/data/format/xml.lux b/stdlib/source/documentation/lux/data/format/xml.lux
index 22c80ea1f..2803820b5 100644
--- a/stdlib/source/documentation/lux/data/format/xml.lux
+++ b/stdlib/source/documentation/lux/data/format/xml.lux
@@ -29,7 +29,7 @@
($.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)])
+ ($.example (result parser documents)))
($.definition \\parser.text
"Yields text from a text node.")
@@ -39,18 +39,18 @@
($.definition \\parser.attribute
"Yields the value of an attribute in the current node."
- [(attribute name)])
+ ($.example (attribute name)))
($.definition \\parser.node
"Parses the contents of the next node if the tag matches."
- [(node expected parser)])
+ ($.example (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)])
+ ($.example (somewhere parser)))
))
(def .public documentation
@@ -70,7 +70,7 @@
($.definition /.tag
"The text format of a XML tag."
- [(tag name)])
+ ($.example (tag name)))
($.definition /.attribute
"The text format of a XML attribute.")
diff --git a/stdlib/source/documentation/lux/data/product.lux b/stdlib/source/documentation/lux/data/product.lux
index a589fdd9c..cde31272a 100644
--- a/stdlib/source/documentation/lux/data/product.lux
+++ b/stdlib/source/documentation/lux/data/product.lux
@@ -24,21 +24,21 @@
($.definition /.curried
"Converts a 2-argument function into nested single-argument functions."
- [(curried f)])
+ ($.example (curried f)))
($.definition /.uncurried
"Converts nested single-argument functions into a 2-argument function."
- [(uncurried f)])
+ ($.example (uncurried f)))
($.definition /.swapped
""
- [(swapped [left right])])
+ ($.example (swapped [left right])))
($.definition /.then
"Apply functions to both sides of a pair."
- [(then f g)])
+ ($.example (then f g)))
($.definition /.forked
"Yields a pair by applying both functions to a single value."
- [(forked f g)])
+ ($.example (forked f g)))
))
diff --git a/stdlib/source/documentation/lux/data/sum.lux b/stdlib/source/documentation/lux/data/sum.lux
index 973522394..be67f1bf4 100644
--- a/stdlib/source/documentation/lux/data/sum.lux
+++ b/stdlib/source/documentation/lux/data/sum.lux
@@ -27,9 +27,9 @@
($.definition /.either
"Applies a function to either side of a 2-variant."
- [(either on_left on_right)])
+ ($.example (either on_left on_right)))
($.definition /.then
"Applies functions to both sides of a 2-variant."
- [(then on_left on_right)])
+ ($.example (then on_left on_right)))
))
diff --git a/stdlib/source/documentation/lux/data/text.lux b/stdlib/source/documentation/lux/data/text.lux
index c544cc551..13ecdeaff 100644
--- a/stdlib/source/documentation/lux/data/text.lux
+++ b/stdlib/source/documentation/lux/data/text.lux
@@ -73,7 +73,7 @@
($.definition \\format.format
"Text interpolation."
- [(format "Static part " (text static) " does not match URI: " uri)])
+ ($.example (format "Static part " (text static) " does not match URI: " uri)))
(all list#composite
specific
@@ -93,7 +93,7 @@
($.definition \\parser.character_does_not_satisfy_predicate))
specific (list ($.definition \\parser.range
"Only yields characters within a range."
- [(range bottom top)])
+ ($.example (range bottom top)))
(,, (with_template [<name> <desc>]
[($.definition <name>
@@ -131,7 +131,7 @@
($.definition \\parser.result
(format "Executes a parser against a block of text."
\n "Verifies that the entire input has been processed.")
- [(result parser input)])
+ ($.example (result parser input)))
($.definition \\parser.offset
"Yields the current offset into the input.")
@@ -152,7 +152,7 @@
($.definition \\parser.this
"Checks that a specific text shows up in the input."
- [(this reference)])
+ ($.example (this reference)))
($.definition \\parser.end
"Ensure the parser's input is empty.")
@@ -181,15 +181,15 @@
($.definition \\parser.satisfies
"Yields characters that satisfy a predicate."
- [(satisfies parser)])
+ ($.example (satisfies parser)))
($.definition \\parser.and
"Yields the outputs of both parsers composed together."
- [(and left right)])
+ ($.example (and left right)))
($.definition \\parser.and!
"Yields the outputs of both parsers composed together (as a slice)."
- [(and! left right)])
+ ($.example (and! left right)))
(,, (with_template [<text> <slice>]
[(`` ($.definition <text>
@@ -214,27 +214,27 @@
($.definition \\parser.between
""
- [(between minimum additional parser)])
+ ($.example (between minimum additional parser)))
($.definition \\parser.between!
""
- [(between! minimum additional parser)])
+ ($.example (between! minimum additional parser)))
($.definition \\parser.enclosed
""
- [(enclosed [start end] parser)])
+ ($.example (enclosed [start end] parser)))
($.definition \\parser.local
"Applies a parser against the given input."
- [(local local_input parser)])
+ ($.example (local local_input parser)))
($.definition \\parser.slice
"Converts a slice to a block of text."
- [(slice parser)])
+ ($.example (slice parser)))
($.definition \\parser.then
"Embeds a text parser into an arbitrary parser that yields text."
- [(then structured text)])
+ ($.example (then structured text)))
(all list#composite
exception
@@ -244,14 +244,14 @@
(def .public documentation
(List $.Documentation)
- (let [character (list ($.definition /.Char
- "A character code number.")
+ (let [character (list ... ($.definition /.Char
+ ... "A character code number.")
- ($.definition /.char
- "Yields the character at the specified index."
- [(char index input)])
+ ... ($.definition /.char
+ ... "Yields the character at the specified index."
+ ... ($.example (char index input)))
- ($.definition /.of_char)
+ ... ($.definition /.of_char)
($.definition /.\0)
($.definition /.null)
@@ -280,23 +280,23 @@
($.definition /.starts_with?
""
- [(starts_with? prefix x)])
+ ($.example (starts_with? prefix x)))
($.definition /.ends_with?
""
- [(ends_with? postfix x)])
+ ($.example (ends_with? postfix x)))
($.definition /.enclosed_by?
""
- [(enclosed_by? boundary value)])
+ ($.example (enclosed_by? boundary value)))
($.definition /.contains?
""
- [(contains? sub text)])
+ ($.example (contains? sub text)))
($.definition /.space?
"Checks whether the character is white-space."
- [(space? char)]))]
+ ($.example (space? char))))]
(list.partial ($.module /._
"")
@@ -313,63 +313,63 @@
($.definition /.index_since
""
- [(index_since from pattern input)])
+ ($.example (index_since from pattern input)))
($.definition /.index
""
- [(index pattern input)])
+ ($.example (index pattern input)))
($.definition /.last_index
""
- [(last_index part text)])
+ ($.example (last_index part text)))
($.definition /.prefix
""
- [(prefix param subject)])
+ ($.example (prefix param subject)))
($.definition /.suffix
""
- [(suffix param subject)])
+ ($.example (suffix param subject)))
($.definition /.enclosed
"Surrounds the given content text with left and right side additions."
- [(enclosed [left right] content)])
+ ($.example (enclosed [left right] content)))
($.definition /.enclosed'
"Surrounds the given content text with the same boundary text."
- [(enclosed' boundary content)])
+ ($.example (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)])
+ ($.example (clip offset size input)))
($.definition /.clip_since
"Clips the remaining text from the input at the specified offset."
- [(clip_since offset input)])
+ ($.example (clip_since offset input)))
($.definition /.split_at
""
- [(split_at at x)])
+ ($.example (split_at at x)))
($.definition /.split_by
""
- [(split_by token sample)])
+ ($.example (split_by token sample)))
($.definition /.all_split_by
""
- [(all_split_by token sample)])
+ ($.example (all_split_by token sample)))
($.definition /.replaced_once
""
- [(replaced_once pattern replacement template)])
+ ($.example (replaced_once pattern replacement template)))
($.definition /.replaced
""
- [(replaced pattern replacement template)])
+ ($.example (replaced pattern replacement template)))
($.definition /.interposed
""
- [(interposed separator texts)])
+ ($.example (interposed separator texts)))
(all list#composite
character
diff --git a/stdlib/source/documentation/lux/data/text/escape.lux b/stdlib/source/documentation/lux/data/text/escape.lux
index 5b85c8359..cd3ded777 100644
--- a/stdlib/source/documentation/lux/data/text/escape.lux
+++ b/stdlib/source/documentation/lux/data/text/escape.lux
@@ -20,17 +20,17 @@
($.definition /.escaped
"Yields a escaped version of the text."
- [(escaped text)])
+ ($.example (escaped text)))
($.definition /.un_escaped
(format "Yields an un-escaped text."
\n "Fails if it was improperly escaped.")
- [(un_escaped text)])
+ ($.example (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")])
+ ($.example (/.literal "Line 1\nLine 2"))
+ ($.comment "=>")
+ ($.example (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 8de3d70e7..cd785ab77 100644
--- a/stdlib/source/documentation/lux/data/text/regex.lux
+++ b/stdlib/source/documentation/lux/data/text/regex.lux
@@ -17,60 +17,72 @@
($.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 "(?<code>\d{3})-\k<code>-(\d{4})")
- (regex "(?<code>\d{3})-\k<code>-(\d{4})-\0")
- (regex "(\d{3})-((\d{3})-(\d{4}))")]
- ["Alternation"
- (regex "a|b")
- (regex "a(.)(.)|b(.)(.)")])
+
+ ($.comment "Literals")
+ ($.example (regex "a"))
+
+ ($.comment "Wildcards")
+ ($.example (regex "."))
+
+ ($.comment "Escaping")
+ ($.example (regex "\."))
+
+ ($.comment "Character classes")
+ ($.example (regex "\d"))
+ ($.example (regex "\p{Lower}"))
+ ($.example (regex "[abc]"))
+ ($.example (regex "[a-z]"))
+ ($.example (regex "[a-zA-Z]"))
+ ($.example (regex "[a-z&&[def]]"))
+
+ ($.comment "Negation")
+ ($.example (regex "[^abc]"))
+ ($.example (regex "[^a-z]"))
+ ($.example (regex "[^a-zA-Z]"))
+ ($.example (regex "[a-z&&[^bc]]"))
+ ($.example (regex "[a-z&&[^m-p]]"))
+
+ ($.comment "Combinations")
+ ($.example (regex "aa"))
+ ($.example (regex "a?"))
+ ($.example (regex "a*"))
+ ($.example (regex "a+"))
+
+ ($.comment "Specific amounts")
+ ($.example (regex "a{2}"))
+
+ ($.comment "At least")
+ ($.example (regex "a{1,}"))
+
+ ($.comment "At most")
+ ($.example (regex "a{,1}"))
+
+ ($.comment "Between")
+ ($.example (regex "a{1,2}"))
+
+ ($.comment "Groups")
+ ($.example (regex "a(.)c"))
+ ($.example (regex "a(b+)c"))
+ ($.example (regex "(\d{3})-(\d{3})-(\d{4})"))
+ ($.example (regex "(\d{3})-(?:\d{3})-(\d{4})"))
+ ($.example (regex "(?<code>\d{3})-\k<code>-(\d{4})"))
+ ($.example (regex "(?<code>\d{3})-\k<code>-(\d{4})-\0"))
+ ($.example (regex "(\d{3})-((\d{3})-(\d{4}))"))
+
+ ($.comment "Alternation")
+ ($.example (regex "a|b"))
+ ($.example (regex "a(.)(.)|b(.)(.)")))
($.definition /.pattern
"Allows you to test text against regular expressions."
- [(when some_text
- (pattern "(\d{3})-(\d{3})-(\d{4})"
- [_ country_code area_code place_code])
- do_some_thing_when_number
+ ($.example (when some_text
+ (pattern "(\d{3})-(\d{3})-(\d{4})"
+ [_ country_code area_code place_code])
+ do_some_thing_when_number
- (pattern "\w+")
- do_some_thing_when_word
+ (pattern "\w+")
+ do_some_thing_when_word
- _
- do_something_else)])
+ _
+ do_something_else)))
))
diff --git a/stdlib/source/documentation/lux/data/text/unicode/block.lux b/stdlib/source/documentation/lux/data/text/unicode/block.lux
index 78002e97c..667c66fef 100644
--- a/stdlib/source/documentation/lux/data/text/unicode/block.lux
+++ b/stdlib/source/documentation/lux/data/text/unicode/block.lux
@@ -179,11 +179,11 @@
($.definition /.block
""
- [(block start additional)])
+ ($.example (block start additional)))
($.definition /.within?
""
- [(within? block char)])
+ ($.example (within? block char)))
(all list#composite
all_1/4
diff --git a/stdlib/source/documentation/lux/data/text/unicode/set.lux b/stdlib/source/documentation/lux/data/text/unicode/set.lux
index 68fbb3446..6d75868c5 100644
--- a/stdlib/source/documentation/lux/data/text/unicode/set.lux
+++ b/stdlib/source/documentation/lux/data/text/unicode/set.lux
@@ -31,9 +31,9 @@
($.definition /.set
""
- [(set [head tail])])
+ ($.example (set [head tail])))
($.definition /.member?
""
- [(member? set character)])
+ ($.example (member? set character)))
))