@procedures/optional 0.0.0-stage → 0.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1622 @@
1
+ // The manifest of @mark1russell7/optional 1.2.0, made from its types by `node scripts/wraps.ts generate`. Do not edit it.
2
+ import type { ExportsManifest } from "@procedures/compiler";
3
+
4
+ export const manifest: ExportsManifest = {
5
+ "format": "procedures-exports/1",
6
+ "package": "@mark1russell7/optional",
7
+ "version": "1.2.0",
8
+ "entry": ".",
9
+ "namespace": [
10
+ "optional"
11
+ ],
12
+ "$defs": {
13
+ "Err_E": {
14
+ "type": "object",
15
+ "properties": {
16
+ "tag": {
17
+ "const": "err"
18
+ },
19
+ "error": {}
20
+ },
21
+ "required": [
22
+ "tag",
23
+ "error"
24
+ ]
25
+ },
26
+ "Err_E_2": {
27
+ "type": "object",
28
+ "properties": {
29
+ "tag": {
30
+ "const": "err"
31
+ },
32
+ "error": {}
33
+ },
34
+ "required": [
35
+ "tag",
36
+ "error"
37
+ ]
38
+ },
39
+ "Err_E_3": {
40
+ "type": "object",
41
+ "properties": {
42
+ "tag": {
43
+ "const": "err"
44
+ },
45
+ "error": {}
46
+ },
47
+ "required": [
48
+ "tag",
49
+ "error"
50
+ ]
51
+ },
52
+ "Err_E_4": {
53
+ "type": "object",
54
+ "properties": {
55
+ "tag": {
56
+ "const": "err"
57
+ },
58
+ "error": {}
59
+ },
60
+ "required": [
61
+ "tag",
62
+ "error"
63
+ ]
64
+ },
65
+ "Err_E_5": {
66
+ "type": "object",
67
+ "properties": {
68
+ "tag": {
69
+ "const": "err"
70
+ },
71
+ "error": {}
72
+ },
73
+ "required": [
74
+ "tag",
75
+ "error"
76
+ ]
77
+ },
78
+ "Err_E_6": {
79
+ "type": "object",
80
+ "properties": {
81
+ "tag": {
82
+ "const": "err"
83
+ },
84
+ "error": {}
85
+ },
86
+ "required": [
87
+ "tag",
88
+ "error"
89
+ ]
90
+ },
91
+ "Err_E_7": {
92
+ "type": "object",
93
+ "properties": {
94
+ "tag": {
95
+ "const": "err"
96
+ },
97
+ "error": {}
98
+ },
99
+ "required": [
100
+ "tag",
101
+ "error"
102
+ ]
103
+ },
104
+ "Err_E_8": {
105
+ "type": "object",
106
+ "properties": {
107
+ "tag": {
108
+ "const": "err"
109
+ },
110
+ "error": {}
111
+ },
112
+ "required": [
113
+ "tag",
114
+ "error"
115
+ ]
116
+ },
117
+ "Err_E_9": {
118
+ "type": "object",
119
+ "properties": {
120
+ "tag": {
121
+ "const": "err"
122
+ },
123
+ "error": {}
124
+ },
125
+ "required": [
126
+ "tag",
127
+ "error"
128
+ ]
129
+ },
130
+ "Err_E_F": {
131
+ "type": "object",
132
+ "properties": {
133
+ "tag": {
134
+ "const": "err"
135
+ },
136
+ "error": {}
137
+ },
138
+ "required": [
139
+ "tag",
140
+ "error"
141
+ ]
142
+ },
143
+ "Err_F": {
144
+ "type": "object",
145
+ "properties": {
146
+ "tag": {
147
+ "const": "err"
148
+ },
149
+ "error": {}
150
+ },
151
+ "required": [
152
+ "tag",
153
+ "error"
154
+ ]
155
+ },
156
+ "Err_F_2": {
157
+ "type": "object",
158
+ "properties": {
159
+ "tag": {
160
+ "const": "err"
161
+ },
162
+ "error": {}
163
+ },
164
+ "required": [
165
+ "tag",
166
+ "error"
167
+ ]
168
+ },
169
+ "None": {
170
+ "type": "object",
171
+ "properties": {
172
+ "tag": {
173
+ "const": "none"
174
+ }
175
+ },
176
+ "required": [
177
+ "tag"
178
+ ]
179
+ },
180
+ "Ok_T": {
181
+ "type": "object",
182
+ "properties": {
183
+ "tag": {
184
+ "const": "ok"
185
+ },
186
+ "value": {}
187
+ },
188
+ "required": [
189
+ "tag",
190
+ "value"
191
+ ]
192
+ },
193
+ "Ok_T_2": {
194
+ "type": "object",
195
+ "properties": {
196
+ "tag": {
197
+ "const": "ok"
198
+ },
199
+ "value": {}
200
+ },
201
+ "required": [
202
+ "tag",
203
+ "value"
204
+ ]
205
+ },
206
+ "Ok_T_3": {
207
+ "type": "object",
208
+ "properties": {
209
+ "tag": {
210
+ "const": "ok"
211
+ },
212
+ "value": {}
213
+ },
214
+ "required": [
215
+ "tag",
216
+ "value"
217
+ ]
218
+ },
219
+ "Ok_T_4": {
220
+ "type": "object",
221
+ "properties": {
222
+ "tag": {
223
+ "const": "ok"
224
+ },
225
+ "value": {}
226
+ },
227
+ "required": [
228
+ "tag",
229
+ "value"
230
+ ]
231
+ },
232
+ "Ok_T_5": {
233
+ "type": "object",
234
+ "properties": {
235
+ "tag": {
236
+ "const": "ok"
237
+ },
238
+ "value": {}
239
+ },
240
+ "required": [
241
+ "tag",
242
+ "value"
243
+ ]
244
+ },
245
+ "Ok_T_6": {
246
+ "type": "object",
247
+ "properties": {
248
+ "tag": {
249
+ "const": "ok"
250
+ },
251
+ "value": {}
252
+ },
253
+ "required": [
254
+ "tag",
255
+ "value"
256
+ ]
257
+ },
258
+ "Ok_T_7": {
259
+ "type": "object",
260
+ "properties": {
261
+ "tag": {
262
+ "const": "ok"
263
+ },
264
+ "value": {}
265
+ },
266
+ "required": [
267
+ "tag",
268
+ "value"
269
+ ]
270
+ },
271
+ "Ok_T_8": {
272
+ "type": "object",
273
+ "properties": {
274
+ "tag": {
275
+ "const": "ok"
276
+ },
277
+ "value": {}
278
+ },
279
+ "required": [
280
+ "tag",
281
+ "value"
282
+ ]
283
+ },
284
+ "Ok_T_9": {
285
+ "type": "object",
286
+ "properties": {
287
+ "tag": {
288
+ "const": "ok"
289
+ },
290
+ "value": {}
291
+ },
292
+ "required": [
293
+ "tag",
294
+ "value"
295
+ ]
296
+ },
297
+ "Ok_U": {
298
+ "type": "object",
299
+ "properties": {
300
+ "tag": {
301
+ "const": "ok"
302
+ },
303
+ "value": {}
304
+ },
305
+ "required": [
306
+ "tag",
307
+ "value"
308
+ ]
309
+ },
310
+ "Ok_U_2": {
311
+ "type": "object",
312
+ "properties": {
313
+ "tag": {
314
+ "const": "ok"
315
+ },
316
+ "value": {}
317
+ },
318
+ "required": [
319
+ "tag",
320
+ "value"
321
+ ]
322
+ },
323
+ "Optional_NonNullable_T": {
324
+ "anyOf": [
325
+ {
326
+ "$ref": "#/$defs/None"
327
+ },
328
+ {
329
+ "$ref": "#/$defs/Some_NonNullable_T"
330
+ }
331
+ ]
332
+ },
333
+ "Optional_T": {
334
+ "anyOf": [
335
+ {
336
+ "$ref": "#/$defs/None"
337
+ },
338
+ {
339
+ "$ref": "#/$defs/Some_T"
340
+ }
341
+ ]
342
+ },
343
+ "Optional_T_10": {
344
+ "anyOf": [
345
+ {
346
+ "$ref": "#/$defs/None"
347
+ },
348
+ {
349
+ "$ref": "#/$defs/Some_T_11"
350
+ }
351
+ ]
352
+ },
353
+ "Optional_T_2": {
354
+ "anyOf": [
355
+ {
356
+ "$ref": "#/$defs/None"
357
+ },
358
+ {
359
+ "$ref": "#/$defs/Some_T_2"
360
+ }
361
+ ]
362
+ },
363
+ "Optional_T_3": {
364
+ "anyOf": [
365
+ {
366
+ "$ref": "#/$defs/None"
367
+ },
368
+ {
369
+ "$ref": "#/$defs/Some_T_3"
370
+ }
371
+ ]
372
+ },
373
+ "Optional_T_4": {
374
+ "anyOf": [
375
+ {
376
+ "$ref": "#/$defs/None"
377
+ },
378
+ {
379
+ "$ref": "#/$defs/Some_T_4"
380
+ }
381
+ ]
382
+ },
383
+ "Optional_T_5": {
384
+ "anyOf": [
385
+ {
386
+ "$ref": "#/$defs/None"
387
+ },
388
+ {
389
+ "$ref": "#/$defs/Some_T_5"
390
+ }
391
+ ]
392
+ },
393
+ "Optional_T_6": {
394
+ "anyOf": [
395
+ {
396
+ "$ref": "#/$defs/None"
397
+ },
398
+ {
399
+ "$ref": "#/$defs/Some_T_6"
400
+ }
401
+ ]
402
+ },
403
+ "Optional_T_7": {
404
+ "anyOf": [
405
+ {
406
+ "$ref": "#/$defs/None"
407
+ },
408
+ {
409
+ "$ref": "#/$defs/Some_T_7"
410
+ }
411
+ ]
412
+ },
413
+ "Optional_T_8": {
414
+ "anyOf": [
415
+ {
416
+ "$ref": "#/$defs/None"
417
+ },
418
+ {
419
+ "$ref": "#/$defs/Some_T_9"
420
+ }
421
+ ]
422
+ },
423
+ "Optional_T_9": {
424
+ "anyOf": [
425
+ {
426
+ "$ref": "#/$defs/None"
427
+ },
428
+ {
429
+ "$ref": "#/$defs/Some_T_10"
430
+ }
431
+ ]
432
+ },
433
+ "Optional_U": {
434
+ "anyOf": [
435
+ {
436
+ "$ref": "#/$defs/None"
437
+ },
438
+ {
439
+ "$ref": "#/$defs/Some_U"
440
+ }
441
+ ]
442
+ },
443
+ "Optional_U_2": {
444
+ "anyOf": [
445
+ {
446
+ "$ref": "#/$defs/None"
447
+ },
448
+ {
449
+ "$ref": "#/$defs/Some_U_2"
450
+ }
451
+ ]
452
+ },
453
+ "Result_T_E": {
454
+ "anyOf": [
455
+ {
456
+ "$ref": "#/$defs/Ok_T"
457
+ },
458
+ {
459
+ "$ref": "#/$defs/Err_E_2"
460
+ }
461
+ ]
462
+ },
463
+ "Result_T_E_2": {
464
+ "anyOf": [
465
+ {
466
+ "$ref": "#/$defs/Ok_T_2"
467
+ },
468
+ {
469
+ "$ref": "#/$defs/Err_E_3"
470
+ }
471
+ ]
472
+ },
473
+ "Result_T_E_3": {
474
+ "anyOf": [
475
+ {
476
+ "$ref": "#/$defs/Ok_T_3"
477
+ },
478
+ {
479
+ "$ref": "#/$defs/Err_E_4"
480
+ }
481
+ ]
482
+ },
483
+ "Result_T_E_4": {
484
+ "anyOf": [
485
+ {
486
+ "$ref": "#/$defs/Ok_T_4"
487
+ },
488
+ {
489
+ "$ref": "#/$defs/Err_E_5"
490
+ }
491
+ ]
492
+ },
493
+ "Result_T_E_5": {
494
+ "anyOf": [
495
+ {
496
+ "$ref": "#/$defs/Ok_T_5"
497
+ },
498
+ {
499
+ "$ref": "#/$defs/Err_E_6"
500
+ }
501
+ ]
502
+ },
503
+ "Result_T_E_6": {
504
+ "anyOf": [
505
+ {
506
+ "$ref": "#/$defs/Ok_T_6"
507
+ },
508
+ {
509
+ "$ref": "#/$defs/Err_E_7"
510
+ }
511
+ ]
512
+ },
513
+ "Result_T_E_7": {
514
+ "anyOf": [
515
+ {
516
+ "$ref": "#/$defs/Ok_T_7"
517
+ },
518
+ {
519
+ "$ref": "#/$defs/Err_E_8"
520
+ }
521
+ ]
522
+ },
523
+ "Result_T_E_8": {
524
+ "anyOf": [
525
+ {
526
+ "$ref": "#/$defs/Ok_T_9"
527
+ },
528
+ {
529
+ "$ref": "#/$defs/Err_E_9"
530
+ }
531
+ ]
532
+ },
533
+ "Result_T_F": {
534
+ "anyOf": [
535
+ {
536
+ "$ref": "#/$defs/Ok_T_6"
537
+ },
538
+ {
539
+ "$ref": "#/$defs/Err_F_2"
540
+ }
541
+ ]
542
+ },
543
+ "Result_U_E": {
544
+ "anyOf": [
545
+ {
546
+ "$ref": "#/$defs/Err_E_8"
547
+ },
548
+ {
549
+ "$ref": "#/$defs/Ok_U_2"
550
+ }
551
+ ]
552
+ },
553
+ "Result_U_E_F": {
554
+ "anyOf": [
555
+ {
556
+ "$ref": "#/$defs/Ok_U"
557
+ },
558
+ {
559
+ "$ref": "#/$defs/Err_E_F"
560
+ }
561
+ ]
562
+ },
563
+ "Result_U_F": {
564
+ "anyOf": [
565
+ {
566
+ "$ref": "#/$defs/Ok_U"
567
+ },
568
+ {
569
+ "$ref": "#/$defs/Err_F"
570
+ }
571
+ ]
572
+ },
573
+ "Some_NonNullable_T": {
574
+ "type": "object",
575
+ "properties": {
576
+ "tag": {
577
+ "const": "some"
578
+ },
579
+ "value": {
580
+ "type": [
581
+ "boolean",
582
+ "number",
583
+ "string",
584
+ "array",
585
+ "object"
586
+ ]
587
+ }
588
+ },
589
+ "required": [
590
+ "tag",
591
+ "value"
592
+ ]
593
+ },
594
+ "Some_T": {
595
+ "type": "object",
596
+ "properties": {
597
+ "tag": {
598
+ "const": "some"
599
+ },
600
+ "value": {}
601
+ },
602
+ "required": [
603
+ "tag",
604
+ "value"
605
+ ]
606
+ },
607
+ "Some_T_10": {
608
+ "type": "object",
609
+ "properties": {
610
+ "tag": {
611
+ "const": "some"
612
+ },
613
+ "value": {}
614
+ },
615
+ "required": [
616
+ "tag",
617
+ "value"
618
+ ]
619
+ },
620
+ "Some_T_11": {
621
+ "type": "object",
622
+ "properties": {
623
+ "tag": {
624
+ "const": "some"
625
+ },
626
+ "value": {}
627
+ },
628
+ "required": [
629
+ "tag",
630
+ "value"
631
+ ]
632
+ },
633
+ "Some_T_2": {
634
+ "type": "object",
635
+ "properties": {
636
+ "tag": {
637
+ "const": "some"
638
+ },
639
+ "value": {}
640
+ },
641
+ "required": [
642
+ "tag",
643
+ "value"
644
+ ]
645
+ },
646
+ "Some_T_3": {
647
+ "type": "object",
648
+ "properties": {
649
+ "tag": {
650
+ "const": "some"
651
+ },
652
+ "value": {}
653
+ },
654
+ "required": [
655
+ "tag",
656
+ "value"
657
+ ]
658
+ },
659
+ "Some_T_4": {
660
+ "type": "object",
661
+ "properties": {
662
+ "tag": {
663
+ "const": "some"
664
+ },
665
+ "value": {}
666
+ },
667
+ "required": [
668
+ "tag",
669
+ "value"
670
+ ]
671
+ },
672
+ "Some_T_5": {
673
+ "type": "object",
674
+ "properties": {
675
+ "tag": {
676
+ "const": "some"
677
+ },
678
+ "value": {}
679
+ },
680
+ "required": [
681
+ "tag",
682
+ "value"
683
+ ]
684
+ },
685
+ "Some_T_6": {
686
+ "type": "object",
687
+ "properties": {
688
+ "tag": {
689
+ "const": "some"
690
+ },
691
+ "value": {}
692
+ },
693
+ "required": [
694
+ "tag",
695
+ "value"
696
+ ]
697
+ },
698
+ "Some_T_7": {
699
+ "type": "object",
700
+ "properties": {
701
+ "tag": {
702
+ "const": "some"
703
+ },
704
+ "value": {}
705
+ },
706
+ "required": [
707
+ "tag",
708
+ "value"
709
+ ]
710
+ },
711
+ "Some_T_8": {
712
+ "type": "object",
713
+ "properties": {
714
+ "tag": {
715
+ "const": "some"
716
+ },
717
+ "value": {}
718
+ },
719
+ "required": [
720
+ "tag",
721
+ "value"
722
+ ]
723
+ },
724
+ "Some_T_9": {
725
+ "type": "object",
726
+ "properties": {
727
+ "tag": {
728
+ "const": "some"
729
+ },
730
+ "value": {}
731
+ },
732
+ "required": [
733
+ "tag",
734
+ "value"
735
+ ]
736
+ },
737
+ "Some_U": {
738
+ "type": "object",
739
+ "properties": {
740
+ "tag": {
741
+ "const": "some"
742
+ },
743
+ "value": {}
744
+ },
745
+ "required": [
746
+ "tag",
747
+ "value"
748
+ ]
749
+ },
750
+ "Some_U_2": {
751
+ "type": "object",
752
+ "properties": {
753
+ "tag": {
754
+ "const": "some"
755
+ },
756
+ "value": {}
757
+ },
758
+ "required": [
759
+ "tag",
760
+ "value"
761
+ ]
762
+ }
763
+ },
764
+ "procedures": [
765
+ {
766
+ "name": "err",
767
+ "path": [
768
+ "optional",
769
+ "err"
770
+ ],
771
+ "description": "This function wraps the error of a step that failed.",
772
+ "params": [
773
+ "error"
774
+ ],
775
+ "input": {
776
+ "type": "object",
777
+ "properties": {
778
+ "error": {}
779
+ },
780
+ "required": [
781
+ "error"
782
+ ],
783
+ "additionalProperties": false
784
+ },
785
+ "output": {
786
+ "$ref": "#/$defs/Err_E"
787
+ },
788
+ "generics": [
789
+ "E"
790
+ ],
791
+ "effects": {
792
+ "reads": [],
793
+ "writes": []
794
+ }
795
+ },
796
+ {
797
+ "name": "flatMap",
798
+ "path": [
799
+ "optional",
800
+ "flatMap"
801
+ ],
802
+ "description": "This function applies `f`, which gives an optional, to a present value. An absent value stays absent.",
803
+ "params": [
804
+ "o",
805
+ "f"
806
+ ],
807
+ "input": {
808
+ "type": "object",
809
+ "properties": {
810
+ "o": {
811
+ "$ref": "#/$defs/Optional_T"
812
+ },
813
+ "f": {
814
+ "type": "object",
815
+ "description": "One call of a pure procedure, as data, for the function (v: T) => Optional<U>. It reads each parameter as {\"$ref\": \"<name>\"}: v.",
816
+ "required": [
817
+ "$proc"
818
+ ],
819
+ "properties": {
820
+ "$proc": {
821
+ "type": "array",
822
+ "items": {
823
+ "type": "string"
824
+ },
825
+ "minItems": 1
826
+ },
827
+ "input": {},
828
+ "$when": {
829
+ "const": "$never"
830
+ }
831
+ },
832
+ "x-procedures-program": {
833
+ "params": [
834
+ "v"
835
+ ],
836
+ "inputs": [
837
+ {}
838
+ ],
839
+ "output": {
840
+ "$ref": "#/$defs/Optional_U"
841
+ }
842
+ }
843
+ }
844
+ },
845
+ "required": [
846
+ "o",
847
+ "f"
848
+ ],
849
+ "additionalProperties": false
850
+ },
851
+ "output": {
852
+ "$ref": "#/$defs/Optional_U"
853
+ },
854
+ "generics": [
855
+ "T",
856
+ "U"
857
+ ],
858
+ "effects": {
859
+ "reads": [],
860
+ "writes": []
861
+ }
862
+ },
863
+ {
864
+ "name": "flatMapResult",
865
+ "path": [
866
+ "optional",
867
+ "flatMapResult"
868
+ ],
869
+ "description": "This function applies `f`, which gives a result, to a value. An error stays the same.",
870
+ "params": [
871
+ "r",
872
+ "f"
873
+ ],
874
+ "input": {
875
+ "type": "object",
876
+ "properties": {
877
+ "r": {
878
+ "$ref": "#/$defs/Result_T_E"
879
+ },
880
+ "f": {
881
+ "type": "object",
882
+ "description": "One call of a pure procedure, as data, for the function (v: T) => Result<U, F>. It reads each parameter as {\"$ref\": \"<name>\"}: v.",
883
+ "required": [
884
+ "$proc"
885
+ ],
886
+ "properties": {
887
+ "$proc": {
888
+ "type": "array",
889
+ "items": {
890
+ "type": "string"
891
+ },
892
+ "minItems": 1
893
+ },
894
+ "input": {},
895
+ "$when": {
896
+ "const": "$never"
897
+ }
898
+ },
899
+ "x-procedures-program": {
900
+ "params": [
901
+ "v"
902
+ ],
903
+ "inputs": [
904
+ {}
905
+ ],
906
+ "output": {
907
+ "$ref": "#/$defs/Result_U_F"
908
+ }
909
+ }
910
+ }
911
+ },
912
+ "required": [
913
+ "r",
914
+ "f"
915
+ ],
916
+ "additionalProperties": false
917
+ },
918
+ "output": {
919
+ "$ref": "#/$defs/Result_U_E_F"
920
+ },
921
+ "generics": [
922
+ "T",
923
+ "U",
924
+ "E",
925
+ "F"
926
+ ],
927
+ "effects": {
928
+ "reads": [],
929
+ "writes": []
930
+ }
931
+ },
932
+ {
933
+ "name": "fromNullable",
934
+ "path": [
935
+ "optional",
936
+ "fromNullable"
937
+ ],
938
+ "description": "This function wraps a value, and gives `none` for `null` and `undefined`.",
939
+ "params": [
940
+ "value"
941
+ ],
942
+ "input": {
943
+ "type": "object",
944
+ "properties": {
945
+ "value": {}
946
+ },
947
+ "required": [
948
+ "value"
949
+ ],
950
+ "additionalProperties": false
951
+ },
952
+ "output": {
953
+ "$ref": "#/$defs/Optional_NonNullable_T"
954
+ },
955
+ "generics": [
956
+ "T"
957
+ ],
958
+ "effects": {
959
+ "reads": [],
960
+ "writes": []
961
+ }
962
+ },
963
+ {
964
+ "name": "fromOptional",
965
+ "path": [
966
+ "optional",
967
+ "fromOptional"
968
+ ],
969
+ "description": "This function changes an optional into a result: a present value becomes `ok`, and `none` becomes `err(error)`.",
970
+ "params": [
971
+ "o",
972
+ "error"
973
+ ],
974
+ "input": {
975
+ "type": "object",
976
+ "properties": {
977
+ "o": {
978
+ "$ref": "#/$defs/Optional_T_2"
979
+ },
980
+ "error": {}
981
+ },
982
+ "required": [
983
+ "o",
984
+ "error"
985
+ ],
986
+ "additionalProperties": false
987
+ },
988
+ "output": {
989
+ "$ref": "#/$defs/Result_T_E_2"
990
+ },
991
+ "generics": [
992
+ "T",
993
+ "E"
994
+ ],
995
+ "effects": {
996
+ "reads": [],
997
+ "writes": []
998
+ }
999
+ },
1000
+ {
1001
+ "name": "fromSentinel",
1002
+ "path": [
1003
+ "optional",
1004
+ "fromSentinel"
1005
+ ],
1006
+ "description": "This function changes a value of the sentinel form into an optional. In the sentinel form, the value `sentinel` means \"absent\", for example a symbol `NotFound`.",
1007
+ "params": [
1008
+ "value",
1009
+ "sentinel"
1010
+ ],
1011
+ "input": {
1012
+ "type": "object",
1013
+ "properties": {
1014
+ "value": {},
1015
+ "sentinel": {}
1016
+ },
1017
+ "required": [
1018
+ "value",
1019
+ "sentinel"
1020
+ ],
1021
+ "additionalProperties": false
1022
+ },
1023
+ "output": {
1024
+ "$ref": "#/$defs/Optional_T_3"
1025
+ },
1026
+ "generics": [
1027
+ "T",
1028
+ "S"
1029
+ ],
1030
+ "effects": {
1031
+ "reads": [],
1032
+ "writes": []
1033
+ }
1034
+ },
1035
+ {
1036
+ "name": "getOkOr",
1037
+ "path": [
1038
+ "optional",
1039
+ "getOkOr"
1040
+ ],
1041
+ "description": "This function gives the value, or `fallback` for an error.",
1042
+ "params": [
1043
+ "r",
1044
+ "fallback"
1045
+ ],
1046
+ "input": {
1047
+ "type": "object",
1048
+ "properties": {
1049
+ "r": {
1050
+ "$ref": "#/$defs/Result_T_E_3"
1051
+ },
1052
+ "fallback": {}
1053
+ },
1054
+ "required": [
1055
+ "r",
1056
+ "fallback"
1057
+ ],
1058
+ "additionalProperties": false
1059
+ },
1060
+ "output": {},
1061
+ "generics": [
1062
+ "T",
1063
+ "U",
1064
+ "E"
1065
+ ],
1066
+ "effects": {
1067
+ "reads": [],
1068
+ "writes": []
1069
+ }
1070
+ },
1071
+ {
1072
+ "name": "getOr",
1073
+ "path": [
1074
+ "optional",
1075
+ "getOr"
1076
+ ],
1077
+ "description": "This function gives the present value, or `fallback`.",
1078
+ "params": [
1079
+ "o",
1080
+ "fallback"
1081
+ ],
1082
+ "input": {
1083
+ "type": "object",
1084
+ "properties": {
1085
+ "o": {
1086
+ "$ref": "#/$defs/Optional_T_4"
1087
+ },
1088
+ "fallback": {}
1089
+ },
1090
+ "required": [
1091
+ "o",
1092
+ "fallback"
1093
+ ],
1094
+ "additionalProperties": false
1095
+ },
1096
+ "output": {},
1097
+ "generics": [
1098
+ "T",
1099
+ "U"
1100
+ ],
1101
+ "effects": {
1102
+ "reads": [],
1103
+ "writes": []
1104
+ }
1105
+ },
1106
+ {
1107
+ "name": "isErr",
1108
+ "path": [
1109
+ "optional",
1110
+ "isErr"
1111
+ ],
1112
+ "description": "This function tells if a result is an error.",
1113
+ "params": [
1114
+ "r"
1115
+ ],
1116
+ "input": {
1117
+ "type": "object",
1118
+ "properties": {
1119
+ "r": {
1120
+ "$ref": "#/$defs/Result_T_E_4"
1121
+ }
1122
+ },
1123
+ "required": [
1124
+ "r"
1125
+ ],
1126
+ "additionalProperties": false
1127
+ },
1128
+ "output": {
1129
+ "type": "boolean"
1130
+ },
1131
+ "generics": [
1132
+ "T",
1133
+ "E"
1134
+ ],
1135
+ "effects": {
1136
+ "reads": [],
1137
+ "writes": []
1138
+ }
1139
+ },
1140
+ {
1141
+ "name": "isNone",
1142
+ "path": [
1143
+ "optional",
1144
+ "isNone"
1145
+ ],
1146
+ "description": "This function tells if an optional is absent.",
1147
+ "params": [
1148
+ "o"
1149
+ ],
1150
+ "input": {
1151
+ "type": "object",
1152
+ "properties": {
1153
+ "o": {
1154
+ "$ref": "#/$defs/Optional_T_5"
1155
+ }
1156
+ },
1157
+ "required": [
1158
+ "o"
1159
+ ],
1160
+ "additionalProperties": false
1161
+ },
1162
+ "output": {
1163
+ "type": "boolean"
1164
+ },
1165
+ "generics": [
1166
+ "T"
1167
+ ],
1168
+ "effects": {
1169
+ "reads": [],
1170
+ "writes": []
1171
+ }
1172
+ },
1173
+ {
1174
+ "name": "isOk",
1175
+ "path": [
1176
+ "optional",
1177
+ "isOk"
1178
+ ],
1179
+ "description": "This function tells if a result is a value.",
1180
+ "params": [
1181
+ "r"
1182
+ ],
1183
+ "input": {
1184
+ "type": "object",
1185
+ "properties": {
1186
+ "r": {
1187
+ "$ref": "#/$defs/Result_T_E_5"
1188
+ }
1189
+ },
1190
+ "required": [
1191
+ "r"
1192
+ ],
1193
+ "additionalProperties": false
1194
+ },
1195
+ "output": {
1196
+ "type": "boolean"
1197
+ },
1198
+ "generics": [
1199
+ "T",
1200
+ "E"
1201
+ ],
1202
+ "effects": {
1203
+ "reads": [],
1204
+ "writes": []
1205
+ }
1206
+ },
1207
+ {
1208
+ "name": "isSome",
1209
+ "path": [
1210
+ "optional",
1211
+ "isSome"
1212
+ ],
1213
+ "description": "This function tells if an optional is present.",
1214
+ "params": [
1215
+ "o"
1216
+ ],
1217
+ "input": {
1218
+ "type": "object",
1219
+ "properties": {
1220
+ "o": {
1221
+ "$ref": "#/$defs/Optional_T_6"
1222
+ }
1223
+ },
1224
+ "required": [
1225
+ "o"
1226
+ ],
1227
+ "additionalProperties": false
1228
+ },
1229
+ "output": {
1230
+ "type": "boolean"
1231
+ },
1232
+ "generics": [
1233
+ "T"
1234
+ ],
1235
+ "effects": {
1236
+ "reads": [],
1237
+ "writes": []
1238
+ }
1239
+ },
1240
+ {
1241
+ "name": "map",
1242
+ "path": [
1243
+ "optional",
1244
+ "map"
1245
+ ],
1246
+ "description": "This function applies `f` to a present value. An absent value stays absent.",
1247
+ "params": [
1248
+ "o",
1249
+ "f"
1250
+ ],
1251
+ "input": {
1252
+ "type": "object",
1253
+ "properties": {
1254
+ "o": {
1255
+ "$ref": "#/$defs/Optional_T_7"
1256
+ },
1257
+ "f": {
1258
+ "type": "object",
1259
+ "description": "One call of a pure procedure, as data, for the function (v: T) => U. It reads each parameter as {\"$ref\": \"<name>\"}: v.",
1260
+ "required": [
1261
+ "$proc"
1262
+ ],
1263
+ "properties": {
1264
+ "$proc": {
1265
+ "type": "array",
1266
+ "items": {
1267
+ "type": "string"
1268
+ },
1269
+ "minItems": 1
1270
+ },
1271
+ "input": {},
1272
+ "$when": {
1273
+ "const": "$never"
1274
+ }
1275
+ },
1276
+ "x-procedures-program": {
1277
+ "params": [
1278
+ "v"
1279
+ ],
1280
+ "inputs": [
1281
+ {}
1282
+ ],
1283
+ "output": {}
1284
+ }
1285
+ }
1286
+ },
1287
+ "required": [
1288
+ "o",
1289
+ "f"
1290
+ ],
1291
+ "additionalProperties": false
1292
+ },
1293
+ "output": {
1294
+ "$ref": "#/$defs/Optional_U_2"
1295
+ },
1296
+ "generics": [
1297
+ "T",
1298
+ "U"
1299
+ ],
1300
+ "effects": {
1301
+ "reads": [],
1302
+ "writes": []
1303
+ }
1304
+ },
1305
+ {
1306
+ "name": "mapErr",
1307
+ "path": [
1308
+ "optional",
1309
+ "mapErr"
1310
+ ],
1311
+ "description": "This function applies `f` to an error. A value stays the same.",
1312
+ "params": [
1313
+ "r",
1314
+ "f"
1315
+ ],
1316
+ "input": {
1317
+ "type": "object",
1318
+ "properties": {
1319
+ "r": {
1320
+ "$ref": "#/$defs/Result_T_E_6"
1321
+ },
1322
+ "f": {
1323
+ "type": "object",
1324
+ "description": "One call of a pure procedure, as data, for the function (e: E) => F. It reads each parameter as {\"$ref\": \"<name>\"}: e.",
1325
+ "required": [
1326
+ "$proc"
1327
+ ],
1328
+ "properties": {
1329
+ "$proc": {
1330
+ "type": "array",
1331
+ "items": {
1332
+ "type": "string"
1333
+ },
1334
+ "minItems": 1
1335
+ },
1336
+ "input": {},
1337
+ "$when": {
1338
+ "const": "$never"
1339
+ }
1340
+ },
1341
+ "x-procedures-program": {
1342
+ "params": [
1343
+ "e"
1344
+ ],
1345
+ "inputs": [
1346
+ {}
1347
+ ],
1348
+ "output": {}
1349
+ }
1350
+ }
1351
+ },
1352
+ "required": [
1353
+ "r",
1354
+ "f"
1355
+ ],
1356
+ "additionalProperties": false
1357
+ },
1358
+ "output": {
1359
+ "$ref": "#/$defs/Result_T_F"
1360
+ },
1361
+ "generics": [
1362
+ "T",
1363
+ "E",
1364
+ "F"
1365
+ ],
1366
+ "effects": {
1367
+ "reads": [],
1368
+ "writes": []
1369
+ }
1370
+ },
1371
+ {
1372
+ "name": "mapResult",
1373
+ "path": [
1374
+ "optional",
1375
+ "mapResult"
1376
+ ],
1377
+ "description": "This function applies `f` to a value. An error stays the same.",
1378
+ "params": [
1379
+ "r",
1380
+ "f"
1381
+ ],
1382
+ "input": {
1383
+ "type": "object",
1384
+ "properties": {
1385
+ "r": {
1386
+ "$ref": "#/$defs/Result_T_E_7"
1387
+ },
1388
+ "f": {
1389
+ "type": "object",
1390
+ "description": "One call of a pure procedure, as data, for the function (v: T) => U. It reads each parameter as {\"$ref\": \"<name>\"}: v.",
1391
+ "required": [
1392
+ "$proc"
1393
+ ],
1394
+ "properties": {
1395
+ "$proc": {
1396
+ "type": "array",
1397
+ "items": {
1398
+ "type": "string"
1399
+ },
1400
+ "minItems": 1
1401
+ },
1402
+ "input": {},
1403
+ "$when": {
1404
+ "const": "$never"
1405
+ }
1406
+ },
1407
+ "x-procedures-program": {
1408
+ "params": [
1409
+ "v"
1410
+ ],
1411
+ "inputs": [
1412
+ {}
1413
+ ],
1414
+ "output": {}
1415
+ }
1416
+ }
1417
+ },
1418
+ "required": [
1419
+ "r",
1420
+ "f"
1421
+ ],
1422
+ "additionalProperties": false
1423
+ },
1424
+ "output": {
1425
+ "$ref": "#/$defs/Result_U_E"
1426
+ },
1427
+ "generics": [
1428
+ "T",
1429
+ "U",
1430
+ "E"
1431
+ ],
1432
+ "effects": {
1433
+ "reads": [],
1434
+ "writes": []
1435
+ }
1436
+ },
1437
+ {
1438
+ "name": "ok",
1439
+ "path": [
1440
+ "optional",
1441
+ "ok"
1442
+ ],
1443
+ "description": "This function wraps a value of a step that succeeded.",
1444
+ "params": [
1445
+ "value"
1446
+ ],
1447
+ "input": {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "value": {}
1451
+ },
1452
+ "required": [
1453
+ "value"
1454
+ ],
1455
+ "additionalProperties": false
1456
+ },
1457
+ "output": {
1458
+ "$ref": "#/$defs/Ok_T_8"
1459
+ },
1460
+ "generics": [
1461
+ "T"
1462
+ ],
1463
+ "effects": {
1464
+ "reads": [],
1465
+ "writes": []
1466
+ }
1467
+ },
1468
+ {
1469
+ "name": "some",
1470
+ "path": [
1471
+ "optional",
1472
+ "some"
1473
+ ],
1474
+ "description": "This function wraps a present value.",
1475
+ "params": [
1476
+ "value"
1477
+ ],
1478
+ "input": {
1479
+ "type": "object",
1480
+ "properties": {
1481
+ "value": {}
1482
+ },
1483
+ "required": [
1484
+ "value"
1485
+ ],
1486
+ "additionalProperties": false
1487
+ },
1488
+ "output": {
1489
+ "$ref": "#/$defs/Some_T_8"
1490
+ },
1491
+ "generics": [
1492
+ "T"
1493
+ ],
1494
+ "effects": {
1495
+ "reads": [],
1496
+ "writes": []
1497
+ }
1498
+ },
1499
+ {
1500
+ "name": "toOptional",
1501
+ "path": [
1502
+ "optional",
1503
+ "toOptional"
1504
+ ],
1505
+ "description": "This function changes a result into an optional: a value becomes `some`, and an error becomes `none`.",
1506
+ "params": [
1507
+ "r"
1508
+ ],
1509
+ "input": {
1510
+ "type": "object",
1511
+ "properties": {
1512
+ "r": {
1513
+ "$ref": "#/$defs/Result_T_E_8"
1514
+ }
1515
+ },
1516
+ "required": [
1517
+ "r"
1518
+ ],
1519
+ "additionalProperties": false
1520
+ },
1521
+ "output": {
1522
+ "$ref": "#/$defs/Optional_T_8"
1523
+ },
1524
+ "generics": [
1525
+ "T",
1526
+ "E"
1527
+ ],
1528
+ "effects": {
1529
+ "reads": [],
1530
+ "writes": []
1531
+ }
1532
+ },
1533
+ {
1534
+ "name": "toSentinel",
1535
+ "path": [
1536
+ "optional",
1537
+ "toSentinel"
1538
+ ],
1539
+ "description": "This function changes an optional into the sentinel form: an absent value becomes `sentinel`.",
1540
+ "params": [
1541
+ "o",
1542
+ "sentinel"
1543
+ ],
1544
+ "input": {
1545
+ "type": "object",
1546
+ "properties": {
1547
+ "o": {
1548
+ "$ref": "#/$defs/Optional_T_9"
1549
+ },
1550
+ "sentinel": {}
1551
+ },
1552
+ "required": [
1553
+ "o",
1554
+ "sentinel"
1555
+ ],
1556
+ "additionalProperties": false
1557
+ },
1558
+ "output": {},
1559
+ "generics": [
1560
+ "T",
1561
+ "S"
1562
+ ],
1563
+ "effects": {
1564
+ "reads": [],
1565
+ "writes": []
1566
+ }
1567
+ },
1568
+ {
1569
+ "name": "unwrap",
1570
+ "path": [
1571
+ "optional",
1572
+ "unwrap"
1573
+ ],
1574
+ "description": "This function gives the present value, or `undefined`.",
1575
+ "params": [
1576
+ "o"
1577
+ ],
1578
+ "input": {
1579
+ "type": "object",
1580
+ "properties": {
1581
+ "o": {
1582
+ "$ref": "#/$defs/Optional_T_10"
1583
+ }
1584
+ },
1585
+ "required": [
1586
+ "o"
1587
+ ],
1588
+ "additionalProperties": false
1589
+ },
1590
+ "output": {},
1591
+ "generics": [
1592
+ "T"
1593
+ ],
1594
+ "effects": {
1595
+ "reads": [],
1596
+ "writes": []
1597
+ }
1598
+ }
1599
+ ],
1600
+ "exempt": [
1601
+ {
1602
+ "name": "filter",
1603
+ "reason": "overload",
1604
+ "detail": "2 signatures"
1605
+ },
1606
+ {
1607
+ "name": "tryCatch",
1608
+ "reason": "overload",
1609
+ "detail": "2 signatures"
1610
+ },
1611
+ {
1612
+ "name": "tryCatchAsync",
1613
+ "reason": "overload",
1614
+ "detail": "2 signatures"
1615
+ }
1616
+ ],
1617
+ "others": {
1618
+ "classes": [],
1619
+ "values": 1,
1620
+ "types": 6
1621
+ }
1622
+ };