2020-02-14 02:57:17 +03:00
|
|
|
|
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
|
2020-02-14 03:01:42 +03:00
|
|
|
|
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
|
2020-02-14 02:57:17 +03:00
|
|
|
|
|
2024-07-15 21:10:27 +03:00
|
|
|
|
```
|
|
|
|
|
scratch/main> help alias.many
|
|
|
|
|
|
|
|
|
|
alias.many (or copy)
|
|
|
|
|
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
|
|
|
|
|
in the namespace `namespace`.
|
|
|
|
|
`alias.many foo.foo bar.bar .quux` creates aliases `.quux.foo.foo` and `.quux.bar.bar`.
|
|
|
|
|
```
|
2020-02-14 03:12:38 +03:00
|
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
|
Let's try it\!
|
2020-02-14 02:57:17 +03:00
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
|
``` ucm
|
2024-06-25 21:16:51 +03:00
|
|
|
|
scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib
|
2020-02-14 02:57:17 +03:00
|
|
|
|
|
2024-06-25 21:16:51 +03:00
|
|
|
|
Here's what changed in mylib :
|
2020-02-14 02:57:17 +03:00
|
|
|
|
|
2024-06-25 21:16:51 +03:00
|
|
|
|
Added definitions:
|
|
|
|
|
|
|
|
|
|
1. List.adjacentPairs : [a] -> [(a, a)]
|
|
|
|
|
2. List.all : (a ->{g} Boolean)
|
|
|
|
|
-> [a]
|
|
|
|
|
->{g} Boolean
|
|
|
|
|
3. List.any : (a ->{g} Boolean)
|
|
|
|
|
-> [a]
|
|
|
|
|
->{g} Boolean
|
|
|
|
|
4. List.chunk : Nat -> [a] -> [[a]]
|
|
|
|
|
5. List.chunksOf : Nat -> [a] -> [[a]]
|
|
|
|
|
6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
|
|
|
|
|
7. List.first : [a] -> Optional a
|
|
|
|
|
8. List.init : [a] -> Optional [a]
|
|
|
|
|
9. List.intersperse : a -> [a] -> [a]
|
|
|
|
|
10. List.isEmpty : [a] -> Boolean
|
|
|
|
|
11. List.last : [a] -> Optional a
|
|
|
|
|
12. List.replicate : Nat -> a -> [a]
|
|
|
|
|
13. List.splitAt : Nat -> [a] -> ([a], [a])
|
|
|
|
|
14. List.tail : [a] -> Optional [a]
|
|
|
|
|
15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
|
|
|
|
|
|
2024-07-23 00:36:51 +03:00
|
|
|
|
Tip: You can use `undo` or use a hash from `reflog` to undo
|
|
|
|
|
this change.
|
2024-06-12 01:22:09 +03:00
|
|
|
|
|
2024-06-25 21:16:51 +03:00
|
|
|
|
scratch/main> find-in mylib
|
2024-06-12 01:22:09 +03:00
|
|
|
|
|
2024-06-25 21:16:51 +03:00
|
|
|
|
1. List.adjacentPairs : [a] -> [(a, a)]
|
|
|
|
|
2. List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
|
|
|
|
3. List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
|
|
|
|
4. List.chunk : Nat -> [a] -> [[a]]
|
|
|
|
|
5. List.chunksOf : Nat -> [a] -> [[a]]
|
|
|
|
|
6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
|
|
|
|
|
7. List.first : [a] -> Optional a
|
|
|
|
|
8. List.init : [a] -> Optional [a]
|
|
|
|
|
9. List.intersperse : a -> [a] -> [a]
|
|
|
|
|
10. List.isEmpty : [a] -> Boolean
|
|
|
|
|
11. List.last : [a] -> Optional a
|
|
|
|
|
12. List.replicate : Nat -> a -> [a]
|
|
|
|
|
13. List.splitAt : Nat -> [a] -> ([a], [a])
|
|
|
|
|
14. List.tail : [a] -> Optional [a]
|
|
|
|
|
15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
|
2020-02-14 02:57:17 +03:00
|
|
|
|
|
|
|
|
|
|
2024-06-25 21:16:51 +03:00
|
|
|
|
```
|
2024-07-10 17:46:18 +03:00
|
|
|
|
Thanks, `alias.many`\!
|
|
|
|
|
|