aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation/lux.lux')
-rw-r--r--stdlib/source/documentation/lux.lux67
1 files changed, 33 insertions, 34 deletions
diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux
index 0f6e94998..cf7137856 100644
--- a/stdlib/source/documentation/lux.lux
+++ b/stdlib/source/documentation/lux.lux
@@ -354,11 +354,11 @@
\n "Allows the usage of macros within the patterns to provide custom syntax.")
[(case (: (List Int)
(list +1 +2 +3))
- {#Item x {#Item y {#Item z #End}}}
+ {#Item x {#Item y {#Item z {#End}}}}
{#Some ($_ * x y z)}
_
- #None)])
+ {#None})])
(documentation: /.^
(format "Macro-expanding patterns."
@@ -369,25 +369,25 @@
{#Some ($_ * x y z)}
_
- #None)])
+ {#None})])
(documentation: /.^or
(format "Or-patterns."
\n "It's a special macro meant to be used with 'case'.")
[(type: Weekday
(Variant
- #Monday
- #Tuesday
- #Wednesday
- #Thursday
- #Friday
- #Saturday
- #Sunday))
+ {#Monday}
+ {#Tuesday}
+ {#Wednesday}
+ {#Thursday}
+ {#Friday}
+ {#Saturday}
+ {#Sunday}))
(def: (weekend? day)
(-> Weekday Bit)
(case day
- (^or #Saturday #Sunday)
+ (^or {#Saturday} {#Sunday})
#1
_
@@ -488,11 +488,11 @@
\n "WARNING: Only use it within the type: macro.")
[(type: Referrals
(Variant
- #All
+ {#All}
{#Only (List Text)}
{#Exclude (List Text)}
- #Ignore
- #Nothing))])
+ {#Ignore}
+ {#Nothing}))])
(documentation: /.Record
(format "Syntax for defining labelled/slotted product/tuple types."
@@ -505,7 +505,7 @@
(documentation: /.type:
"The type-definition macro."
[(type: (List a)
- #End
+ {#End}
{#Item a (List a)})])
(documentation: /.Interface
@@ -538,15 +538,15 @@
(All (_ a) (-> (Enum a) a a (List a)))
(let [(^open "[0]") enum]
(loop [end to
- output #.End]
+ output {.#End}]
(cond (< end from)
- (recur (pred end) {#.Item end output})
+ (recur (pred end) {.#Item end output})
(< from end)
- (recur (succ end) {#.Item end output})
+ (recur (succ end) {.#Item end output})
... (= end from)
- {#.Item end output}))))])
+ {.#Item end output}))))])
(documentation: /.cond
"Conditional branching with multiple test conditions."
@@ -640,30 +640,30 @@
[(def: (reduced env type)
(-> (List Type) Type Type)
(case type
- {#.Primitive name params}
- {#.Primitive name (list\each (reduced env) params)}
+ {.#Primitive name params}
+ {.#Primitive name (list\each (reduced env) params)}
(^template [<tag>]
[{<tag> left right}
{<tag> (reduced env left) (reduced env right)}])
- ([#.Sum] [#.Product])
+ ([.#Sum] [.#Product])
(^template [<tag>]
[{<tag> left right}
{<tag> (reduced env left) (reduced env right)}])
- ([#.Function] [#.Apply])
+ ([.#Function] [.#Apply])
(^template [<tag>]
[{<tag> old_env def}
(case old_env
- #.End
+ {.#End}
{<tag> env def}
_
type)])
- ([#.UnivQ] [#.ExQ])
+ ([.#UnivQ] [.#ExQ])
- {#.Parameter idx}
+ {.#Parameter idx}
(else type (list.item idx env))
_
@@ -715,7 +715,6 @@
[int +123 "+123"]
[frac +123.0 "+123.0"]
[text "123" "'123'"]
- [tag ["yolo" "lol"] "#yolo.lol"]
[identifier ["yolo" "lol"] "yolo.lol"]
[form (list (bit #1)) "(#1)"]
[tuple (list (bit #1)) "[#1]"]
@@ -769,9 +768,9 @@
(documentation: /.name_of
"Given an identifier or a tag, gives back a 2 tuple with the module and name parts, both as Text."
- [(name_of #..doc)
+ [(name_of ..#doc)
"=>"
- ["documentation/lux" "doc"]])
+ ["documentation/lux" "#doc"]])
(documentation: /.:parameter
(format "WARNING: Please stay away from this macro; it's very likely to be removed in a future version of Lux."
@@ -875,11 +874,11 @@
"Generates pattern-matching code for Code values in a way that looks like code-templating."
[(: (Maybe Nat)
(case (` (#0 123 +456.789))
- (^code (#0 (~ [_ {#.Nat number}]) +456.789))
- {#.Some number}
+ (^code (#0 (~ [_ {.#Nat number}]) +456.789))
+ {.#Some number}
_
- #.None))])
+ {.#None}))])
(documentation: /.false
"The boolean FALSE value.")
@@ -898,11 +897,11 @@
(case (: (Either Text Bar)
(try (: Bar
(risky computation which may panic))))
- {#.Right success}
+ {.#Right success}
(: Foo
(do something after success))
- {#.Left error}
+ {.#Left error}
(: Foo
(recover from error))))])