aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/type/resource.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/documentation/lux/type/resource.lux172
1 files changed, 86 insertions, 86 deletions
diff --git a/stdlib/source/documentation/lux/type/resource.lux b/stdlib/source/documentation/lux/type/resource.lux
index d5615d0dc..fa673174a 100644
--- a/stdlib/source/documentation/lux/type/resource.lux
+++ b/stdlib/source/documentation/lux/type/resource.lux
@@ -10,89 +10,89 @@
[\\library
["[0]" /]])
-(.def .public documentation
- (.List $.Module)
- ($.module /._
- ""
- [($.default /.monad)
- ($.default /.index_cannot_be_repeated)
- ($.default /.amount_cannot_be_zero)
-
- ($.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 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 monad permissions value)
- "A procedure which expands the number of available resources.")
-
- ($.documentation (/.Relevant monad permissions value)
- "A procedure which reduces the number of available resources.")
-
- ($.documentation /.run!
- ""
- [(run! monad procedure)])
-
- ($.documentation /.lifted
- ""
- [(lifted monad procedure)])
-
- ($.documentation /.Ordered
- "The mode of keys which CANNOT be swapped, and for whom order of release/consumption matters.")
-
- ($.documentation /.Commutative
- "The mode of keys which CAN be swapped, and for whom order of release/consumption DOES NOT matters.")
-
- ($.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 key value)
- (format "A resource locked by a key."
- \n "The 'key' represents the right to access/consume a resource."))
-
- (~~ (with_template [<name>]
- [($.documentation <name>
- "Makes a value into a resource and adds the key/access-right to it to the ambient keyring for future use.")]
-
- [/.ordered]
- [/.commutative]
- ))
-
- ($.documentation /.read
- "Access the value of a resource, so long as its key is available."
- [(read monad resource)])
-
- ($.documentation /.exchange
- (format "A function that can exchange the keys for resource, so long as they are commutative."
- \n "This keys will be placed at the front of the keyring in the order they are specified."
- \n "The specific keys must be specified based of their index into the current keyring.")
- [(do (monad !)
- [res|left (commutative ! pre)
- res|right (commutative ! post)
- _ ((exchange [1 0]) !)
- left (read ! res|left)
- right (read ! res|right)]
- (in (format left right)))])
-
- (~~ (with_template [<name>]
- [($.documentation <name>
- "Group/un-group keys in the keyring into/out-of tuples."
- [(do (monad !)
- [res|left (commutative ! pre)
- res|right (commutative ! post)
- _ ((group 2) !)
- _ ((un_group 2) !)
- right (read ! res|right)
- left (read ! res|left)]
- (in (format left right)))])]
-
- [/.group]
- [/.un_group]
- ))]
- []))
+(`` (.def .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [($.default /.monad)
+ ($.default /.index_cannot_be_repeated)
+ ($.default /.amount_cannot_be_zero)
+
+ ($.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 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 monad permissions value)
+ "A procedure which expands the number of available resources.")
+
+ ($.documentation (/.Relevant monad permissions value)
+ "A procedure which reduces the number of available resources.")
+
+ ($.documentation /.run!
+ ""
+ [(run! monad procedure)])
+
+ ($.documentation /.lifted
+ ""
+ [(lifted monad procedure)])
+
+ ($.documentation /.Ordered
+ "The mode of keys which CANNOT be swapped, and for whom order of release/consumption matters.")
+
+ ($.documentation /.Commutative
+ "The mode of keys which CAN be swapped, and for whom order of release/consumption DOES NOT matters.")
+
+ ($.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 key value)
+ (format "A resource locked by a key."
+ \n "The 'key' represents the right to access/consume a resource."))
+
+ (~~ (with_template [<name>]
+ [($.documentation <name>
+ "Makes a value into a resource and adds the key/access-right to it to the ambient keyring for future use.")]
+
+ [/.ordered]
+ [/.commutative]
+ ))
+
+ ($.documentation /.read
+ "Access the value of a resource, so long as its key is available."
+ [(read monad resource)])
+
+ ($.documentation /.exchange
+ (format "A function that can exchange the keys for resource, so long as they are commutative."
+ \n "This keys will be placed at the front of the keyring in the order they are specified."
+ \n "The specific keys must be specified based of their index into the current keyring.")
+ [(do (monad !)
+ [res|left (commutative ! pre)
+ res|right (commutative ! post)
+ _ ((exchange [1 0]) !)
+ left (read ! res|left)
+ right (read ! res|right)]
+ (in (format left right)))])
+
+ (~~ (with_template [<name>]
+ [($.documentation <name>
+ "Group/un-group keys in the keyring into/out-of tuples."
+ [(do (monad !)
+ [res|left (commutative ! pre)
+ res|right (commutative ! post)
+ _ ((group 2) !)
+ _ ((un_group 2) !)
+ right (read ! res|right)
+ left (read ! res|left)]
+ (in (format left right)))])]
+
+ [/.group]
+ [/.un_group]
+ ))]
+ [])))