File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ to use containers with `pure functions <https://en.wikipedia.org/wiki/Pure_funct
115
115
result = Success(1 ).map(double)
116
116
# => Will be equal to Success(2)
117
117
118
+ Note::
119
+
120
+ All containers support these methods.
121
+
118
122
Returning execution to the right track
119
123
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
124
@@ -156,6 +160,11 @@ It can also fix your flow and get on the successful track again:
156
160
Failure(ZeroDivisionError ).rescue(fix)
157
161
# => Will be equal to Success(0)
158
162
163
+ Note::
164
+
165
+ Not all containers support these methods.
166
+ IO cannot be fixed or rescued.
167
+
159
168
Unwrapping values
160
169
~~~~~~~~~~~~~~~~~
161
170
@@ -200,6 +209,11 @@ to unwrap the failed state:
200
209
Be careful, since this method will raise an exception
201
210
when you try to ``failure `` a successful container.
202
211
212
+ Note::
213
+
214
+ Not all containers support these methods.
215
+ IO cannot be unwrapped.
216
+
203
217
204
218
Immutability
205
219
------------
Original file line number Diff line number Diff line change 5
5
6
6
Why? Let me illustrate it with the example.
7
7
8
- IO container
9
- ------------
8
+ IO marker
9
+ ---------
10
10
11
11
Imagine we have this beautiful pure function:
12
12
You can’t perform that action at this time.
0 commit comments