File tree 1 file changed +30
-1
lines changed 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
Extract all parts of `obj` that are selected by `optic`.
5
5
Returns a flat `Tuple` of values, or an `AbstractVector` if the selected parts contain arrays.
6
- This function is experimental and we might change the precise output container in future.
6
+
7
+ This function is experimental and we might change the precise output container in the future.
8
+
9
+ See also [`setall`](@ref).
7
10
8
11
9
12
```jldoctest
@@ -20,6 +23,32 @@ julia> getall(obj, @optic _ |> Elements() |> last)
20
23
"""
21
24
function getall end
22
25
26
+ """
27
+ setall(obj, optic, values)
28
+
29
+ Replace a part of `obj` that is selected by `optic` with `values`.
30
+ The `values` collection should have the same number of elements as selected by `optic`.
31
+
32
+ This function is experimental and might change in the future.
33
+
34
+ See also [`getall`](@ref), [`set`](@ref). The former is dual to `setall`:
35
+
36
+ ```jldoctest
37
+ julia> using Accessors
38
+
39
+ julia> obj = (a=1, b=(2, 3));
40
+
41
+ julia> optic = @optic _ |> Elements() |> last;
42
+
43
+ julia> getall(obj, optic)
44
+ (1, 3)
45
+
46
+ julia> setall(obj, optic, (4, 5))
47
+ (a = 4, b = (2, 5))
48
+ ```
49
+ """
50
+ function setall end
51
+
23
52
# implementations for individual noncomposite optics
24
53
25
54
getall (obj:: Union{Tuple, AbstractVector} , :: Elements ) = obj
You can’t perform that action at this time.
0 commit comments