aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/documentation/lux.lux16
-rw-r--r--stdlib/source/documentation/lux/abstract/apply.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/codec.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/comonad.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/comonad/cofree.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/enum.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/equivalence.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/functor.lux10
-rw-r--r--stdlib/source/documentation/lux/abstract/functor/contravariant.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/hash.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/interval.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/mix.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/monad.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/monad/free.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/monoid.lux2
-rw-r--r--stdlib/source/documentation/lux/abstract/order.lux6
-rw-r--r--stdlib/source/documentation/lux/abstract/predicate.lux2
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/actor.lux10
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/async.lux4
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/atom.lux2
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/frp.lux6
-rw-r--r--stdlib/source/documentation/lux/control/concurrency/stm.lux4
-rw-r--r--stdlib/source/documentation/lux/control/continuation.lux2
-rw-r--r--stdlib/source/documentation/lux/control/exception.lux2
-rw-r--r--stdlib/source/documentation/lux/control/function/memo.lux2
-rw-r--r--stdlib/source/documentation/lux/control/function/mixin.lux4
-rw-r--r--stdlib/source/documentation/lux/control/io.lux2
-rw-r--r--stdlib/source/documentation/lux/control/lazy.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/analysis.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/binary.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/cli.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/code.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/environment.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/json.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/synthesis.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/text.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/tree.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/type.lux2
-rw-r--r--stdlib/source/documentation/lux/control/parser/xml.lux2
-rw-r--r--stdlib/source/documentation/lux/control/reader.lux2
-rw-r--r--stdlib/source/documentation/lux/control/region.lux2
-rw-r--r--stdlib/source/documentation/lux/control/security/capability.lux2
-rw-r--r--stdlib/source/documentation/lux/control/security/policy.lux12
-rw-r--r--stdlib/source/documentation/lux/control/state.lux2
-rw-r--r--stdlib/source/documentation/lux/control/thread.lux4
-rw-r--r--stdlib/source/documentation/lux/control/try.lux2
-rw-r--r--stdlib/source/documentation/lux/control/writer.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/array.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/dictionary.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/dictionary/plist.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/queue.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/queue/priority.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/row.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/sequence.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/set.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/set/multi.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/set/ordered.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/stack.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree.lux2
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree/finger.lux4
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree/zipper.lux2
-rw-r--r--stdlib/source/documentation/lux/data/format/binary.lux2
-rw-r--r--stdlib/source/documentation/lux/data/identity.lux2
-rw-r--r--stdlib/source/documentation/lux/data/text/format.lux2
-rw-r--r--stdlib/source/documentation/lux/ffi.rb.lux2
-rw-r--r--stdlib/source/documentation/lux/math/logic/fuzzy.lux2
-rw-r--r--stdlib/source/documentation/lux/math/modular.lux2
-rw-r--r--stdlib/source/documentation/lux/math/modulus.lux2
-rw-r--r--stdlib/source/documentation/lux/math/number/i64.lux2
-rw-r--r--stdlib/source/documentation/lux/math/random.lux2
-rw-r--r--stdlib/source/documentation/lux/meta.lux2
-rw-r--r--stdlib/source/documentation/lux/type/check.lux2
-rw-r--r--stdlib/source/documentation/lux/type/quotient.lux4
-rw-r--r--stdlib/source/documentation/lux/type/refinement.lux4
-rw-r--r--stdlib/source/documentation/lux/type/resource.lux12
-rw-r--r--stdlib/source/documentation/lux/type/unit.lux6
-rw-r--r--stdlib/source/documentation/lux/type/variance.lux6
-rw-r--r--stdlib/source/documentation/lux/world/console.lux4
-rw-r--r--stdlib/source/documentation/lux/world/file.lux2
-rw-r--r--stdlib/source/documentation/lux/world/file/watch.lux2
-rw-r--r--stdlib/source/documentation/lux/world/net/http/client.lux2
-rw-r--r--stdlib/source/documentation/lux/world/program.lux2
-rw-r--r--stdlib/source/documentation/lux/world/shell.lux6
-rw-r--r--stdlib/source/library/lux/data/format/markdown.lux13
-rw-r--r--stdlib/source/library/lux/documentation.lux224
-rw-r--r--stdlib/source/library/lux/type/abstract.lux5
-rw-r--r--stdlib/source/library/lux/type/variance.lux12
-rw-r--r--stdlib/source/program/scriptum.lux224
90 files changed, 458 insertions, 276 deletions
diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux
index 712814250..b7f1025ad 100644
--- a/stdlib/source/documentation/lux.lux
+++ b/stdlib/source/documentation/lux.lux
@@ -54,13 +54,13 @@
(format "The type of things whose type is undefined."
\n "Useful for expressions that cause errors or other 'extraordinary' conditions."))
-(documentation: /.List
+(documentation: (/.List item)
"A potentially empty list of values.")
(documentation: /.Bit
"Your standard, run-of-the-mill boolean values (as #0 or #1 bits).")
-(documentation: /.I64
+(documentation: (/.I64 kind)
"64-bit integers without any semantics.")
(documentation: /.Nat
@@ -83,7 +83,7 @@
(documentation: /.Name
"A name. It is used as part of Lux syntax to represent identifiers and tags.")
-(documentation: /.Maybe
+(documentation: (/.Maybe value)
"A potentially missing value.")
(documentation: /.Type
@@ -92,7 +92,7 @@
(documentation: /.Location
"Locations are for specifying the location of Code nodes in Lux files during compilation.")
-(documentation: /.Ann
+(documentation: (/.Ann meta_data datum)
"The type of things that can be annotated with meta-data of arbitrary types.")
(documentation: /.Code
@@ -116,7 +116,7 @@
(documentation: /.Global
"Represents all the data associated with a global constant.")
-(documentation: /.Either
+(documentation: (/.Either left right)
"A choice between two values of different types.")
(documentation: /.Module
@@ -133,7 +133,7 @@
\n "It is provided to macros during their invocation, so they can access compiler data."
\n "Caveat emptor: Avoid fiddling with it, unless you know what you're doing."))
-(documentation: /.Meta
+(documentation: (/.Meta it)
(format "Computations that can have access to the state of the compiler."
\n "These computations may fail, or modify the state of the compiler."))
@@ -1020,9 +1020,9 @@
..true
..:let
..try
- ($.default /.Code')
+ ($.default (/.Code' w))
($.default /.Alias)
- ($.default /.Bindings)
+ ($.default (/.Bindings key value))
($.default /.Ref)
($.default /.Scope)
($.default /.Source)
diff --git a/stdlib/source/documentation/lux/abstract/apply.lux b/stdlib/source/documentation/lux/abstract/apply.lux
index 0ba31d5a4..66c64dcc5 100644
--- a/stdlib/source/documentation/lux/abstract/apply.lux
+++ b/stdlib/source/documentation/lux/abstract/apply.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.Apply
+(documentation: (/.Apply f)
"Applicative functors.")
(documentation: /.composite
diff --git a/stdlib/source/documentation/lux/abstract/codec.lux b/stdlib/source/documentation/lux/abstract/codec.lux
index d4f3dbeb0..d75e972a5 100644
--- a/stdlib/source/documentation/lux/abstract/codec.lux
+++ b/stdlib/source/documentation/lux/abstract/codec.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.Codec
+(documentation: (/.Codec medium value)
"A way to move back-and-forth between a type and an alternative representation for it.")
(documentation: /.composite
diff --git a/stdlib/source/documentation/lux/abstract/comonad.lux b/stdlib/source/documentation/lux/abstract/comonad.lux
index 5ae976a63..e9c018983 100644
--- a/stdlib/source/documentation/lux/abstract/comonad.lux
+++ b/stdlib/source/documentation/lux/abstract/comonad.lux
@@ -10,7 +10,7 @@
["." / #_
["#." cofree]])
-(documentation: /.CoMonad
+(documentation: (/.CoMonad !)
(format "Co-monads are the opposite/complement to monads."
\n "Co-monadic structures are often infinite in size and built upon lazily-evaluated functions."))
diff --git a/stdlib/source/documentation/lux/abstract/comonad/cofree.lux b/stdlib/source/documentation/lux/abstract/comonad/cofree.lux
index 2330b5c78..5f4cd6bff 100644
--- a/stdlib/source/documentation/lux/abstract/comonad/cofree.lux
+++ b/stdlib/source/documentation/lux/abstract/comonad/cofree.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.CoFree
+(documentation: (/.CoFree ! it)
"The CoFree CoMonad.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/abstract/enum.lux b/stdlib/source/documentation/lux/abstract/enum.lux
index 779b97a77..1ce302002 100644
--- a/stdlib/source/documentation/lux/abstract/enum.lux
+++ b/stdlib/source/documentation/lux/abstract/enum.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.Enum
+(documentation: (/.Enum it)
"Enumerable types, with a notion of moving forward and backwards through a type's instances.")
(documentation: /.range
diff --git a/stdlib/source/documentation/lux/abstract/equivalence.lux b/stdlib/source/documentation/lux/abstract/equivalence.lux
index fb393d7c9..88645d7ac 100644
--- a/stdlib/source/documentation/lux/abstract/equivalence.lux
+++ b/stdlib/source/documentation/lux/abstract/equivalence.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Equivalence
+(documentation: (/.Equivalence it)
"Equivalence for a type's instances.")
(documentation: /.rec
diff --git a/stdlib/source/documentation/lux/abstract/functor.lux b/stdlib/source/documentation/lux/abstract/functor.lux
index 3de919eb5..822645435 100644
--- a/stdlib/source/documentation/lux/abstract/functor.lux
+++ b/stdlib/source/documentation/lux/abstract/functor.lux
@@ -23,11 +23,11 @@
(.List $.Module)
($.module /._
""
- [($.default /.Functor)
- ($.default /.Fix)
- ($.default /.Or)
- ($.default /.And)
- ($.default /.Then)
+ [($.default (/.Functor !))
+ ($.default (/.Fix !))
+ ($.default (/.Or left right))
+ ($.default (/.And left right))
+ ($.default (/.Then outer inner))
..sum
..product
..composite]
diff --git a/stdlib/source/documentation/lux/abstract/functor/contravariant.lux b/stdlib/source/documentation/lux/abstract/functor/contravariant.lux
index 7720babde..10dc126e0 100644
--- a/stdlib/source/documentation/lux/abstract/functor/contravariant.lux
+++ b/stdlib/source/documentation/lux/abstract/functor/contravariant.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.Functor
+(documentation: (/.Functor !)
"The contravariant functor.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/abstract/hash.lux b/stdlib/source/documentation/lux/abstract/hash.lux
index 88fdd0a6e..421c51783 100644
--- a/stdlib/source/documentation/lux/abstract/hash.lux
+++ b/stdlib/source/documentation/lux/abstract/hash.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Hash
+(documentation: (/.Hash it)
"A way to produce hash-codes for a type's instances.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/abstract/interval.lux b/stdlib/source/documentation/lux/abstract/interval.lux
index 7162f9ee9..50052e878 100644
--- a/stdlib/source/documentation/lux/abstract/interval.lux
+++ b/stdlib/source/documentation/lux/abstract/interval.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Interval
+(documentation: (/.Interval it)
"A representation of top and bottom boundaries for an ordered type.")
(documentation: /.singleton
diff --git a/stdlib/source/documentation/lux/abstract/mix.lux b/stdlib/source/documentation/lux/abstract/mix.lux
index 73b23e628..3ac1b8c99 100644
--- a/stdlib/source/documentation/lux/abstract/mix.lux
+++ b/stdlib/source/documentation/lux/abstract/mix.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Mix
+(documentation: (/.Mix structure)
"Iterate over a structure's values to build a summary value.")
(documentation: /.with_monoid
diff --git a/stdlib/source/documentation/lux/abstract/monad.lux b/stdlib/source/documentation/lux/abstract/monad.lux
index 9b2772a52..925973b18 100644
--- a/stdlib/source/documentation/lux/abstract/monad.lux
+++ b/stdlib/source/documentation/lux/abstract/monad.lux
@@ -10,7 +10,7 @@
["." / #_
["#." free]])
-(documentation: /.Monad
+(documentation: (/.Monad it)
(format "A monad is a monoid in the category of endofunctors."
\n "What's the problem?"))
diff --git a/stdlib/source/documentation/lux/abstract/monad/free.lux b/stdlib/source/documentation/lux/abstract/monad/free.lux
index 24f9ac79f..ffdc7a715 100644
--- a/stdlib/source/documentation/lux/abstract/monad/free.lux
+++ b/stdlib/source/documentation/lux/abstract/monad/free.lux
@@ -5,7 +5,7 @@
[\\library
["." /]])
-(documentation: /.Free
+(documentation: (/.Free ! it)
"The Free Monad.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/abstract/monoid.lux b/stdlib/source/documentation/lux/abstract/monoid.lux
index a8eb4b603..366fe2cd4 100644
--- a/stdlib/source/documentation/lux/abstract/monoid.lux
+++ b/stdlib/source/documentation/lux/abstract/monoid.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Monoid
+(documentation: (/.Monoid it)
(format "A way to compose values."
\n "Includes an identity value which does not alter any other value when combined with."))
diff --git a/stdlib/source/documentation/lux/abstract/order.lux b/stdlib/source/documentation/lux/abstract/order.lux
index ef7826d0f..72ba85c04 100644
--- a/stdlib/source/documentation/lux/abstract/order.lux
+++ b/stdlib/source/documentation/lux/abstract/order.lux
@@ -8,10 +8,10 @@
[\\library
["." /]])
-(documentation: /.Order
+(documentation: (/.Order it)
"A signature for types that possess some sense of ordering among their elements.")
-(documentation: /.Comparison
+(documentation: (/.Comparison it)
"An arbitrary comparison between two values, with the knowledge of how to order them.")
(documentation: /.<=
@@ -23,7 +23,7 @@
(documentation: /.>=
"Greater than or equal.")
-(documentation: /.Choice
+(documentation: (/.Choice it)
"A choice comparison between two values, with the knowledge of how to order them.")
(documentation: /.min
diff --git a/stdlib/source/documentation/lux/abstract/predicate.lux b/stdlib/source/documentation/lux/abstract/predicate.lux
index a71326b98..6bf46b734 100644
--- a/stdlib/source/documentation/lux/abstract/predicate.lux
+++ b/stdlib/source/documentation/lux/abstract/predicate.lux
@@ -8,7 +8,7 @@
[\\library
["." /]])
-(documentation: /.Predicate
+(documentation: (/.Predicate it)
"A question that can be asked of a value, yield either false (#0) or true (#1).")
(documentation: /.none
diff --git a/stdlib/source/documentation/lux/control/concurrency/actor.lux b/stdlib/source/documentation/lux/control/concurrency/actor.lux
index 6f9327a9a..ccf4945f2 100644
--- a/stdlib/source/documentation/lux/control/concurrency/actor.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/actor.lux
@@ -12,16 +12,16 @@
[\\library
["." /]])
-(documentation: /.Actor
+(documentation: (/.Actor state)
"An entity that can react to messages (mail) sent to it concurrently.")
-(documentation: /.Mail
+(documentation: (/.Mail state)
"A one-way message sent to an actor, without expecting a reply.")
-(documentation: /.Obituary
+(documentation: (/.Obituary state)
"Details on the death of an actor.")
-(documentation: /.Behavior
+(documentation: (/.Behavior input state)
"An actor's behavior when mail is received and when a fatal error occurs.")
(documentation: /.spawn!
@@ -33,7 +33,7 @@
(documentation: /.mail!
"Send mail to an actor.")
-(documentation: /.Message
+(documentation: (/.Message state output)
"A two-way message sent to an actor, expecting a reply.")
(documentation: /.tell!
diff --git a/stdlib/source/documentation/lux/control/concurrency/async.lux b/stdlib/source/documentation/lux/control/concurrency/async.lux
index 823967b36..769a1a770 100644
--- a/stdlib/source/documentation/lux/control/concurrency/async.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/async.lux
@@ -10,10 +10,10 @@
[\\library
["." /]])
-(documentation: /.Async
+(documentation: (/.Async it)
"Represents values produced by asynchronous computations (unlike IO, which is synchronous).")
-(documentation: /.Resolver
+(documentation: (/.Resolver it)
(format "The function used to give a value to an async."
\n "Will signal 'true' if the async has been resolved for the 1st time, 'false' otherwise."))
diff --git a/stdlib/source/documentation/lux/control/concurrency/atom.lux b/stdlib/source/documentation/lux/control/concurrency/atom.lux
index 8b35c1c7e..f75779e94 100644
--- a/stdlib/source/documentation/lux/control/concurrency/atom.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/atom.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Atom
+(documentation: (/.Atom it)
"Atomic references that are safe to mutate concurrently.")
(documentation: /.compare_and_swap!
diff --git a/stdlib/source/documentation/lux/control/concurrency/frp.lux b/stdlib/source/documentation/lux/control/concurrency/frp.lux
index 74ddc31e2..dae7ee4bc 100644
--- a/stdlib/source/documentation/lux/control/concurrency/frp.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/frp.lux
@@ -10,17 +10,17 @@
[\\library
["." /]])
-(documentation: /.Channel
+(documentation: (/.Channel it)
"An asynchronous channel to distribute values.")
-(documentation: /.Sink
+(documentation: (/.Sink it)
"The tail-end of a channel, which can be written-to to fee the channel.")
(documentation: /.channel
"Creates a brand-new channel and hands it over, along with the sink to write to it."
[(channel _)])
-(documentation: /.Subscriber
+(documentation: (/.Subscriber it)
"A function that can receive every value fed into a channel.")
(documentation: /.only
diff --git a/stdlib/source/documentation/lux/control/concurrency/stm.lux b/stdlib/source/documentation/lux/control/concurrency/stm.lux
index ebb46e87a..b7372e4be 100644
--- a/stdlib/source/documentation/lux/control/concurrency/stm.lux
+++ b/stdlib/source/documentation/lux/control/concurrency/stm.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Var
+(documentation: (/.Var it)
"A mutable cell containing a value, and observers that will be alerted of any change to it.")
(documentation: /.var
@@ -21,7 +21,7 @@
"Creates a channel that will receive all changes to the value of the given var."
[(follow! target)])
-(documentation: /.STM
+(documentation: (/.STM it)
"A computation which updates a transaction and produces a value.")
(documentation: /.update
diff --git a/stdlib/source/documentation/lux/control/continuation.lux b/stdlib/source/documentation/lux/control/continuation.lux
index ebb778373..0aacddd10 100644
--- a/stdlib/source/documentation/lux/control/continuation.lux
+++ b/stdlib/source/documentation/lux/control/continuation.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Cont
+(documentation: (/.Cont input output)
"Continuations.")
(documentation: /.continued
diff --git a/stdlib/source/documentation/lux/control/exception.lux b/stdlib/source/documentation/lux/control/exception.lux
index fae2b0163..4df1fa691 100644
--- a/stdlib/source/documentation/lux/control/exception.lux
+++ b/stdlib/source/documentation/lux/control/exception.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Exception
+(documentation: (/.Exception it)
"An exception provides a way to decorate error messages.")
(documentation: /.match?
diff --git a/stdlib/source/documentation/lux/control/function/memo.lux b/stdlib/source/documentation/lux/control/function/memo.lux
index 823b49772..35d2eb251 100644
--- a/stdlib/source/documentation/lux/control/function/memo.lux
+++ b/stdlib/source/documentation/lux/control/function/memo.lux
@@ -32,5 +32,5 @@
..closed
..none
($.default /.memoization)
- ($.default /.Memo)]
+ ($.default (/.Memo input output))]
[]))
diff --git a/stdlib/source/documentation/lux/control/function/mixin.lux b/stdlib/source/documentation/lux/control/function/mixin.lux
index d0a8c9667..dd2b77e9c 100644
--- a/stdlib/source/documentation/lux/control/function/mixin.lux
+++ b/stdlib/source/documentation/lux/control/function/mixin.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Mixin
+(documentation: (/.Mixin input output)
"A partially-defined function which can be mixed with others to inherit their behavior.")
(documentation: /.fixed
@@ -36,7 +36,7 @@
"Executes an action after doing the main work."
[(after monad action)])
-(documentation: /.Recursive
+(documentation: (/.Recursive input output)
"An indirectly recursive function.")
(documentation: /.of_recursive
diff --git a/stdlib/source/documentation/lux/control/io.lux b/stdlib/source/documentation/lux/control/io.lux
index 085a70314..70f982175 100644
--- a/stdlib/source/documentation/lux/control/io.lux
+++ b/stdlib/source/documentation/lux/control/io.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.IO
+(documentation: (/.IO it)
"A type that represents synchronous, effectful computations that may interact with the outside world.")
(documentation: /.io
diff --git a/stdlib/source/documentation/lux/control/lazy.lux b/stdlib/source/documentation/lux/control/lazy.lux
index 7a5b3217d..17466e87f 100644
--- a/stdlib/source/documentation/lux/control/lazy.lux
+++ b/stdlib/source/documentation/lux/control/lazy.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Lazy
+(documentation: (/.Lazy it)
(format "A value specified by an expression that is calculated only at the last moment possible."
\n "Afterwards, the value is cached for future reference."))
diff --git a/stdlib/source/documentation/lux/control/parser.lux b/stdlib/source/documentation/lux/control/parser.lux
index 7c6691d60..be39b3114 100644
--- a/stdlib/source/documentation/lux/control/parser.lux
+++ b/stdlib/source/documentation/lux/control/parser.lux
@@ -22,7 +22,7 @@
["#." type]
["#." xml]])
-(documentation: /.Parser
+(documentation: (/.Parser state it)
"A generic parser.")
(documentation: /.assertion
diff --git a/stdlib/source/documentation/lux/control/parser/analysis.lux b/stdlib/source/documentation/lux/control/parser/analysis.lux
index 1f66be4bf..284860f81 100644
--- a/stdlib/source/documentation/lux/control/parser/analysis.lux
+++ b/stdlib/source/documentation/lux/control/parser/analysis.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser for Lux code analysis nodes.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/parser/binary.lux b/stdlib/source/documentation/lux/control/parser/binary.lux
index c20d3b0a7..07e141ef0 100644
--- a/stdlib/source/documentation/lux/control/parser/binary.lux
+++ b/stdlib/source/documentation/lux/control/parser/binary.lux
@@ -13,7 +13,7 @@
(documentation: /.Offset
"An offset for reading within binary data.")
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser for raw binary data.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/parser/cli.lux b/stdlib/source/documentation/lux/control/parser/cli.lux
index ecb2b4cb7..f70ea6ab8 100644
--- a/stdlib/source/documentation/lux/control/parser/cli.lux
+++ b/stdlib/source/documentation/lux/control/parser/cli.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A command-line interface parser.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/parser/code.lux b/stdlib/source/documentation/lux/control/parser/code.lux
index aa7e91442..b3d4d9b0d 100644
--- a/stdlib/source/documentation/lux/control/parser/code.lux
+++ b/stdlib/source/documentation/lux/control/parser/code.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A Lux code parser.")
(documentation: /.any
diff --git a/stdlib/source/documentation/lux/control/parser/environment.lux b/stdlib/source/documentation/lux/control/parser/environment.lux
index f4961a0d4..6de12d092 100644
--- a/stdlib/source/documentation/lux/control/parser/environment.lux
+++ b/stdlib/source/documentation/lux/control/parser/environment.lux
@@ -16,7 +16,7 @@
(documentation: /.Environment
"An abstraction for environment variables of a program.")
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser of environment variables of a program.")
(documentation: /.empty
diff --git a/stdlib/source/documentation/lux/control/parser/json.lux b/stdlib/source/documentation/lux/control/parser/json.lux
index 8dfa6a8d3..ba49d12b0 100644
--- a/stdlib/source/documentation/lux/control/parser/json.lux
+++ b/stdlib/source/documentation/lux/control/parser/json.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A JSON parser.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/parser/synthesis.lux b/stdlib/source/documentation/lux/control/parser/synthesis.lux
index 82b3224ea..4f8f41124 100644
--- a/stdlib/source/documentation/lux/control/parser/synthesis.lux
+++ b/stdlib/source/documentation/lux/control/parser/synthesis.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser for the Lux compiler's synthesis nodes using during optimization.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/parser/text.lux b/stdlib/source/documentation/lux/control/parser/text.lux
index 52c1c6b07..5db5601a2 100644
--- a/stdlib/source/documentation/lux/control/parser/text.lux
+++ b/stdlib/source/documentation/lux/control/parser/text.lux
@@ -13,7 +13,7 @@
(documentation: /.Offset
"An offset into a block of text.")
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser for text.")
(documentation: /.Slice
diff --git a/stdlib/source/documentation/lux/control/parser/tree.lux b/stdlib/source/documentation/lux/control/parser/tree.lux
index 3c5cf1bf7..f6160afe9 100644
--- a/stdlib/source/documentation/lux/control/parser/tree.lux
+++ b/stdlib/source/documentation/lux/control/parser/tree.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser of arbitrary trees.")
(documentation: /.result'
diff --git a/stdlib/source/documentation/lux/control/parser/type.lux b/stdlib/source/documentation/lux/control/parser/type.lux
index 0d1785b06..f5405958a 100644
--- a/stdlib/source/documentation/lux/control/parser/type.lux
+++ b/stdlib/source/documentation/lux/control/parser/type.lux
@@ -13,7 +13,7 @@
(documentation: /.Env
"An environment for type parsing.")
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser of Lux types.")
(documentation: /.fresh
diff --git a/stdlib/source/documentation/lux/control/parser/xml.lux b/stdlib/source/documentation/lux/control/parser/xml.lux
index 71390acdb..ce7d8c9bf 100644
--- a/stdlib/source/documentation/lux/control/parser/xml.lux
+++ b/stdlib/source/documentation/lux/control/parser/xml.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Parser
+(documentation: (/.Parser it)
"A parser of XML-encoded data.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/control/reader.lux b/stdlib/source/documentation/lux/control/reader.lux
index 959c44217..b432d4fa2 100644
--- a/stdlib/source/documentation/lux/control/reader.lux
+++ b/stdlib/source/documentation/lux/control/reader.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Reader
+(documentation: (/.Reader environment it)
"Computations that have access to some environmental value.")
(documentation: /.read
diff --git a/stdlib/source/documentation/lux/control/region.lux b/stdlib/source/documentation/lux/control/region.lux
index 08e8177b9..c1e2c9823 100644
--- a/stdlib/source/documentation/lux/control/region.lux
+++ b/stdlib/source/documentation/lux/control/region.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Region
+(documentation: (/.Region r ! it)
(format "A region where resources may be be claimed and where a side-effecting computation may be performed."
\n "Every resource is paired with a function that knows how to clean/reclaim it, to make sure there are no leaks."))
diff --git a/stdlib/source/documentation/lux/control/security/capability.lux b/stdlib/source/documentation/lux/control/security/capability.lux
index fb43184d8..4525da73c 100644
--- a/stdlib/source/documentation/lux/control/security/capability.lux
+++ b/stdlib/source/documentation/lux/control/security/capability.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Capability
+(documentation: (/.Capability brand input output)
(format "Represents the capability to perform an operation."
\n "This operation is assumed to have security implications."))
diff --git a/stdlib/source/documentation/lux/control/security/policy.lux b/stdlib/source/documentation/lux/control/security/policy.lux
index 37d499014..ee0f172bb 100644
--- a/stdlib/source/documentation/lux/control/security/policy.lux
+++ b/stdlib/source/documentation/lux/control/security/policy.lux
@@ -10,26 +10,26 @@
[\\library
["." /]])
-(documentation: /.Policy
+(documentation: (/.Policy brand value %)
"A security policy encoded as the means to 'upgrade' or 'downgrade' in a secure context.")
-(documentation: /.Can_Upgrade
+(documentation: (/.Can_Upgrade brand % value)
"Represents the capacity to 'upgrade' a value.")
-(documentation: /.Can_Downgrade
+(documentation: (/.Can_Downgrade brand % value)
"Represents the capacity to 'downgrade' a value.")
-(documentation: /.Privilege
+(documentation: (/.Privilege brand %)
"Represents the privilege to both 'upgrade' and 'downgrade' a value.")
-(documentation: /.Delegation
+(documentation: (/.Delegation brand %from %to)
"Represents the act of delegating policy capacities.")
(documentation: /.delegation
"Delegating policy capacities."
[(delegation downgrade upgrade)])
-(documentation: /.Context
+(documentation: (/.Context brand scope %)
"A computational context with an associated policy privilege.")
(documentation: /.with_policy
diff --git a/stdlib/source/documentation/lux/control/state.lux b/stdlib/source/documentation/lux/control/state.lux
index 99be4d130..7426a0a47 100644
--- a/stdlib/source/documentation/lux/control/state.lux
+++ b/stdlib/source/documentation/lux/control/state.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.State
+(documentation: (/.State state it)
"Stateful computations.")
(documentation: /.get
diff --git a/stdlib/source/documentation/lux/control/thread.lux b/stdlib/source/documentation/lux/control/thread.lux
index cc3134d2f..502992db1 100644
--- a/stdlib/source/documentation/lux/control/thread.lux
+++ b/stdlib/source/documentation/lux/control/thread.lux
@@ -10,10 +10,10 @@
[\\library
["." /]])
-(documentation: /.Thread
+(documentation: (/.Thread ! it)
"An imperative process with access to mutable values.")
-(documentation: /.Box
+(documentation: (/.Box ! it)
"A mutable box holding a value.")
(documentation: /.box
diff --git a/stdlib/source/documentation/lux/control/try.lux b/stdlib/source/documentation/lux/control/try.lux
index 7b226c132..c77538d99 100644
--- a/stdlib/source/documentation/lux/control/try.lux
+++ b/stdlib/source/documentation/lux/control/try.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Try
+(documentation: (/.Try it)
"A computation that can fail with an error message.")
(documentation: /.with
diff --git a/stdlib/source/documentation/lux/control/writer.lux b/stdlib/source/documentation/lux/control/writer.lux
index 99cbe0463..f13d72485 100644
--- a/stdlib/source/documentation/lux/control/writer.lux
+++ b/stdlib/source/documentation/lux/control/writer.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Writer
+(documentation: (/.Writer log value)
"Represents a value with an associated 'log' to record arbitrary information.")
(documentation: /.write
diff --git a/stdlib/source/documentation/lux/data/collection/array.lux b/stdlib/source/documentation/lux/data/collection/array.lux
index 504d646cc..d9657e747 100644
--- a/stdlib/source/documentation/lux/data/collection/array.lux
+++ b/stdlib/source/documentation/lux/data/collection/array.lux
@@ -15,7 +15,7 @@
[\\library
["." /]])
-(documentation: /.Array
+(documentation: (/.Array it)
"Mutable arrays.")
(documentation: /.empty
diff --git a/stdlib/source/documentation/lux/data/collection/dictionary.lux b/stdlib/source/documentation/lux/data/collection/dictionary.lux
index 95d2f998a..d1a0689ea 100644
--- a/stdlib/source/documentation/lux/data/collection/dictionary.lux
+++ b/stdlib/source/documentation/lux/data/collection/dictionary.lux
@@ -18,7 +18,7 @@
["#." ordered]
["#." plist]])
-(documentation: /.Dictionary
+(documentation: (/.Dictionary key value)
"A dictionary implemented as a Hash-Array Mapped Trie (HAMT).")
(documentation: /.empty
diff --git a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux
index adbb1303f..755701934 100644
--- a/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/documentation/lux/data/collection/dictionary/ordered.lux
@@ -15,7 +15,7 @@
[\\library
["." /]])
-(documentation: /.Dictionary
+(documentation: (/.Dictionary key value)
"A dictionary data-structure with ordered entries.")
(documentation: /.empty
diff --git a/stdlib/source/documentation/lux/data/collection/dictionary/plist.lux b/stdlib/source/documentation/lux/data/collection/dictionary/plist.lux
index 2450cc9eb..a6fd8e4e9 100644
--- a/stdlib/source/documentation/lux/data/collection/dictionary/plist.lux
+++ b/stdlib/source/documentation/lux/data/collection/dictionary/plist.lux
@@ -15,7 +15,7 @@
[\\library
["." /]])
-(documentation: /.PList
+(documentation: (/.PList it)
(format "A property list."
\n "It's a simple dictionary-like structure with Text keys."))
diff --git a/stdlib/source/documentation/lux/data/collection/queue.lux b/stdlib/source/documentation/lux/data/collection/queue.lux
index 5b866fe90..d92371dc3 100644
--- a/stdlib/source/documentation/lux/data/collection/queue.lux
+++ b/stdlib/source/documentation/lux/data/collection/queue.lux
@@ -17,7 +17,7 @@
["." / #_
["#." priority]])
-(documentation: /.Queue
+(documentation: (/.Queue it)
"A first-in, first-out sequential data-structure.")
(documentation: /.of_list
diff --git a/stdlib/source/documentation/lux/data/collection/queue/priority.lux b/stdlib/source/documentation/lux/data/collection/queue/priority.lux
index e62869ecd..96159b955 100644
--- a/stdlib/source/documentation/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/documentation/lux/data/collection/queue/priority.lux
@@ -32,7 +32,7 @@
($.default /.Priority)
($.default /.max)
($.default /.min)
- ($.default /.Queue)
+ ($.default (/.Queue it))
($.default /.empty)
($.default /.front)
($.default /.size)
diff --git a/stdlib/source/documentation/lux/data/collection/row.lux b/stdlib/source/documentation/lux/data/collection/row.lux
index a49b12bd4..25c174793 100644
--- a/stdlib/source/documentation/lux/data/collection/row.lux
+++ b/stdlib/source/documentation/lux/data/collection/row.lux
@@ -15,7 +15,7 @@
[\\library
["." /]])
-(documentation: /.Row
+(documentation: (/.Row it)
"A sequential data-structure with fast random access.")
(documentation: /.suffix
diff --git a/stdlib/source/documentation/lux/data/collection/sequence.lux b/stdlib/source/documentation/lux/data/collection/sequence.lux
index 64e976155..6caac570d 100644
--- a/stdlib/source/documentation/lux/data/collection/sequence.lux
+++ b/stdlib/source/documentation/lux/data/collection/sequence.lux
@@ -15,7 +15,7 @@
[\\library
["." /]])
-(documentation: /.Sequence
+(documentation: (/.Sequence it)
"An infinite sequence of values.")
(documentation: /.iterations
diff --git a/stdlib/source/documentation/lux/data/collection/set.lux b/stdlib/source/documentation/lux/data/collection/set.lux
index 2778305ec..7c92d4fef 100644
--- a/stdlib/source/documentation/lux/data/collection/set.lux
+++ b/stdlib/source/documentation/lux/data/collection/set.lux
@@ -45,7 +45,7 @@
..intersection
..sub?
..super?
- ($.default /.Set)
+ ($.default (/.Set it))
($.default /.member_hash)
($.default /.empty)
($.default /.size)
diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux
index 6e38886dc..5ddc82939 100644
--- a/stdlib/source/documentation/lux/data/collection/set/multi.lux
+++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Set
+(documentation: (/.Set it)
"A set that keeps track of repetition in its entries.")
(documentation: /.has
diff --git a/stdlib/source/documentation/lux/data/collection/set/ordered.lux b/stdlib/source/documentation/lux/data/collection/set/ordered.lux
index 0ace59c12..8f9c90c1c 100644
--- a/stdlib/source/documentation/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Set
+(documentation: (/.Set it)
"A set with ordered entries.")
(documentation: /.member?
diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux
index c020db741..557564f92 100644
--- a/stdlib/source/documentation/lux/data/collection/stack.lux
+++ b/stdlib/source/documentation/lux/data/collection/stack.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Stack
+(documentation: (/.Stack it)
"A first-in, last-out sequential data-structure.")
(documentation: /.value
diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux
index 310073287..ed6161796 100644
--- a/stdlib/source/documentation/lux/data/collection/tree.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree.lux
@@ -16,7 +16,7 @@
["#." finger]
["#." zipper]])
-(documentation: /.Tree
+(documentation: (/.Tree it)
"A generic tree data-structure.")
(documentation: /.flat
diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux
index 683d98f51..0f47d78f5 100644
--- a/stdlib/source/documentation/lux/data/collection/tree/finger.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux
@@ -13,10 +13,10 @@
[\\library
["." /]])
-(documentation: /.Tree
+(documentation: (/.Tree @ tag value)
"A finger tree.")
-(documentation: /.Builder
+(documentation: (/.Builder @ tag)
"A builder for finter tree structures.")
(documentation: /.builder
diff --git a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux
index d67fb37bf..7f72d669e 100644
--- a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Zipper
+(documentation: (/.Zipper it)
"Tree zippers, for easy navigation and editing of trees.")
(documentation: /.set
diff --git a/stdlib/source/documentation/lux/data/format/binary.lux b/stdlib/source/documentation/lux/data/format/binary.lux
index 229f262b0..42a6c924b 100644
--- a/stdlib/source/documentation/lux/data/format/binary.lux
+++ b/stdlib/source/documentation/lux/data/format/binary.lux
@@ -22,7 +22,7 @@
(documentation: /.instance
"Given a specification of how to construct binary data, yields a binary blob that matches it.")
-(documentation: /.Writer
+(documentation: (/.Writer it)
"An operation that knows how to write information into a binary blob.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/data/identity.lux b/stdlib/source/documentation/lux/data/identity.lux
index b67f8470b..95aef4075 100644
--- a/stdlib/source/documentation/lux/data/identity.lux
+++ b/stdlib/source/documentation/lux/data/identity.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Identity
+(documentation: (/.Identity it)
"A value, as is, without any extra structure super-imposed on it.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/data/text/format.lux b/stdlib/source/documentation/lux/data/text/format.lux
index 4f823901e..046682386 100644
--- a/stdlib/source/documentation/lux/data/text/format.lux
+++ b/stdlib/source/documentation/lux/data/text/format.lux
@@ -7,7 +7,7 @@
[\\library
["." /]])
-(documentation: /.Format
+(documentation: (/.Format it)
"A way to produce readable text from values.")
(documentation: /.format
diff --git a/stdlib/source/documentation/lux/ffi.rb.lux b/stdlib/source/documentation/lux/ffi.rb.lux
index 9109e9253..7d265ec07 100644
--- a/stdlib/source/documentation/lux/ffi.rb.lux
+++ b/stdlib/source/documentation/lux/ffi.rb.lux
@@ -36,7 +36,7 @@
($.module /._
""
[..import:
- ($.default /.Object)
+ ($.default (/.Object brand))
($.default /.Nil)
($.default /.Function)
($.default /.Function)
diff --git a/stdlib/source/documentation/lux/math/logic/fuzzy.lux b/stdlib/source/documentation/lux/math/logic/fuzzy.lux
index 5f31cfea1..8a28fb643 100644
--- a/stdlib/source/documentation/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/documentation/lux/math/logic/fuzzy.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Fuzzy
+(documentation: (/.Fuzzy it)
"A fuzzy set.")
(documentation: /.membership
diff --git a/stdlib/source/documentation/lux/math/modular.lux b/stdlib/source/documentation/lux/math/modular.lux
index f0c4c9f33..4ce57e51a 100644
--- a/stdlib/source/documentation/lux/math/modular.lux
+++ b/stdlib/source/documentation/lux/math/modular.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Mod
+(documentation: (/.Mod %)
"A number under a modulus.")
(documentation: /.modular
diff --git a/stdlib/source/documentation/lux/math/modulus.lux b/stdlib/source/documentation/lux/math/modulus.lux
index c97eaa270..2e0259f79 100644
--- a/stdlib/source/documentation/lux/math/modulus.lux
+++ b/stdlib/source/documentation/lux/math/modulus.lux
@@ -10,7 +10,7 @@
[\\library
["." /]])
-(documentation: /.Modulus
+(documentation: (/.Modulus %)
(format "A number used as a modulus in modular arithmetic."
\n "It cannot be 0."))
diff --git a/stdlib/source/documentation/lux/math/number/i64.lux b/stdlib/source/documentation/lux/math/number/i64.lux
index 9a7d3aead..afdee1688 100644
--- a/stdlib/source/documentation/lux/math/number/i64.lux
+++ b/stdlib/source/documentation/lux/math/number/i64.lux
@@ -78,7 +78,7 @@
"A mask for a block of bits of the given size, starting at the given offset."
[(region offset size)])
-(documentation: /.Sub
+(documentation: (/.Sub width)
"A sub-space of I64 with a reduce amount of bits.")
(documentation: /.sub
diff --git a/stdlib/source/documentation/lux/math/random.lux b/stdlib/source/documentation/lux/math/random.lux
index 8dcfb98dd..2e689aba7 100644
--- a/stdlib/source/documentation/lux/math/random.lux
+++ b/stdlib/source/documentation/lux/math/random.lux
@@ -13,7 +13,7 @@
(documentation: /.PRNG
"An abstract way to represent any PRNG.")
-(documentation: /.Random
+(documentation: (/.Random it)
"A producer of random values based on a PRNG.")
(documentation: /.only
diff --git a/stdlib/source/documentation/lux/meta.lux b/stdlib/source/documentation/lux/meta.lux
index 4b6c549bf..462079c14 100644
--- a/stdlib/source/documentation/lux/meta.lux
+++ b/stdlib/source/documentation/lux/meta.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux (#- type)
+ [lux (#- type macro)
["$" documentation (#+ documentation:)]
[data
["." text (#+ \n)
diff --git a/stdlib/source/documentation/lux/type/check.lux b/stdlib/source/documentation/lux/type/check.lux
index f6f8db6f0..c45674457 100644
--- a/stdlib/source/documentation/lux/type/check.lux
+++ b/stdlib/source/documentation/lux/type/check.lux
@@ -16,7 +16,7 @@
(documentation: /.Var
"The ID for a type-variable in a type-checking context.")
-(documentation: /.Check
+(documentation: (/.Check it)
"A type-checking computation which may fail or yield a value.")
(documentation: /.result
diff --git a/stdlib/source/documentation/lux/type/quotient.lux b/stdlib/source/documentation/lux/type/quotient.lux
index 51b9db079..7981fcf5c 100644
--- a/stdlib/source/documentation/lux/type/quotient.lux
+++ b/stdlib/source/documentation/lux/type/quotient.lux
@@ -13,10 +13,10 @@
[\\library
["." /]])
-(documentation: /.Class
+(documentation: (/.Class value label)
"The class knows how to classify/label values that are meant to be equivalent to one another.")
-(documentation: /.Quotient
+(documentation: (/.Quotient value label)
(format "A quotient value has been labeled with a class."
\n "All equivalent values will belong to the same class."
\n "This means all equivalent values possess the same label."))
diff --git a/stdlib/source/documentation/lux/type/refinement.lux b/stdlib/source/documentation/lux/type/refinement.lux
index eb7c4b902..636c52759 100644
--- a/stdlib/source/documentation/lux/type/refinement.lux
+++ b/stdlib/source/documentation/lux/type/refinement.lux
@@ -13,10 +13,10 @@
[\\library
["." /]])
-(documentation: /.Refined
+(documentation: (/.Refined it)
"A refined version of another type, using a predicate to select valid instances.")
-(documentation: /.Refiner
+(documentation: (/.Refiner it)
"A selection mechanism for refined instances of a type.")
(documentation: /.refiner
diff --git a/stdlib/source/documentation/lux/type/resource.lux b/stdlib/source/documentation/lux/type/resource.lux
index 653cac853..4e4e42c2d 100644
--- a/stdlib/source/documentation/lux/type/resource.lux
+++ b/stdlib/source/documentation/lux/type/resource.lux
@@ -13,20 +13,20 @@
[\\library
["." /]])
-(documentation: /.Procedure
+(documentation: (/.Procedure monad input output value)
(format "A computation that takes a sequence of resource access rights as inputs and yields a different sequence as outputs."
\n "A procedure yields a result value."
\n "A procedure can make use of monadic effects."))
-(documentation: /.Linear
+(documentation: (/.Linear monad value)
(format "A procedure that is constant with regards to resource access rights."
\n "This means no additional resources will be available after the computation is over."
\n "This also means no previously available resources will have been consumed."))
-(documentation: /.Affine
+(documentation: (/.Affine monad permissions value)
"A procedure which expands the number of available resources.")
-(documentation: /.Relevant
+(documentation: (/.Relevant monad permissions value)
"A procedure which reduces the number of available resources.")
(documentation: /.run!
@@ -43,11 +43,11 @@
(documentation: /.Commutative
"The mode of keys which CAN be swapped, and for whom order of release/consumption DOES NOT matters.")
-(documentation: /.Key
+(documentation: (/.Key mode key)
(format "The access right for a resource."
\n "Without the key for a resource existing somewhere among the available ambient rights, one cannot use a resource."))
-(documentation: /.Res
+(documentation: (/.Res key value)
(format "A resource locked by a key."
\n "The 'key' represents the right to access/consume a resource."))
diff --git a/stdlib/source/documentation/lux/type/unit.lux b/stdlib/source/documentation/lux/type/unit.lux
index 08cd1a6d4..a2d9671e4 100644
--- a/stdlib/source/documentation/lux/type/unit.lux
+++ b/stdlib/source/documentation/lux/type/unit.lux
@@ -16,7 +16,7 @@
[\\library
["." /]])
-(documentation: /.Qty
+(documentation: (/.Qty unit)
"A quantity with an associated unit of measurement.")
(template [<name>]
@@ -30,10 +30,10 @@
[/./]
)
-(documentation: /.Unit
+(documentation: (/.Unit unit)
"A unit of measurement, to qualify numbers with.")
-(documentation: /.Scale
+(documentation: (/.Scale scale)
"A scale of magnitude.")
(documentation: /.Pure
diff --git a/stdlib/source/documentation/lux/type/variance.lux b/stdlib/source/documentation/lux/type/variance.lux
index 7503f9197..20e5c7c29 100644
--- a/stdlib/source/documentation/lux/type/variance.lux
+++ b/stdlib/source/documentation/lux/type/variance.lux
@@ -13,13 +13,13 @@
[\\library
["." /]])
-(documentation: /.Co
+(documentation: (/.Co it)
"A constraint for covariant types.")
-(documentation: /.Contra
+(documentation: (/.Contra it)
"A constraint for contravariant types.")
-(documentation: /.In
+(documentation: (/.In it)
"A constraint for invariant types.")
(.def: .public documentation
diff --git a/stdlib/source/documentation/lux/world/console.lux b/stdlib/source/documentation/lux/world/console.lux
index 80841123d..277bdaa12 100644
--- a/stdlib/source/documentation/lux/world/console.lux
+++ b/stdlib/source/documentation/lux/world/console.lux
@@ -13,14 +13,14 @@
[\\library
["." /]])
-(documentation: /.Console
+(documentation: (/.Console !)
"An interface to console/terminal I/O.")
(documentation: /.write_line
"Writes the message on the console and appends a new-line/line-feed at the end."
[(write_line message console)])
-(documentation: /.Mock
+(documentation: (/.Mock s)
(format "A mock/simulation of a console."
\n "Useful for testing."))
diff --git a/stdlib/source/documentation/lux/world/file.lux b/stdlib/source/documentation/lux/world/file.lux
index 06596ef56..60f0f3633 100644
--- a/stdlib/source/documentation/lux/world/file.lux
+++ b/stdlib/source/documentation/lux/world/file.lux
@@ -18,7 +18,7 @@
(documentation: /.Path
"A path to a file or a directory in a file-system.")
-(documentation: /.System
+(documentation: (/.System !)
"An interface to a file-system.")
(documentation: /.parent
diff --git a/stdlib/source/documentation/lux/world/file/watch.lux b/stdlib/source/documentation/lux/world/file/watch.lux
index e310d8d2d..d381aeb4d 100644
--- a/stdlib/source/documentation/lux/world/file/watch.lux
+++ b/stdlib/source/documentation/lux/world/file/watch.lux
@@ -20,7 +20,7 @@
""
[(also left right)])
-(documentation: /.Watcher
+(documentation: (/.Watcher !)
"Machinery for watching a file-system for changes to files and directories.")
(documentation: /.polling
diff --git a/stdlib/source/documentation/lux/world/net/http/client.lux b/stdlib/source/documentation/lux/world/net/http/client.lux
index 3534ebc6a..3a99183f2 100644
--- a/stdlib/source/documentation/lux/world/net/http/client.lux
+++ b/stdlib/source/documentation/lux/world/net/http/client.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Client
+(documentation: (/.Client !)
"A HTTP client capable of issuing requests to a HTTP server.")
(template [<name>]
diff --git a/stdlib/source/documentation/lux/world/program.lux b/stdlib/source/documentation/lux/world/program.lux
index d61db573b..43b1a89e7 100644
--- a/stdlib/source/documentation/lux/world/program.lux
+++ b/stdlib/source/documentation/lux/world/program.lux
@@ -13,7 +13,7 @@
[\\library
["." /]])
-(documentation: /.Program
+(documentation: (/.Program !)
"Access to ambient program data and the capacity to exit the program.")
(documentation: /.environment
diff --git a/stdlib/source/documentation/lux/world/shell.lux b/stdlib/source/documentation/lux/world/shell.lux
index 43264c503..cd69d9b12 100644
--- a/stdlib/source/documentation/lux/world/shell.lux
+++ b/stdlib/source/documentation/lux/world/shell.lux
@@ -16,7 +16,7 @@
(documentation: /.Exit
"A program exit code.")
-(documentation: /.Process
+(documentation: (/.Process !)
"The means for communicating with a program/process being executed by the operating system.")
(documentation: /.Command
@@ -25,10 +25,10 @@
(documentation: /.Argument
"A parameter for a command.")
-(documentation: /.Shell
+(documentation: (/.Shell !)
"The means for issuing commands to the operating system.")
-(documentation: /.Mock
+(documentation: (/.Mock s)
"A simulated process.")
(documentation: /.mock
diff --git a/stdlib/source/library/lux/data/format/markdown.lux b/stdlib/source/library/lux/data/format/markdown.lux
index a2df019bb..88746a059 100644
--- a/stdlib/source/library/lux/data/format/markdown.lux
+++ b/stdlib/source/library/lux/data/format/markdown.lux
@@ -147,13 +147,22 @@
(-> Text (Markdown Span))
(|>> (text.enclosed ["`` " " ``"]) :abstraction))
- (def: .public code
- {#.doc "A block of code."}
+ (def: .public generic_code
+ {#.doc "A (generic) block of code."}
(-> Text (Markdown Block))
(let [open (format "```" text.new_line)
close (format text.new_line "```")]
(|>> (text.enclosed [open close]) ..block)))
+ (def: .public (code language block)
+ {#.doc "A block of code of a specific language."}
+ (-> Text Text (Markdown Block))
+ (let [open (format "```" language text.new_line)
+ close (format text.new_line "```")]
+ (|> block
+ (text.enclosed [open close])
+ ..block)))
+
(def: .public (image description url)
(-> Text URL (Markdown Span))
(:abstraction (format "![" (..safe description) "](" url ")")))
diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux
index c73a71cd2..5de44d483 100644
--- a/stdlib/source/library/lux/documentation.lux
+++ b/stdlib/source/library/lux/documentation.lux
@@ -9,7 +9,7 @@
[control
["." maybe ("#\." functor)]
["." exception (#+ exception:)]
- ["<>" parser
+ ["<>" parser ("#\." monad)
["<.>" code (#+ Parser)]]]
[data
["." product]
@@ -273,15 +273,168 @@
(format "(" (%type' level type_function_name module type_func) " " (|> type_arguments (list\each (%type' level type_function_name module)) (text.interposed " ")) ")"))
(#.Named [_module _name] type)
- (if (text\= module _module)
- _name
- (%.name [_module _name]))
+ (cond (text\= module _module)
+ _name
+
+ (text\= .prelude_module _module)
+ (format "." _name)
+
+ ... else
+ (%.name [_module _name]))
))
(def: type
(-> Text Type Text)
(%type' (-- 0) "?"))
+(def: (parameterized_type arity type)
+ (-> Nat Type (Maybe Type))
+ (case arity
+ 0 (#.Some type)
+ _ (case type
+ (#.UnivQ _env _type)
+ (parameterized_type (-- arity) _type)
+
+ _
+ #.None)))
+
+(def: (prefixed_lines prefix lines)
+ (-> Text Text Text)
+ (|> lines
+ (text.all_split_by text.new_line)
+ (list\each (|>> (format prefix)))
+ (text.interposed text.new_line)))
+
+(def: (type_definition' level type_function_info tags module type)
+ (-> Nat [Text (List Text)] (List Text) Text Type Text)
+ (case tags
+ (^ (list single_tag))
+ (format "{#" single_tag " " (type_definition' level type_function_info #.None module type) "}")
+
+ _
+ (case type
+ (#.Primitive name params)
+ (case params
+ #.End
+ (format "(primitive " (%.text name) ")")
+
+ _
+ (format "(primitive " (%.text name) " " (|> params (list\each (type_definition' level type_function_info #.None module)) (text.interposed " ")) ")"))
+
+ (#.Sum _)
+ (let [members (type.flat_variant type)]
+ (case tags
+ #.End
+ (format "(Or "
+ (|> members
+ (list\each (type_definition' level type_function_info #.None module))
+ (text.interposed " "))
+ ")")
+
+ _
+ (|> members
+ (list.zipped/2 tags)
+ (list\each (function (_ [t_name type])
+ (case type
+ (#.Product _)
+ (let [types (type.flat_tuple type)]
+ (format "(#" t_name " "
+ (|> types
+ (list\each (type_definition' level type_function_info #.None module))
+ (text.interposed " "))
+ ")"))
+
+ _
+ (format "(#" t_name " " (type_definition' level type_function_info #.None module type) ")"))))
+ (text.interposed text.new_line))))
+
+ (#.Product _)
+ (let [members (type.flat_tuple type)]
+ (case tags
+ #.End
+ (format "[" (|> members (list\each (type_definition' level type_function_info #.None module)) (text.interposed " ")) "]")
+
+ _
+ (let [member_docs (|> members
+ (list.zipped/2 tags)
+ (list\each (function (_ [t_name type])
+ (format "#" t_name " " (type_definition' level type_function_info #.None module type))))
+ (text.interposed (format text.new_line " ")))]
+ (format "{" member_docs "}"))))
+
+ (#.Function input output)
+ (let [[ins out] (type.flat_function type)]
+ (format "(-> " (|> ins (list\each (type_definition' level type_function_info #.None module)) (text.interposed " "))
+ " "
+ (type_definition' level type_function_info #.None module out)
+ ")"))
+
+ (#.Parameter idx)
+ (parameter_name type_function_info level idx)
+
+ (^template [<tag> <pre>]
+ [(<tag> id)
+ (format <pre> (%.nat id))])
+ ([#.Var "-"]
+ [#.Ex "+"])
+
+ (^template [<tag> <name> <flat>]
+ [(<tag> _)
+ (let [[level' body] (<flat> type)
+ args (level_parameters level level')
+ body_doc (type_definition' (n.+ level level') type_function_info tags module body)
+ fn_name (case type_function_info
+ [fn_name #.End] fn_name
+ _ "_")]
+ (format "(" <name> " " "(" fn_name " " (text.interposed " " args) ")"
+ (case tags
+ #.End
+ (format " " body_doc)
+
+ _
+ (format text.new_line (prefixed_lines " " body_doc)))
+ ")"))])
+ ([#.UnivQ "All" type.flat_univ_q]
+ [#.ExQ "Ex" type.flat_ex_q])
+
+ ... Recursive call
+ (#.Apply (#.Parameter param_id) (#.Parameter fn_id))
+ (if (n.= fn_id param_id)
+ (product.left type_function_info)
+ (let [[type_func type_arguments] (type.flat_application type)]
+ (format "(" (type_definition' level type_function_info tags module (#.Parameter fn_id))
+ " " (type_definition' level type_function_info tags module (#.Parameter param_id))
+ ")")))
+
+ (#.Apply param fun)
+ (let [[type_func type_arguments] (type.flat_application type)]
+ (format "(" (type_definition' level type_function_info tags module type_func)
+ " " (|> type_arguments
+ (list\each (type_definition' level type_function_info #.None module))
+ (text.interposed " "))
+ ")"))
+
+ (#.Named [_module _name] type)
+ (cond (text\= module _module)
+ _name
+
+ (text\= .prelude_module _module)
+ (format "." _name)
+
+ ... else
+ (%.name [_module _name]))
+ )))
+
+(def: (type_definition module [name parameters] tags type)
+ (-> Text [Text (List Text)] (List Text) Type Text)
+ (let [arity (list.size parameters)]
+ (case (parameterized_type arity type)
+ (#.Some type)
+ (type_definition' (-- arity) [name parameters] tags module type)
+
+ #.None
+ (..type module type))))
+
(def: description
(Parser (Maybe Code))
(<>.or (<code>.text! "")
@@ -326,39 +479,60 @@
(text.interposed "")
code.text))
+(type: Declaration
+ [Name (List Text)])
+
+(def: declaration
+ (Parser Declaration)
+ (<>.either (<>.and ..qualified_identifier (<>\in (list)))
+ (<code>.form (<>.and ..qualified_identifier
+ (<>.some (<code>.local_identifier))))))
+
(syntax: (minimal_definition_documentation
- [name ..qualified_identifier])
- (let [g!module (code.text (product.left name))]
+ [[name parameters] ..declaration])
+ (do meta.monad
+ [.let [g!module (code.text (product.left name))]
+ [[_ def_type def_annotations def_value]] (meta.export name)]
(with_expansions [<\n> (~! text.\n)]
(macro.with_identifiers [g!type]
(in (list (` ($_ ((~! md.then))
... Name
(<| ((~! md.heading/3))
- (~ (code.text (|> name product.right [""] %.name))))
+ (~ (code.text (%.code (let [g!name (|> name product.right code.local_identifier)]
+ (case parameters
+ #.End
+ g!name
+
+ _
+ (` ((~ g!name) (~+ (list\each code.local_identifier parameters))))))))))
... Type
(let [(~ g!type) ("lux in-module"
(~ g!module)
(.:of (~ (code.identifier name))))]
- ((~! md.code)
- (if ((~! type\=) .Type (~ g!type))
- (|> (~ (code.identifier name))
- (:as .Type)
- ((~! type.anonymous))
- ((~! ..type) (~ g!module))
- ((~! %.format)
- ((~! ..single_line_comment) ((~! ..type) (~ g!module) (~ g!type)))
- <\n>))
- ((~! ..type) (~ g!module) (~ g!type))))))
+ ((~! md.code) "clojure"
+ (~ (if (type\= .Type def_type)
+ (` (|> (~ (code.identifier name))
+ (:as .Type)
+ ((~! type.anonymous))
+ ((~! ..type_definition)
+ (~ g!module)
+ [(~ (code.text (product.right name))) (list (~+ (list\each code.text parameters)))]
+ (list))
+ ((~! %.format)
+ ((~! ..single_line_comment) ((~! ..type) (~ g!module) (~ g!type)))
+ <\n>)))
+ (` ((~! ..type) (~ g!module) (~ g!type))))))))
)))))))
(syntax: (definition_documentation
- [name ..qualified_identifier
+ [[name parameters] ..declaration
description ..description
examples (<>.some ..example)])
(with_expansions [<\n> (~! text.\n)]
(in (list (` ($_ ((~! md.then))
((~! ..minimal_definition_documentation)
- (~ (code.identifier name)))
+ ((~ (code.identifier name))
+ (~+ (list\each code.local_identifier parameters))))
... Description
(~+ (case description
(#.Some description)
@@ -374,7 +548,7 @@
(list)
_
- (list (` (<| ((~! md.code))
+ (list (` (<| ((~! md.code) "clojure")
((~! %.format)
(~+ (|> examples
(list\each (..example_documentation (product.left name)))
@@ -393,21 +567,23 @@
#expected (Set Text)
#definitions (List Definition)}))
-(syntax: .public (default [name ..qualified_identifier])
+(syntax: .public (default [[name parameters] ..declaration])
(let [[_ short] name]
(in (list (` (: (.List ..Definition)
(list {#..definition (~ (code.text short))
#..documentation ((~! ..minimal_definition_documentation)
- (~ (code.identifier name)))})))))))
+ ((~ (code.identifier name))
+ (~+ (list\each code.local_identifier parameters))))})))))))
-(syntax: .public (documentation: [name ..qualified_identifier
+(syntax: .public (documentation: [[name parameters] ..declaration
extra (<>.some <code>.any)])
(let [[_ short] name]
(in (list (` (.def: .public (~ (code.local_identifier short))
(.List ..Definition)
(.list {#..definition (~ (code.text short))
#..documentation ((~! ..definition_documentation)
- (~ (code.identifier name))
+ ((~ (code.identifier name))
+ (~+ (list\each code.local_identifier parameters)))
(~+ extra))})))))))
(def: definitions_documentation
diff --git a/stdlib/source/library/lux/type/abstract.lux b/stdlib/source/library/lux/type/abstract.lux
index 9a0edab98..23e7b4378 100644
--- a/stdlib/source/library/lux/type/abstract.lux
+++ b/stdlib/source/library/lux/type/abstract.lux
@@ -197,10 +197,7 @@
(def: abstraction_type_name
(-> Name Text)
- (|>> name\encoded
- ($_ text\composite
- (name\encoded (name_of #..Abstraction))
- " ")))
+ name\encoded)
(def: representation_definition_name
(-> Text Text)
diff --git a/stdlib/source/library/lux/type/variance.lux b/stdlib/source/library/lux/type/variance.lux
index 2a7d65267..ae2c889ca 100644
--- a/stdlib/source/library/lux/type/variance.lux
+++ b/stdlib/source/library/lux/type/variance.lux
@@ -2,11 +2,11 @@
[library
[lux #*]])
-(type: .public (Co t)
- (-> Any t))
+(type: .public (Co it)
+ (-> Any it))
-(type: .public (Contra t)
- (-> t Any))
+(type: .public (Contra it)
+ (-> it Any))
-(type: .public (In t)
- (-> t t))
+(type: .public (In it)
+ (-> it it))
diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux
index 438b071ec..2b2d6e01b 100644
--- a/stdlib/source/program/scriptum.lux
+++ b/stdlib/source/program/scriptum.lux
@@ -90,120 +90,120 @@
... (enum.range n.enum 0)
... (list\each (|>> (n.+ (++ offset)) parameter_type_name)))))
-(def: (prefix_lines prefix lines)
- (-> Text Text Text)
- (|> lines
- (text.all_split_by text.new_line)
- (list\each (|>> (format prefix)))
- (text.interposed text.new_line)))
-
-(def: (pprint_type_definition level type_function_info tags module interface? recursive_type? type)
- (-> Nat [Text (List Text)] (List Name) Text Bit Bit Type Text)
- (case tags
- (^ (list [_ single_tag]))
- (if interface?
- (format "(: " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) text.new_line " " single_tag ")")
- (format "{#" single_tag " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) "}"))
+... (def: (prefix_lines prefix lines)
+... (-> Text Text Text)
+... (|> lines
+... (text.all_split_by text.new_line)
+... (list\each (|>> (format prefix)))
+... (text.interposed text.new_line)))
- _
- (case [recursive_type? type]
- [_ (#.Primitive name params)]
- (case params
- #.End
- (format "(primitive " (%.text name) ")")
-
- _
- (format "(primitive " (%.text name) " " (|> params (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
-
- [_ (#.Sum _)]
- (let [members (type.flat_variant type)]
- (case tags
- #.End
- (format "(Or "
- (|> members
- (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?))
- (text.interposed " "))
- ")")
-
- _
- (|> members
- (list.zipped/2 tags)
- (list\each (function (_ [[_ t_name] type])
- (case type
- (#.Product _)
- (let [types (type.flat_tuple type)]
- (format "(#" t_name " "
- (|> types
- (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?))
- (text.interposed " "))
- ")"))
-
- _
- (format "(#" t_name " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) ")"))))
- (text.interposed text.new_line))))
-
- [_ (#.Product _)]
- (let [members (type.flat_tuple type)]
- (case tags
- #.End
- (format "[" (|> members (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) "]")
-
- _
- (let [member_docs (|> members
- (list.zipped/2 tags)
- (list\each (function (_ [[_ t_name] type])
- (if interface?
- (format "(: " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) text.new_line " " t_name ")")
- (format "#" t_name " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type)))))
- (text.interposed (format text.new_line " ")))]
- (if interface?
- member_docs
- (format "{" member_docs "}")))))
-
- [_ (#.Function input output)]
- (let [[ins out] (type.flat_function type)]
- (format "(-> " (|> ins (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " "))
- " "
- (pprint_type_definition level type_function_info #.None module interface? recursive_type? out)
- ")"))
-
- [_ (#.Parameter idx)]
- (parameter_name type_function_info level idx)
-
- (^template [<tag> <pre> <post>]
- [[_ (<tag> id)]
- (format <pre> (%.nat id) <post>)])
- ([#.Var "⌈v:" "⌋"]
- [#.Ex "⟨e:" "⟩"])
-
- (^template [<tag> <name> <flat>]
- [[_ (<tag> _)]
- (let [[level' body] (<flat> type)
- args (level_parameters level level')
- body_doc (pprint_type_definition (n.+ level level') type_function_info tags module interface? recursive_type? body)]
- (format "(" <name> " " "[" (text.interposed " " args) "]"
- (case tags
- #.End
- (format " " body_doc)
+... (def: (pprint_type_definition level type_function_info tags module interface? recursive_type? type)
+... (-> Nat [Text (List Text)] (List Name) Text Bit Bit Type Text)
+... (case tags
+... (^ (list [_ single_tag]))
+... (if interface?
+... (format "(: " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) text.new_line " " single_tag ")")
+... (format "{#" single_tag " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) "}"))
+
+... _
+... (case [recursive_type? type]
+... [_ (#.Primitive name params)]
+... (case params
+... #.End
+... (format "(primitive " (%.text name) ")")
- _
- (format text.new_line (prefix_lines " " body_doc)))
- ")"))])
- ([#.UnivQ "All" type.flat_univ_q]
- [#.ExQ "Ex" type.flat_ex_q])
-
- [true (#.Apply (#.Parameter 1) (#.Parameter 0))]
- (product.left type_function_info)
-
- [_ (#.Apply param fun)]
- (let [[type_func type_arguments] (type.flat_application type)]
- (format "(" (pprint_type_definition level type_function_info tags module interface? recursive_type? type_func) " " (|> type_arguments (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
-
- [_ (#.Named [_module _name] type)]
- (if (text\= module _module)
- _name
- (%.name [_module _name]))
- )))
+... _
+... (format "(primitive " (%.text name) " " (|> params (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
+
+... [_ (#.Sum _)]
+... (let [members (type.flat_variant type)]
+... (case tags
+... #.End
+... (format "(Or "
+... (|> members
+... (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?))
+... (text.interposed " "))
+... ")")
+
+... _
+... (|> members
+... (list.zipped/2 tags)
+... (list\each (function (_ [[_ t_name] type])
+... (case type
+... (#.Product _)
+... (let [types (type.flat_tuple type)]
+... (format "(#" t_name " "
+... (|> types
+... (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?))
+... (text.interposed " "))
+... ")"))
+
+... _
+... (format "(#" t_name " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) ")"))))
+... (text.interposed text.new_line))))
+
+... [_ (#.Product _)]
+... (let [members (type.flat_tuple type)]
+... (case tags
+... #.End
+... (format "[" (|> members (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) "]")
+
+... _
+... (let [member_docs (|> members
+... (list.zipped/2 tags)
+... (list\each (function (_ [[_ t_name] type])
+... (if interface?
+... (format "(: " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type) text.new_line " " t_name ")")
+... (format "#" t_name " " (pprint_type_definition level type_function_info #.None module interface? recursive_type? type)))))
+... (text.interposed (format text.new_line " ")))]
+... (if interface?
+... member_docs
+... (format "{" member_docs "}")))))
+
+... [_ (#.Function input output)]
+... (let [[ins out] (type.flat_function type)]
+... (format "(-> " (|> ins (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " "))
+... " "
+... (pprint_type_definition level type_function_info #.None module interface? recursive_type? out)
+... ")"))
+
+... [_ (#.Parameter idx)]
+... (parameter_name type_function_info level idx)
+
+... (^template [<tag> <pre> <post>]
+... [[_ (<tag> id)]
+... (format <pre> (%.nat id) <post>)])
+... ([#.Var "⌈v:" "⌋"]
+... [#.Ex "⟨e:" "⟩"])
+
+... (^template [<tag> <name> <flat>]
+... [[_ (<tag> _)]
+... (let [[level' body] (<flat> type)
+... args (level_parameters level level')
+... body_doc (pprint_type_definition (n.+ level level') type_function_info tags module interface? recursive_type? body)]
+... (format "(" <name> " " "[" (text.interposed " " args) "]"
+... (case tags
+... #.End
+... (format " " body_doc)
+
+... _
+... (format text.new_line (prefix_lines " " body_doc)))
+... ")"))])
+... ([#.UnivQ "All" type.flat_univ_q]
+... [#.ExQ "Ex" type.flat_ex_q])
+
+... [true (#.Apply (#.Parameter 1) (#.Parameter 0))]
+... (product.left type_function_info)
+
+... [_ (#.Apply param fun)]
+... (let [[type_func type_arguments] (type.flat_application type)]
+... (format "(" (pprint_type_definition level type_function_info tags module interface? recursive_type? type_func) " " (|> type_arguments (list\each (pprint_type_definition level type_function_info #.None module interface? recursive_type?)) (text.interposed " ")) ")"))
+
+... [_ (#.Named [_module _name] type)]
+... (if (text\= module _module)
+... _name
+... (%.name [_module _name]))
+... )))
... (def: (pprint_type level type_function_name module type)
... (-> Nat Text Text Type Text)