aboutsummaryrefslogtreecommitdiff
path: root/documentation/book
diff options
context:
space:
mode:
authorEduardo Julian2022-06-16 00:48:19 -0400
committerEduardo Julian2022-06-16 00:48:19 -0400
commit9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch)
tree115fab5bd8a5f53dc0d13ce5453095324a83496f /documentation/book
parentf92c806ee8da63f04bbefbf558f6249bacdb47ea (diff)
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to 'documentation/book')
-rw-r--r--documentation/book/the_lux_programming_language/appendix_c.md8
-rw-r--r--documentation/book/the_lux_programming_language/appendix_e.md4
-rw-r--r--documentation/book/the_lux_programming_language/chapter_10.md4
-rw-r--r--documentation/book/the_lux_programming_language/chapter_11.md6
-rw-r--r--documentation/book/the_lux_programming_language/chapter_14.md2
-rw-r--r--documentation/book/the_lux_programming_language/chapter_16.md4
-rw-r--r--documentation/book/the_lux_programming_language/chapter_17.md4
-rw-r--r--documentation/book/the_lux_programming_language/chapter_4.md20
-rw-r--r--documentation/book/the_lux_programming_language/chapter_5.md12
-rw-r--r--documentation/book/the_lux_programming_language/chapter_7.md14
-rw-r--r--documentation/book/the_lux_programming_language/chapter_8.md26
11 files changed, 52 insertions, 52 deletions
diff --git a/documentation/book/the_lux_programming_language/appendix_c.md b/documentation/book/the_lux_programming_language/appendix_c.md
index 38580fee8..a2c0953cb 100644
--- a/documentation/book/the_lux_programming_language/appendix_c.md
+++ b/documentation/book/the_lux_programming_language/appendix_c.md
@@ -62,7 +62,7 @@ The possibilities are endless when it comes to the refinement you can do, and wh
```clojure
... Allows you to simultaneously bind and de-structure a value.
-(def: (hash (^@ set [element_hash _]))
+(def (hash (^@ set [element_hash _]))
(list#mix (function (_ elem acc)
(n.+ (# element_hash hash elem) acc))
0
@@ -74,7 +74,7 @@ The possibilities are endless when it comes to the refinement you can do, and wh
```clojure
... Same as the "open" macro, but meant to be used as a pattern-matching macro for generating local bindings.
... Can optionally take an aliasing text for the generated local bindings.
-(def: .public (range (^open "[0]") from to)
+(def .public (range (^open "[0]") from to)
(All (_ a) (-> (Enum a) a a (List a)))
(range' <= succ from to))
```
@@ -95,7 +95,7 @@ It's excellent when taking structures as function arguments, or when opening str
{#Friday}
{#Saturday}))
-(def: (weekend? day)
+(def (weekend? day)
(-> Day Bit)
(case day
(^or {#Saturday} {#Sunday})
@@ -111,7 +111,7 @@ It's a real time-saver.
```clojure
... It's similar to do-template, but meant to be used during pattern-matching.
-(def: (beta_reduce env type)
+(def (beta_reduce env type)
(-> (List Type) Type Type)
(case type
{.#Primitive name params}
diff --git a/documentation/book/the_lux_programming_language/appendix_e.md b/documentation/book/the_lux_programming_language/appendix_e.md
index 4ce648625..b31ec03d0 100644
--- a/documentation/book/the_lux_programming_language/appendix_e.md
+++ b/documentation/book/the_lux_programming_language/appendix_e.md
@@ -93,7 +93,7 @@ Here are some examples from the `library/lux/ffi` module, where I have some type
{#ProtectedP}
{#DefaultP}))
-(def: privacy_modifier^
+(def privacy_modifier^
(Parser Privacy)
(let [(^open "[0]") <>.monad]
($_ <>.or
@@ -121,7 +121,7 @@ Here's an example of `<>.and` in action:
[Text (Type Value)])
... From library/lux/ffi
-(def: (argument^ type_vars)
+(def (argument^ type_vars)
(-> (List (Type Var)) (Parser Argument))
(<code>.tuple (<>.and <code>.local_symbol
(..type^ type_vars))))
diff --git a/documentation/book/the_lux_programming_language/chapter_10.md b/documentation/book/the_lux_programming_language/chapter_10.md
index d2937a83b..6c86c9671 100644
--- a/documentation/book/the_lux_programming_language/chapter_10.md
+++ b/documentation/book/the_lux_programming_language/chapter_10.md
@@ -130,7 +130,7 @@ The beautiful thing is that `(' (you can use the "'" #macro [to generate {arbitr
... Hygienic quasi-quotation as a macro.
... Unquote (~) and unquote-splice (~+) must also be used as forms.
... All unprefixed symbols will receive their parent module's prefix if imported; otherwise will receive the prefix of the module on which the quasi-quote is being used.
-(` (def: (~ name)
+(` (def (~ name)
(function ((~ name) (~+ args))
(~ body))))
```
@@ -154,7 +154,7 @@ With these tools, you can introduce a lot of complexity and customization into y
```clojure
... Unhygienic quasi-quotation as a macro.
... Unquote (~) and unquote-splice (~+) must also be used as forms.
-(`' (def: (~ name)
+(`' (def (~ name)
(function ((~ name) (~+ args))
(~ body))))
```
diff --git a/documentation/book/the_lux_programming_language/chapter_11.md b/documentation/book/the_lux_programming_language/chapter_11.md
index e3e73d97a..56115b830 100644
--- a/documentation/book/the_lux_programming_language/chapter_11.md
+++ b/documentation/book/the_lux_programming_language/chapter_11.md
@@ -104,7 +104,7 @@ Here is an example:
{#Unary Code Infix}
{#Binary Infix Code Infix})))
-(def: literal
+(def literal
(Parser Code)
($_ <>.either
(<>#each code.bit <code>.bit)
@@ -115,7 +115,7 @@ Here is an example:
(<>#each code.text <code>.text)
(<>#each code.symbol <code>.symbol)))
-(def: expression
+(def expression
(Parser Infix)
(<| <>.rec (function (_ expression))
($_ <>.or
@@ -139,7 +139,7 @@ And here are some examples of syntax macros:
```clojure
... Also from library/lux/math/infix.
-(def: (prefix infix)
+(def (prefix infix)
(-> Infix Code)
(case infix
{#Const value}
diff --git a/documentation/book/the_lux_programming_language/chapter_14.md b/documentation/book/the_lux_programming_language/chapter_14.md
index 5552c3347..2fd53c5bb 100644
--- a/documentation/book/the_lux_programming_language/chapter_14.md
+++ b/documentation/book/the_lux_programming_language/chapter_14.md
@@ -51,7 +51,7 @@ The result is that, through the `do` macro, you can implement complex concurrent
If you're curious about how that looks, take a peek:
```clojure
-(def: .public (and left right)
+(def .public (and left right)
(All (_ a b) (-> (Async a) (Async b) (Async [a b])))
(do monad
[a left
diff --git a/documentation/book/the_lux_programming_language/chapter_16.md b/documentation/book/the_lux_programming_language/chapter_16.md
index d5ece9f9b..be5456dbf 100644
--- a/documentation/book/the_lux_programming_language/chapter_16.md
+++ b/documentation/book/the_lux_programming_language/chapter_16.md
@@ -100,11 +100,11 @@ To know how tests work, let's take a look at one of those modules.
[\\library
["[0]" /]])
-(def: (injection value)
+(def (injection value)
(Injection /.Stack)
(/.top value /.empty))
-(def: .public test
+(def .public test
Test
(<| (_.covering /._)
(_.for [/.Stack])
diff --git a/documentation/book/the_lux_programming_language/chapter_17.md b/documentation/book/the_lux_programming_language/chapter_17.md
index 73ece8cb5..e13693d89 100644
--- a/documentation/book/the_lux_programming_language/chapter_17.md
+++ b/documentation/book/the_lux_programming_language/chapter_17.md
@@ -100,7 +100,7 @@ And the other is meant for when the changes are so massive, you might as well ju
First, let's go with the smaller mechanism:
```clojure
-(def: js "JavaScript")
+(def js "JavaScript")
(for ["JVM" (do jvm stuff)
..js (do js stuff)]
@@ -129,7 +129,7 @@ The module `library/lux/target` contains constants with the names of currently s
To give you an example of `for` in action, here is a definition from the `library/lux/data/text` module:
```clojure
-(def: .public (replaced pattern replacement template)
+(def .public (replaced pattern replacement template)
(-> Text Text Text Text)
(for [@.old
(:as Text
diff --git a/documentation/book/the_lux_programming_language/chapter_4.md b/documentation/book/the_lux_programming_language/chapter_4.md
index ebb58a78e..5dfa20328 100644
--- a/documentation/book/the_lux_programming_language/chapter_4.md
+++ b/documentation/book/the_lux_programming_language/chapter_4.md
@@ -52,7 +52,7 @@ How do we use the `plus_two` function without having to inline its definition (l
Well, we just need to define it!
```clojure
-(def: plus_two
+(def plus_two
(: (-> Nat Nat)
(function (_ x)
(++ (++ x)))))
@@ -61,13 +61,13 @@ Well, we just need to define it!
Or, alternatively:
```clojure
-(def: plus_two
+(def plus_two
(-> Nat Nat)
(function (_ x)
(++ (++ x))))
```
-Notice how the `def:` macro can take the type of its value before the value itself, so we don't need to wrap it in the type-annotation `:` macro.
+Notice how the `def` macro can take the type of its value before the value itself, so we don't need to wrap it in the type-annotation `:` macro.
Now, we can use the square function more conveniently.
@@ -78,15 +78,15 @@ Now, we can use the square function more conveniently.
Nice!
-Also, I forgot to mention another form of the `def:` macro which is even more convenient:
+Also, I forgot to mention another form of the `def` macro which is even more convenient:
```clojure
-(def: (plus_two x)
+(def (plus_two x)
(-> Nat Nat)
(++ (++ x)))
```
-The `def:` macro is very versatile, and it allows us to define constants and functions.
+The `def` macro is very versatile, and it allows us to define constants and functions.
If you omit the type, the compiler will try to infer it for you, and you will get an error if there are any ambiguities.
@@ -103,13 +103,13 @@ Functions, of course, can take more than one argument, and you can even refer to
Check this one out:
```clojure
-(def: (factorial' acc n)
+(def (factorial' acc n)
(-> Nat Nat Nat)
(if (n.= 0 n)
acc
(factorial' (n.* n acc) (-- n))))
-(def: (factorial n)
+(def (factorial n)
(-> Nat Nat)
(factorial' 1 n))
```
@@ -155,7 +155,7 @@ This means that if a function takes N arguments, and you give it M arguments, wh
That means, our factorial function could have been implemented like this:
```clojure
-(def: factorial
+(def factorial
(-> Nat Nat)
(factorial' 1))
```
@@ -163,7 +163,7 @@ That means, our factorial function could have been implemented like this:
Or, to make it shorter:
```clojure
-(def: factorial (factorial' 1))
+(def factorial (factorial' 1))
```
Nice, huh?
diff --git a/documentation/book/the_lux_programming_language/chapter_5.md b/documentation/book/the_lux_programming_language/chapter_5.md
index a7d09016a..fe36dc46d 100644
--- a/documentation/book/the_lux_programming_language/chapter_5.md
+++ b/documentation/book/the_lux_programming_language/chapter_5.md
@@ -100,7 +100,7 @@ We can see its power by looking at some examples.
For instance, the `factorial'` function you saw in the previous chapter could have been written like this:
```clojure
-(def: (factorial' acc n)
+(def (factorial' acc n)
(-> Nat Nat Nat)
(case n
0 acc
@@ -121,7 +121,7 @@ The _"default"_ branch works because we're binding the value of `n` onto a varia
However, since it is binding a variable, that means we could have used `_` instead of `n` during our calculations; like this:
```clojure
-(def: (factorial' acc n)
+(def (factorial' acc n)
(-> Nat Nat Nat)
(case n
0 acc
@@ -221,7 +221,7 @@ Recursion is nothing more than the capacity for a function to call itself (often
It's not hard to see how this mechanism can be used to loop in any way you want, and we've already seen examples of recursion in action.
```clojure
-(def: (factorial' acc n)
+(def (factorial' acc n)
(-> Nat Nat Nat)
(if (n.= 0 n)
acc
@@ -241,7 +241,7 @@ Our example `factorial'` function has its recursive call in the _tail position_
This alternative doesn't:
```clojure
-(def: (factorial' acc n)
+(def (factorial' acc n)
(-> Nat Nat Nat)
(if (n.= 0 n)
acc
@@ -269,7 +269,7 @@ Lux also offers a macro that gives you a slightly similar experience to those ki
To see it in action, let's rewrite (once more!) our `factorial` function:
```clojure
-(def: (factorial n)
+(def (factorial n)
(-> Nat Nat)
(loop [acc 1
n n]
@@ -346,7 +346,7 @@ Well, we haven't really seen that in action yet.
It's time to put that theory into practice... with an example:
```clojure
-(def: (iterate_list f list)
+(def (iterate_list f list)
(All (_ a b) (-> (-> a b) (List a) (List b)))
(case list
{.#End}
diff --git a/documentation/book/the_lux_programming_language/chapter_7.md b/documentation/book/the_lux_programming_language/chapter_7.md
index bf888680f..53bc97890 100644
--- a/documentation/book/the_lux_programming_language/chapter_7.md
+++ b/documentation/book/the_lux_programming_language/chapter_7.md
@@ -102,9 +102,9 @@ Let's take a look at how you make one:
(implementation: .public order
(Order Frac)
- (def: &equivalence ..equivalence)
+ (def &equivalence ..equivalence)
- (def: < ..<))
+ (def < ..<))
```
This implementation comes from `library/lux/math/number/frac`.
@@ -120,10 +120,10 @@ Here is another example, from the `library/lux/data/collection/list` module:
(All (_ a)
(Monoid (List a)))
- (def: identity
+ (def identity
{.#End})
- (def: (compose xs ys)
+ (def (compose xs ys)
(case xs
{.#End} ys
{.#Item x xs'} {.#Item x (compose xs' ys)})))
@@ -166,8 +166,8 @@ Let's check them out.
(open library/lux/math/number/int.order "i::[0]")
... Will generate:
-(def: .private i::= (# library/lux/math/number/int.order =))
-(def: .private i::< (# library/lux/math/number/int.order <))
+(def .private i::= (# library/lux/math/number/int.order =))
+(def .private i::< (# library/lux/math/number/int.order <))
```
The `open:` macro serves as a directive that creates private/un-exported definitions in your module for every member of a particular implementation.
@@ -206,7 +206,7 @@ I can't emphasize enough that _implementations_ are values.
And to exemplify it for you, here's a function from the `library/lux/abstract/monad` module that takes in an implementation (among other things) and uses it within its code:
```clojure
-(def: .public (each monad f xs)
+(def .public (each monad f xs)
(All (_ M a b)
(-> (Monad M) (-> a (M b)) (List a) (M (List b))))
(case xs
diff --git a/documentation/book/the_lux_programming_language/chapter_8.md b/documentation/book/the_lux_programming_language/chapter_8.md
index 5f15eced5..8c262b355 100644
--- a/documentation/book/the_lux_programming_language/chapter_8.md
+++ b/documentation/book/the_lux_programming_language/chapter_8.md
@@ -76,7 +76,7 @@ Here is its `Functor` implementation.
(implementation: .public functor
(Functor Maybe)
- (def: (each f ma)
+ (def (each f ma)
(case ma
{.#None} {.#None}
{.#Some a} {.#Some (f a)})))
@@ -107,7 +107,7 @@ Turns out, that's just the `Functor` implementation from `library/lux/data/colle
(implementation: .public functor
(Functor List)
- (def: (each f ma)
+ (def (each f ma)
(case ma
{.#End} {.#End}
{.#Item a ma'} {.#Item (f a) (each f ma')})))
@@ -175,7 +175,7 @@ Here are the relevant `Functor` and `Monad` implementations:
(implementation: .public functor
(Functor Try)
- (def: (each f ma)
+ (def (each f ma)
(case ma
{#Failure msg}
{#Failure msg}
@@ -186,12 +186,12 @@ Here are the relevant `Functor` and `Monad` implementations:
(implementation: .public monad
(Monad Try)
- (def: &functor ..functor)
+ (def &functor ..functor)
- (def: (in a)
+ (def (in a)
{#Success a})
- (def: (join mma)
+ (def (join mma)
(case mma
{#Failure msg}
{#Failure msg}
@@ -235,7 +235,7 @@ Not really. It's just the `Monad` for `List`:
(implementation: .public functor
(Functor List)
- (def: (each f ma)
+ (def (each f ma)
(case ma
{.#End}
{.#End}
@@ -246,7 +246,7 @@ Not really. It's just the `Monad` for `List`:
(implementation: .public mix
(Mix List)
- (def: (mix f init xs)
+ (def (mix f init xs)
(case xs
{.#End}
init
@@ -257,10 +257,10 @@ Not really. It's just the `Monad` for `List`:
(implementation: .public monoid
(All (_ a) (Monoid (List a)))
- (def: identity
+ (def identity
{.#End})
- (def: (composite xs ys)
+ (def (composite xs ys)
(case xs
{.#End}
ys
@@ -273,12 +273,12 @@ Not really. It's just the `Monad` for `List`:
(implementation: .public monad
(Monad List)
- (def: &functor ..functor)
+ (def &functor ..functor)
- (def: (in a)
+ (def (in a)
{.#Item a {.#End}})
- (def: (conjoint list_of_lists)
+ (def (conjoint list_of_lists)
(mix composite
identity
(reversed list_of_lists))))