@fncts/base 0.0.3 → 0.0.6
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.
- package/_cjs/collection/Iterable/api/traverseConc.cjs +21 -15
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/Iterable/api.cjs +23 -37
- package/_cjs/collection/Iterable/api.cjs.map +1 -1
- package/_cjs/collection/compat/Array/api.cjs +1 -1
- package/_cjs/collection/compat/Array/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +41 -53
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +49 -39
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/definition.cjs +4 -2
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +35 -108
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +19 -15
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/api.cjs +10 -10
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs +22 -0
- package/_cjs/collection/immutable/ImmutableArray/api/chunksOf.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs +20 -0
- package/_cjs/collection/immutable/ImmutableArray/api/slice.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs +20 -0
- package/_cjs/collection/immutable/ImmutableArray/api/splitAt.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs +33 -0
- package/_cjs/collection/immutable/ImmutableArray/api/splitWhere.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +252 -409
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +12 -10
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +153 -157
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray.cjs +52 -0
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +125 -184
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +2 -4
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +25 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs +5 -3
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/destructors.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +45 -81
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api.cjs +4 -7
- package/_cjs/collection/immutable/List/api.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/api.cjs +484 -0
- package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -0
- package/_cjs/collection/immutable/RoseTree/definition.cjs +58 -0
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -0
- package/_cjs/collection/immutable/RoseTree.cjs +32 -0
- package/_cjs/collection/immutable/RoseTree.cjs.map +1 -0
- package/_cjs/collection/immutable/SortedMap/api.cjs +65 -65
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +70 -15
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +13 -11
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/mutable/HashMap.cjs +5 -5
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable/HashSet.cjs +4 -4
- package/_cjs/collection/mutable/HashSet.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +6 -0
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/definition.cjs +7 -0
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +14 -25
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Z/definition.cjs +9 -3
- package/_cjs/control/Z/definition.cjs.map +1 -1
- package/_cjs/control/Z/instances.cjs +6 -13
- package/_cjs/control/Z/instances.cjs.map +1 -1
- package/_cjs/data/Branded/definition.cjs +29 -0
- package/_cjs/data/Branded/definition.cjs.map +1 -0
- package/_cjs/data/Branded/derivations.cjs +58 -0
- package/_cjs/data/Branded/derivations.cjs.map +1 -0
- package/_cjs/data/Branded.cjs +32 -0
- package/_cjs/data/Branded.cjs.map +1 -0
- package/_cjs/data/CaseClass.cjs +4 -2
- package/_cjs/data/CaseClass.cjs.map +1 -1
- package/_cjs/data/Cause/api/fold.cjs +2 -0
- package/_cjs/data/Cause/api/fold.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +23 -0
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Const/api.cjs +3 -7
- package/_cjs/data/Const/api.cjs.map +1 -1
- package/_cjs/data/Const/definition.cjs +19 -1
- package/_cjs/data/Const/definition.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +9 -20
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/DecodeError/definition.cjs +308 -0
- package/_cjs/data/DecodeError/definition.cjs.map +1 -0
- package/_cjs/data/DecodeError.cjs +19 -0
- package/_cjs/data/DecodeError.cjs.map +1 -0
- package/_cjs/data/Decoder/api.cjs +217 -0
- package/_cjs/data/Decoder/api.cjs.map +1 -0
- package/_cjs/data/Decoder/definition.cjs +41 -0
- package/_cjs/data/Decoder/definition.cjs.map +1 -0
- package/_cjs/data/Decoder.cjs +32 -0
- package/_cjs/data/Decoder.cjs.map +1 -0
- package/_cjs/data/Duration/api.cjs +22 -9
- package/_cjs/data/Duration/api.cjs.map +1 -1
- package/_cjs/data/Either/api/alignWith.cjs +2 -0
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +105 -42
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +39 -10
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/destructors.cjs +2 -0
- package/_cjs/data/Either/destructors.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +123 -40
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/Environment/api.cjs +29 -8
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +35 -6
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/definition.cjs +10 -1
- package/_cjs/data/Identity/definition.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +11 -25
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Interval.cjs +154 -0
- package/_cjs/data/Interval.cjs.map +1 -0
- package/_cjs/data/Maybe/api.cjs +30 -43
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +45 -18
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/destructors.cjs +1 -0
- package/_cjs/data/Maybe/destructors.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +62 -42
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Newtype.cjs +5 -3
- package/_cjs/data/Newtype.cjs.map +1 -1
- package/_cjs/data/Patch/api.cjs +1 -1
- package/_cjs/data/Patch/api.cjs.map +1 -1
- package/_cjs/data/Refinement/api.cjs +0 -4
- package/_cjs/data/Refinement/api.cjs.map +1 -1
- package/_cjs/data/Struct/definition.cjs +4 -2
- package/_cjs/data/Struct/definition.cjs.map +1 -1
- package/_cjs/data/These/api.cjs +299 -0
- package/_cjs/data/These/api.cjs.map +1 -0
- package/_cjs/data/These/constructors.cjs +24 -4
- package/_cjs/data/These/constructors.cjs.map +1 -1
- package/_cjs/data/These/definition.cjs +16 -0
- package/_cjs/data/These/definition.cjs.map +1 -1
- package/_cjs/data/These/destructors.cjs +70 -0
- package/_cjs/data/These/destructors.cjs.map +1 -1
- package/_cjs/data/These/instances.cjs +54 -0
- package/_cjs/data/These/instances.cjs.map +1 -0
- package/_cjs/data/These.cjs +13 -0
- package/_cjs/data/These.cjs.map +1 -1
- package/_cjs/data/bigint/definition.cjs +6 -0
- package/_cjs/data/bigint/definition.cjs.map +1 -0
- package/_cjs/data/bigint/instances.cjs +24 -0
- package/_cjs/data/bigint/instances.cjs.map +1 -0
- package/_cjs/data/bigint.cjs +32 -0
- package/_cjs/data/bigint.cjs.map +1 -0
- package/_cjs/data/boolean/definition.cjs +6 -0
- package/_cjs/data/boolean/definition.cjs.map +1 -0
- package/_cjs/data/boolean/instances.cjs +24 -0
- package/_cjs/data/boolean/instances.cjs.map +1 -0
- package/_cjs/data/boolean.cjs +32 -0
- package/_cjs/data/boolean.cjs.map +1 -0
- package/_cjs/data/number/instances.cjs +18 -5
- package/_cjs/data/number/instances.cjs.map +1 -1
- package/_cjs/data/object/instances.cjs +24 -0
- package/_cjs/data/object/instances.cjs.map +1 -0
- package/_cjs/data/string/instances.cjs +24 -9
- package/_cjs/data/string/instances.cjs.map +1 -1
- package/_cjs/internal/Stack.cjs +4 -0
- package/_cjs/internal/Stack.cjs.map +1 -1
- package/_cjs/json/EitherJson.cjs +33 -0
- package/_cjs/json/EitherJson.cjs.map +1 -0
- package/_cjs/json/MaybeJson.cjs +31 -0
- package/_cjs/json/MaybeJson.cjs.map +1 -0
- package/_cjs/json/TheseJson.cjs +37 -0
- package/_cjs/json/TheseJson.cjs.map +1 -0
- package/_cjs/optics/Optional/definition.cjs +6 -4
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs +1 -1
- package/_cjs/optics/Traversal/api/compose.cjs.map +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs +4 -4
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +17 -12
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/typeclass/Align.cjs +0 -20
- package/_cjs/typeclass/Align.cjs.map +1 -1
- package/_cjs/typeclass/Alt.cjs +5 -15
- package/_cjs/typeclass/Alt.cjs.map +1 -1
- package/_cjs/typeclass/Alternative.cjs +0 -23
- package/_cjs/typeclass/Alternative.cjs.map +1 -1
- package/_cjs/typeclass/Applicative.cjs +0 -22
- package/_cjs/typeclass/Applicative.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +40 -34
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +93 -49
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +40 -17
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/Closure.cjs +1 -4
- package/_cjs/typeclass/Closure.cjs.map +1 -1
- package/_cjs/typeclass/Eq/definition.cjs +18 -0
- package/_cjs/typeclass/Eq/definition.cjs.map +1 -0
- package/_cjs/typeclass/Eq/derivations.cjs +59 -0
- package/_cjs/typeclass/Eq/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Eq.cjs +11 -13
- package/_cjs/typeclass/Eq.cjs.map +1 -1
- package/_cjs/typeclass/Fail.cjs +6 -12
- package/_cjs/typeclass/Fail.cjs.map +1 -1
- package/_cjs/typeclass/Filterable.cjs +31 -18
- package/_cjs/typeclass/Filterable.cjs.map +1 -1
- package/_cjs/typeclass/FilterableWithIndex.cjs +0 -26
- package/_cjs/typeclass/FilterableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Foldable.cjs +33 -19
- package/_cjs/typeclass/Foldable.cjs.map +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs +33 -21
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Functor.cjs +19 -16
- package/_cjs/typeclass/Functor.cjs.map +1 -1
- package/_cjs/typeclass/FunctorWithIndex.cjs +0 -21
- package/_cjs/typeclass/FunctorWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Guard/api.cjs +40 -0
- package/_cjs/typeclass/Guard/api.cjs.map +1 -0
- package/_cjs/typeclass/Guard/definition.cjs +40 -0
- package/_cjs/typeclass/Guard/definition.cjs.map +1 -0
- package/_cjs/typeclass/Guard/derivations.cjs +85 -0
- package/_cjs/typeclass/Guard/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Guard.cjs +32 -0
- package/_cjs/typeclass/Guard.cjs.map +1 -0
- package/_cjs/typeclass/HashEq.cjs +3 -3
- package/_cjs/typeclass/HashEq.cjs.map +1 -1
- package/_cjs/typeclass/Monad.cjs +0 -22
- package/_cjs/typeclass/Monad.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +12 -19
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Monoid.cjs +56 -2
- package/_cjs/typeclass/Monoid.cjs.map +1 -1
- package/_cjs/typeclass/Nil.cjs +10 -0
- package/_cjs/typeclass/Nil.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/contramap.cjs +2 -4
- package/_cjs/typeclass/Ord/api/contramap.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/max.cjs +1 -1
- package/_cjs/typeclass/Ord/api/max.cjs.map +1 -1
- package/_cjs/typeclass/Ord/api/min.cjs +1 -1
- package/_cjs/typeclass/Ord/api/min.cjs.map +1 -1
- package/_cjs/typeclass/Ord/definition.cjs +2 -3
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
- package/_cjs/typeclass/Ord/instances.cjs +7 -7
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
- package/_cjs/typeclass/Pointed.cjs +6 -11
- package/_cjs/typeclass/Pointed.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +77 -94
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/api.cjs +2 -2
- package/_cjs/typeclass/Semigroup/api.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/definition.cjs.map +1 -1
- package/_cjs/typeclass/Semigroup/derivations.cjs +63 -0
- package/_cjs/typeclass/Semigroup/derivations.cjs.map +1 -0
- package/_cjs/typeclass/Semimonoidal.cjs +9 -13
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs +11 -11
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/typeclass/Traversable.cjs +26 -34
- package/_cjs/typeclass/Traversable.cjs.map +1 -1
- package/_cjs/typeclass/TraversableWithIndex.cjs +7 -38
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +41 -42
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +41 -50
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass.cjs +13 -0
- package/_cjs/typeclass.cjs.map +1 -1
- package/_cjs/util/predicates.cjs +5 -0
- package/_cjs/util/predicates.cjs.map +1 -1
- package/_mjs/collection/Iterable/api/traverseConc.mjs +20 -15
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
- package/_mjs/collection/Iterable/api.mjs +21 -31
- package/_mjs/collection/Iterable/api.mjs.map +1 -1
- package/_mjs/collection/compat/Array/api.mjs +1 -1
- package/_mjs/collection/compat/Array/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api.mjs +35 -36
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +48 -39
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Dictionary/definition.mjs +3 -2
- package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +26 -66
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +18 -15
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +5 -5
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs +10 -0
- package/_mjs/collection/immutable/ImmutableArray/api/chunksOf.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs +9 -0
- package/_mjs/collection/immutable/ImmutableArray/api/slice.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs +9 -0
- package/_mjs/collection/immutable/ImmutableArray/api/splitAt.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs +21 -0
- package/_mjs/collection/immutable/ImmutableArray/api/splitWhere.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +229 -326
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +11 -10
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +151 -138
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs +7 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +113 -145
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +7 -7
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +20 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs +4 -3
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/destructors.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +46 -67
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api.mjs +4 -5
- package/_mjs/collection/immutable/List/api.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/api.mjs +447 -0
- package/_mjs/collection/immutable/RoseTree/api.mjs.map +1 -0
- package/_mjs/collection/immutable/RoseTree/definition.mjs +35 -0
- package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -0
- package/_mjs/collection/immutable/RoseTree.mjs +4 -0
- package/_mjs/collection/immutable/RoseTree.mjs.map +1 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs +65 -65
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +59 -15
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs +12 -11
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/mutable/HashMap.mjs +5 -5
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/collection/mutable/HashSet.mjs +4 -4
- package/_mjs/collection/mutable/HashSet.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +5 -2
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/definition.mjs +1 -0
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/instance.mjs +15 -18
- package/_mjs/control/Eval/instance.mjs.map +1 -1
- package/_mjs/control/Z/definition.mjs +2 -0
- package/_mjs/control/Z/definition.mjs.map +1 -1
- package/_mjs/control/Z/instances.mjs +7 -8
- package/_mjs/control/Z/instances.mjs.map +1 -1
- package/_mjs/data/Branded/definition.mjs +18 -0
- package/_mjs/data/Branded/definition.mjs.map +1 -0
- package/_mjs/data/Branded/derivations.mjs +39 -0
- package/_mjs/data/Branded/derivations.mjs.map +1 -0
- package/_mjs/data/Branded.mjs +4 -0
- package/_mjs/data/Branded.mjs.map +1 -0
- package/_mjs/data/CaseClass.mjs +3 -2
- package/_mjs/data/CaseClass.mjs.map +1 -1
- package/_mjs/data/Cause/api/fold.mjs +2 -0
- package/_mjs/data/Cause/api/fold.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +20 -0
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/Const/api.mjs +3 -3
- package/_mjs/data/Const/api.mjs.map +1 -1
- package/_mjs/data/Const/definition.mjs +13 -1
- package/_mjs/data/Const/definition.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +7 -15
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/DecodeError/definition.mjs +226 -0
- package/_mjs/data/DecodeError/definition.mjs.map +1 -0
- package/_mjs/data/DecodeError.mjs +3 -0
- package/_mjs/data/DecodeError.mjs.map +1 -0
- package/_mjs/data/Decoder/api.mjs +179 -0
- package/_mjs/data/Decoder/api.mjs.map +1 -0
- package/_mjs/data/Decoder/definition.mjs +24 -0
- package/_mjs/data/Decoder/definition.mjs.map +1 -0
- package/_mjs/data/Decoder.mjs +4 -0
- package/_mjs/data/Decoder.mjs.map +1 -0
- package/_mjs/data/Duration/api.mjs +17 -8
- package/_mjs/data/Duration/api.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +2 -0
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +91 -21
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +25 -5
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/destructors.mjs +2 -0
- package/_mjs/data/Either/destructors.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +109 -39
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/Environment/api.mjs +23 -7
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/Identity/api.mjs +24 -5
- package/_mjs/data/Identity/api.mjs.map +1 -1
- package/_mjs/data/Identity/definition.mjs +3 -1
- package/_mjs/data/Identity/definition.mjs.map +1 -1
- package/_mjs/data/Identity/instances.mjs +12 -18
- package/_mjs/data/Identity/instances.mjs.map +1 -1
- package/_mjs/data/Interval.mjs +114 -0
- package/_mjs/data/Interval.mjs.map +1 -0
- package/_mjs/data/Maybe/api.mjs +30 -35
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs +37 -14
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/destructors.mjs +1 -0
- package/_mjs/data/Maybe/destructors.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +56 -39
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Newtype.mjs +4 -3
- package/_mjs/data/Newtype.mjs.map +1 -1
- package/_mjs/data/Patch/api.mjs +1 -1
- package/_mjs/data/Patch/api.mjs.map +1 -1
- package/_mjs/data/Refinement/api.mjs +0 -4
- package/_mjs/data/Refinement/api.mjs.map +1 -1
- package/_mjs/data/Struct/definition.mjs +3 -2
- package/_mjs/data/Struct/definition.mjs.map +1 -1
- package/_mjs/data/These/api.mjs +262 -0
- package/_mjs/data/These/api.mjs.map +1 -0
- package/_mjs/data/These/constructors.mjs +14 -2
- package/_mjs/data/These/constructors.mjs.map +1 -1
- package/_mjs/data/These/definition.mjs +8 -0
- package/_mjs/data/These/definition.mjs.map +1 -1
- package/_mjs/data/These/destructors.mjs +53 -0
- package/_mjs/data/These/destructors.mjs.map +1 -1
- package/_mjs/data/These/instances.mjs +36 -0
- package/_mjs/data/These/instances.mjs.map +1 -0
- package/_mjs/data/These.mjs +1 -0
- package/_mjs/data/These.mjs.map +1 -1
- package/_mjs/data/bigint/definition.mjs +2 -0
- package/_mjs/data/bigint/definition.mjs.map +1 -0
- package/_mjs/data/bigint/instances.mjs +10 -0
- package/_mjs/data/bigint/instances.mjs.map +1 -0
- package/_mjs/data/bigint.mjs +4 -0
- package/_mjs/data/bigint.mjs.map +1 -0
- package/_mjs/data/boolean/definition.mjs +2 -0
- package/_mjs/data/boolean/definition.mjs.map +1 -0
- package/_mjs/data/boolean/instances.mjs +10 -0
- package/_mjs/data/boolean/instances.mjs.map +1 -0
- package/_mjs/data/boolean.mjs +4 -0
- package/_mjs/data/boolean.mjs.map +1 -0
- package/_mjs/data/number/instances.mjs +14 -4
- package/_mjs/data/number/instances.mjs.map +1 -1
- package/_mjs/data/object/instances.mjs +10 -0
- package/_mjs/data/object/instances.mjs.map +1 -0
- package/_mjs/data/string/instances.mjs +20 -8
- package/_mjs/data/string/instances.mjs.map +1 -1
- package/_mjs/internal/Stack.mjs +4 -0
- package/_mjs/internal/Stack.mjs.map +1 -1
- package/_mjs/json/EitherJson.mjs +18 -0
- package/_mjs/json/EitherJson.mjs.map +1 -0
- package/_mjs/json/MaybeJson.mjs +16 -0
- package/_mjs/json/MaybeJson.mjs.map +1 -0
- package/_mjs/json/TheseJson.mjs +22 -0
- package/_mjs/json/TheseJson.mjs.map +1 -0
- package/_mjs/optics/Optional/definition.mjs +5 -4
- package/_mjs/optics/Optional/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +5 -4
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +14 -12
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/typeclass/Align.mjs +0 -11
- package/_mjs/typeclass/Align.mjs.map +1 -1
- package/_mjs/typeclass/Alt.mjs +4 -7
- package/_mjs/typeclass/Alt.mjs.map +1 -1
- package/_mjs/typeclass/Alternative.mjs +0 -13
- package/_mjs/typeclass/Alternative.mjs.map +1 -1
- package/_mjs/typeclass/Applicative.mjs +0 -12
- package/_mjs/typeclass/Applicative.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +32 -24
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Apply.mjs +85 -42
- package/_mjs/typeclass/Apply.mjs.map +1 -1
- package/_mjs/typeclass/Chain.mjs +33 -12
- package/_mjs/typeclass/Chain.mjs.map +1 -1
- package/_mjs/typeclass/Closure.mjs +1 -4
- package/_mjs/typeclass/Closure.mjs.map +1 -1
- package/_mjs/typeclass/Eq/definition.mjs +9 -0
- package/_mjs/typeclass/Eq/definition.mjs.map +1 -0
- package/_mjs/typeclass/Eq/derivations.mjs +46 -0
- package/_mjs/typeclass/Eq/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Eq.mjs +1 -11
- package/_mjs/typeclass/Eq.mjs.map +1 -1
- package/_mjs/typeclass/Fail.mjs +5 -7
- package/_mjs/typeclass/Fail.mjs.map +1 -1
- package/_mjs/typeclass/Filterable.mjs +27 -13
- package/_mjs/typeclass/Filterable.mjs.map +1 -1
- package/_mjs/typeclass/FilterableWithIndex.mjs +0 -16
- package/_mjs/typeclass/FilterableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Foldable.mjs +29 -12
- package/_mjs/typeclass/Foldable.mjs.map +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs +29 -13
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Functor.mjs +16 -9
- package/_mjs/typeclass/Functor.mjs.map +1 -1
- package/_mjs/typeclass/FunctorWithIndex.mjs +0 -12
- package/_mjs/typeclass/FunctorWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Guard/api.mjs +23 -0
- package/_mjs/typeclass/Guard/api.mjs.map +1 -0
- package/_mjs/typeclass/Guard/definition.mjs +23 -0
- package/_mjs/typeclass/Guard/definition.mjs.map +1 -0
- package/_mjs/typeclass/Guard/derivations.mjs +67 -0
- package/_mjs/typeclass/Guard/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Guard.mjs +4 -0
- package/_mjs/typeclass/Guard.mjs.map +1 -0
- package/_mjs/typeclass/HashEq.mjs +3 -3
- package/_mjs/typeclass/HashEq.mjs.map +1 -1
- package/_mjs/typeclass/Monad.mjs +0 -12
- package/_mjs/typeclass/Monad.mjs.map +1 -1
- package/_mjs/typeclass/MonadExcept.mjs +9 -13
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
- package/_mjs/typeclass/Monoid.mjs +50 -1
- package/_mjs/typeclass/Monoid.mjs.map +1 -1
- package/_mjs/typeclass/Nil.mjs +8 -1
- package/_mjs/typeclass/Nil.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/contramap.mjs +2 -4
- package/_mjs/typeclass/Ord/api/contramap.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/max.mjs +1 -1
- package/_mjs/typeclass/Ord/api/max.mjs.map +1 -1
- package/_mjs/typeclass/Ord/api/min.mjs +1 -1
- package/_mjs/typeclass/Ord/api/min.mjs.map +1 -1
- package/_mjs/typeclass/Ord/definition.mjs +2 -3
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
- package/_mjs/typeclass/Ord/instances.mjs +7 -7
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
- package/_mjs/typeclass/Pointed.mjs +5 -4
- package/_mjs/typeclass/Pointed.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +67 -74
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/api.mjs +2 -2
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/definition.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/derivations.mjs +50 -0
- package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -0
- package/_mjs/typeclass/Semigroup.mjs +1 -1
- package/_mjs/typeclass/Semimonoidal.mjs +8 -6
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs +11 -11
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/typeclass/Traversable.mjs +25 -24
- package/_mjs/typeclass/Traversable.mjs.map +1 -1
- package/_mjs/typeclass/TraversableWithIndex.mjs +6 -24
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +39 -32
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +39 -37
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass.mjs +1 -0
- package/_mjs/typeclass.mjs.map +1 -1
- package/_mjs/util/predicates.mjs +3 -0
- package/_mjs/util/predicates.mjs.map +1 -1
- package/_src/collection/Iterable/api/traverseConc.ts +21 -29
- package/_src/collection/Iterable/api.ts +20 -34
- package/_src/collection/compat/Array/api.ts +1 -1
- package/_src/collection/immutable/Conc/api.ts +26 -46
- package/_src/collection/immutable/Conc/definition.ts +19 -8
- package/_src/collection/immutable/Dictionary/definition.ts +1 -1
- package/_src/collection/immutable/HashMap/api.ts +24 -81
- package/_src/collection/immutable/HashMap/definition.ts +7 -9
- package/_src/collection/immutable/HashMap/internal.ts +1 -1
- package/_src/collection/immutable/HashSet/api.ts +4 -4
- package/_src/collection/immutable/ImmutableArray/api/chunksOf.ts +6 -0
- package/_src/collection/immutable/ImmutableArray/api/slice.ts +6 -0
- package/_src/collection/immutable/ImmutableArray/api/splitAt.ts +6 -0
- package/_src/collection/immutable/ImmutableArray/api/splitWhere.ts +18 -0
- package/_src/collection/immutable/ImmutableArray/api.ts +181 -267
- package/_src/collection/immutable/ImmutableArray/definition.ts +6 -8
- package/_src/collection/immutable/ImmutableArray/instances.ts +156 -134
- package/_src/collection/immutable/ImmutableArray.ts +7 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +87 -157
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +2 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +18 -6
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +39 -49
- package/_src/collection/immutable/List/api.ts +2 -6
- package/_src/collection/immutable/RoseTree/api.ts +272 -0
- package/_src/collection/immutable/RoseTree/definition.ts +29 -0
- package/_src/collection/immutable/RoseTree.ts +4 -0
- package/_src/collection/immutable/SortedMap/api.ts +56 -53
- package/_src/collection/immutable/Vector/api.ts +57 -17
- package/_src/collection/immutable/Vector/definition.ts +10 -0
- package/_src/collection/mutable/HashMap.ts +5 -5
- package/_src/collection/mutable/HashSet.ts +4 -4
- package/_src/control/Eval/api.ts +5 -1
- package/_src/control/Eval/definition.ts +5 -8
- package/_src/control/Eval/instance.ts +16 -15
- package/_src/control/Z/definition.ts +26 -19
- package/_src/control/Z/instances.ts +9 -8
- package/_src/data/Branded/definition.ts +47 -0
- package/_src/data/Branded/derivations.ts +57 -0
- package/_src/data/Branded.ts +4 -0
- package/_src/data/CaseClass.ts +2 -2
- package/_src/data/Cause/api/fold.ts +1 -0
- package/_src/data/Cause/api.ts +18 -0
- package/_src/data/Const/api.ts +3 -3
- package/_src/data/Const/definition.ts +22 -5
- package/_src/data/Const/instances.ts +12 -21
- package/_src/data/DecodeError/definition.ts +227 -0
- package/_src/data/DecodeError.ts +3 -0
- package/_src/data/Decoder/api.ts +198 -0
- package/_src/data/Decoder/definition.ts +25 -0
- package/_src/data/Decoder.ts +4 -0
- package/_src/data/Duration/api.ts +21 -14
- package/_src/data/Either/api/alignWith.ts +2 -0
- package/_src/data/Either/api.ts +85 -30
- package/_src/data/Either/definition.ts +41 -19
- package/_src/data/Either/destructors.ts +1 -0
- package/_src/data/Either/instances.ts +102 -51
- package/_src/data/Environment/api.ts +19 -4
- package/_src/data/Identity/api.ts +19 -4
- package/_src/data/Identity/definition.ts +7 -3
- package/_src/data/Identity/instances.ts +15 -8
- package/_src/data/Interval.ts +103 -0
- package/_src/data/Maybe/api.ts +21 -31
- package/_src/data/Maybe/definition.ts +31 -19
- package/_src/data/Maybe/destructors.ts +1 -0
- package/_src/data/Maybe/instances.ts +61 -34
- package/_src/data/Newtype.ts +11 -32
- package/_src/data/Patch/api.ts +1 -1
- package/_src/data/Refinement/api.ts +4 -2
- package/_src/data/Struct/definition.ts +1 -1
- package/_src/data/These/api.ts +184 -0
- package/_src/data/These/constructors.ts +10 -0
- package/_src/data/These/definition.ts +7 -0
- package/_src/data/These/destructors.ts +45 -0
- package/_src/data/These/instances.ts +43 -0
- package/_src/data/These.ts +1 -0
- package/_src/data/bigint/definition.ts +13 -0
- package/_src/data/bigint/instances.ts +8 -0
- package/_src/data/bigint.ts +4 -0
- package/_src/data/boolean/definition.ts +13 -0
- package/_src/data/boolean/instances.ts +8 -0
- package/_src/data/boolean.ts +4 -0
- package/_src/data/number/instances.ts +13 -3
- package/_src/data/object/instances.ts +7 -0
- package/_src/data/string/instances.ts +17 -5
- package/_src/internal/Stack.ts +4 -0
- package/_src/json/EitherJson.ts +28 -0
- package/_src/json/MaybeJson.ts +27 -0
- package/_src/json/TheseJson.ts +31 -0
- package/_src/optics/Optional/definition.ts +2 -2
- package/_src/optics/Traversal/api/compose.ts +1 -1
- package/_src/optics/Traversal/api/fromTraversable.ts +15 -41
- package/_src/optics/Traversal/definition.ts +21 -23
- package/_src/typeclass/Align.ts +4 -18
- package/_src/typeclass/Alt.ts +59 -90
- package/_src/typeclass/Alternative.ts +4 -20
- package/_src/typeclass/Applicative.ts +3 -23
- package/_src/typeclass/ApplicativeExcept.ts +94 -193
- package/_src/typeclass/Apply.ts +319 -509
- package/_src/typeclass/Chain.ts +127 -199
- package/_src/typeclass/Closure.ts +4 -20
- package/_src/typeclass/Eq/definition.ts +20 -0
- package/_src/typeclass/Eq/derivations.ts +61 -0
- package/_src/typeclass/Eq.ts +2 -36
- package/_src/typeclass/Fail.ts +28 -27
- package/_src/typeclass/Filterable.ts +70 -117
- package/_src/typeclass/FilterableWithIndex.ts +27 -131
- package/_src/typeclass/Foldable.ts +35 -52
- package/_src/typeclass/FoldableWithIndex.ts +40 -75
- package/_src/typeclass/Functor.ts +21 -59
- package/_src/typeclass/FunctorWithIndex.ts +6 -34
- package/_src/typeclass/Guard/api.ts +32 -0
- package/_src/typeclass/Guard/definition.ts +23 -0
- package/_src/typeclass/Guard/derivations.ts +80 -0
- package/_src/typeclass/Guard.ts +5 -0
- package/_src/typeclass/HashEq.ts +3 -4
- package/_src/typeclass/Monad.ts +3 -18
- package/_src/typeclass/MonadExcept.ts +9 -32
- package/_src/typeclass/Monoid.ts +60 -2
- package/_src/typeclass/Nil.ts +26 -17
- package/_src/typeclass/Ord/api/contramap.ts +2 -4
- package/_src/typeclass/Ord/api/max.ts +1 -1
- package/_src/typeclass/Ord/api/min.ts +1 -1
- package/_src/typeclass/Ord/definition.ts +3 -19
- package/_src/typeclass/Ord/instances.ts +6 -6
- package/_src/typeclass/Pointed.ts +29 -25
- package/_src/typeclass/Semialign.ts +308 -444
- package/_src/typeclass/Semigroup/api.ts +2 -2
- package/_src/typeclass/Semigroup/definition.ts +2 -6
- package/_src/typeclass/Semigroup/derivations.ts +64 -0
- package/_src/typeclass/Semigroup.ts +1 -1
- package/_src/typeclass/Semimonoidal.ts +55 -84
- package/_src/typeclass/Showable/show.ts +6 -8
- package/_src/typeclass/Traversable.ts +67 -157
- package/_src/typeclass/TraversableWithIndex.ts +37 -127
- package/_src/typeclass/Witherable.ts +120 -279
- package/_src/typeclass/WitherableWithIndex.ts +129 -337
- package/_src/typeclass.ts +2 -0
- package/_src/util/predicates.ts +4 -0
- package/collection/Iterable/api/traverseConc.d.ts +6 -4
- package/collection/Iterable/api.d.ts +5 -13
- package/collection/immutable/Conc/api.d.ts +15 -23
- package/collection/immutable/Conc/definition.d.ts +14 -7
- package/collection/immutable/Dictionary/definition.d.ts +1 -1
- package/collection/immutable/HashMap/api.d.ts +15 -27
- package/collection/immutable/HashMap/definition.d.ts +7 -9
- package/collection/immutable/HashMap/internal.d.ts +2 -2
- package/collection/immutable/HashSet/definition.d.ts +1 -0
- package/collection/immutable/ImmutableArray/api/chunksOf.d.ts +6 -0
- package/collection/immutable/ImmutableArray/api/slice.d.ts +6 -0
- package/collection/immutable/ImmutableArray/api/splitAt.d.ts +6 -0
- package/collection/immutable/ImmutableArray/api/splitWhere.d.ts +7 -0
- package/collection/immutable/ImmutableArray/api.d.ts +42 -119
- package/collection/immutable/ImmutableArray/definition.d.ts +6 -7
- package/collection/immutable/ImmutableArray/instances.d.ts +86 -17
- package/collection/immutable/ImmutableArray.d.ts +4 -0
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +27 -48
- package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +2 -1
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +15 -7
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +1 -1
- package/collection/immutable/List/api.d.ts +1 -2
- package/collection/immutable/RoseTree/api.d.ts +63 -0
- package/collection/immutable/RoseTree/definition.d.ts +24 -0
- package/collection/immutable/RoseTree.d.ts +2 -0
- package/collection/immutable/SortedMap/api.d.ts +2 -1
- package/collection/immutable/SortedMap/iterator.d.ts +1 -1
- package/collection/immutable/Vector/api.d.ts +31 -8
- package/collection/immutable/Vector/definition.d.ts +13 -0
- package/collection/mutable/HashMap.d.ts +2 -1
- package/collection/mutable/HashSet.d.ts +1 -0
- package/collection/mutable/ListBuffer.d.ts +1 -0
- package/control/Eval/api.d.ts +1 -0
- package/control/Eval/definition.d.ts +5 -7
- package/control/Eval/instance.d.ts +4 -1
- package/control/Z/definition.d.ts +23 -17
- package/control/Z/instances.d.ts +4 -3
- package/data/Branded/definition.d.ts +36 -0
- package/data/Branded/derivations.d.ts +24 -0
- package/data/Branded.d.ts +2 -0
- package/data/Cause/api.d.ts +7 -1
- package/data/Const/api.d.ts +1 -1
- package/data/Const/definition.d.ts +24 -7
- package/data/Const/instances.d.ts +4 -12
- package/data/DecodeError/definition.d.ts +141 -0
- package/data/DecodeError.d.ts +1 -0
- package/data/Decoder/api.d.ts +65 -0
- package/data/Decoder/definition.d.ts +25 -0
- package/data/Decoder.d.ts +2 -0
- package/data/Duration/api.d.ts +12 -8
- package/data/Either/api.d.ts +29 -17
- package/data/Either/definition.d.ts +32 -14
- package/data/Either/instances.d.ts +26 -11
- package/data/Environment/api.d.ts +5 -0
- package/data/Exit/definition.d.ts +1 -0
- package/data/Identity/api.d.ts +11 -0
- package/data/Identity/definition.d.ts +8 -2
- package/data/Identity/instances.d.ts +5 -9
- package/data/Interval.d.ts +71 -0
- package/data/Maybe/api.d.ts +3 -17
- package/data/Maybe/definition.d.ts +23 -14
- package/data/Maybe/instances.d.ts +14 -8
- package/data/Newtype.d.ts +8 -9
- package/data/Refinement/api.d.ts +2 -0
- package/data/Struct/definition.d.ts +1 -1
- package/data/These/api.d.ts +73 -0
- package/data/These/constructors.d.ts +7 -1
- package/data/These/definition.d.ts +5 -0
- package/data/These/destructors.d.ts +27 -1
- package/data/These/instances.d.ts +13 -0
- package/data/These.d.ts +1 -0
- package/data/bigint/definition.d.ts +13 -0
- package/data/bigint/instances.d.ts +7 -0
- package/data/bigint.d.ts +2 -0
- package/data/boolean/definition.d.ts +13 -0
- package/data/boolean/instances.d.ts +7 -0
- package/data/boolean.d.ts +2 -0
- package/data/number/instances.d.ts +8 -0
- package/data/object/instances.d.ts +7 -0
- package/data/string/instances.d.ts +10 -0
- package/internal/Stack.d.ts +1 -0
- package/json/EitherJson.d.ts +24 -0
- package/json/MaybeJson.d.ts +23 -0
- package/json/TheseJson.d.ts +26 -0
- package/optics/Traversal/api/fromTraversable.d.ts +1 -1
- package/optics/Traversal/definition.d.ts +4 -9
- package/package.json +2 -2
- package/typeclass/Align.d.ts +3 -10
- package/typeclass/Alt.d.ts +6 -19
- package/typeclass/Alternative.d.ts +4 -12
- package/typeclass/Applicative.d.ts +3 -12
- package/typeclass/ApplicativeExcept.d.ts +14 -39
- package/typeclass/Apply.d.ts +41 -72
- package/typeclass/Chain.d.ts +18 -28
- package/typeclass/Closure.d.ts +2 -12
- package/typeclass/Eq/definition.d.ts +17 -0
- package/typeclass/Eq/derivations.d.ts +24 -0
- package/typeclass/Eq.d.ts +2 -27
- package/typeclass/Fail.d.ts +4 -10
- package/typeclass/Filterable.d.ts +30 -51
- package/typeclass/FilterableWithIndex.d.ts +10 -53
- package/typeclass/Foldable.d.ts +19 -31
- package/typeclass/FoldableWithIndex.d.ts +20 -33
- package/typeclass/Functor.d.ts +11 -22
- package/typeclass/FunctorWithIndex.d.ts +3 -19
- package/typeclass/Guard/api.d.ts +20 -0
- package/typeclass/Guard/definition.d.ts +23 -0
- package/typeclass/Guard/derivations.d.ts +36 -0
- package/typeclass/Guard.d.ts +2 -0
- package/typeclass/HashEq.d.ts +1 -2
- package/typeclass/Monad.d.ts +3 -11
- package/typeclass/MonadExcept.d.ts +6 -17
- package/typeclass/Monoid.d.ts +24 -2
- package/typeclass/Nil.d.ts +7 -8
- package/typeclass/Ord/definition.d.ts +2 -14
- package/typeclass/Pointed.d.ts +4 -10
- package/typeclass/Semialign.d.ts +51 -63
- package/typeclass/Semigroup/definition.d.ts +3 -5
- package/typeclass/Semigroup/derivations.d.ts +25 -0
- package/typeclass/Semimonoidal.d.ts +5 -14
- package/typeclass/Showable/show.d.ts +1 -0
- package/typeclass/Traversable.d.ts +17 -57
- package/typeclass/TraversableWithIndex.d.ts +9 -52
- package/typeclass/Witherable.d.ts +22 -82
- package/typeclass/WitherableWithIndex.d.ts +26 -98
- package/typeclass.d.ts +1 -0
- package/util/predicates.d.ts +1 -0
@@ -7,5 +7,6 @@ import { MaybeTag } from "./definition.js";
|
|
7
7
|
* @tsplus fluent fncts.Maybe match
|
8
8
|
*/
|
9
9
|
export function match_<A, B, C>(self: Maybe<A>, nothing: () => B, just: (a: A) => C): B | C {
|
10
|
+
self.concrete();
|
10
11
|
return self._tag === MaybeTag.Just ? just(self.value) : nothing();
|
11
12
|
}
|
@@ -1,6 +1,9 @@
|
|
1
|
-
import * as P from "../../typeclass.js";
|
1
|
+
import type * as P from "../../typeclass.js";
|
2
|
+
import type { MaybeF } from "@fncts/base/data/Maybe/definition";
|
3
|
+
|
4
|
+
import { MaybeJson } from "@fncts/base/json/MaybeJson";
|
5
|
+
|
2
6
|
import {
|
3
|
-
ap_,
|
4
7
|
filter_,
|
5
8
|
filterMap_,
|
6
9
|
flatMap_,
|
@@ -9,45 +12,69 @@ import {
|
|
9
12
|
map_,
|
10
13
|
partition_,
|
11
14
|
partitionMap_,
|
15
|
+
zip_,
|
12
16
|
zipWith_,
|
13
17
|
} from "./api.js";
|
14
18
|
import { just } from "./constructors.js";
|
15
19
|
|
16
|
-
export
|
17
|
-
readonly type: Maybe<this["A"]>;
|
18
|
-
readonly variance: {
|
19
|
-
readonly A: "-";
|
20
|
-
};
|
21
|
-
}
|
20
|
+
export const Functor: P.Functor<MaybeF> = { map: map_ };
|
22
21
|
|
23
|
-
export const
|
22
|
+
export const Apply: P.Apply<MaybeF> = { ...Functor, zip: zip_, zipWith: zipWith_ };
|
24
23
|
|
25
|
-
export const
|
26
|
-
|
27
|
-
export const Applicative: P.Applicative<MaybeF> = P.Applicative({
|
28
|
-
map_,
|
29
|
-
ap_,
|
30
|
-
zipWith_,
|
24
|
+
export const Applicative: P.Applicative<MaybeF> = {
|
25
|
+
...Apply,
|
31
26
|
pure: just,
|
32
|
-
}
|
27
|
+
};
|
33
28
|
|
34
|
-
export const Monad: P.Monad<MaybeF> =
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
pure: just,
|
39
|
-
flatMap_: flatMap_,
|
40
|
-
});
|
29
|
+
export const Monad: P.Monad<MaybeF> = {
|
30
|
+
...Applicative,
|
31
|
+
flatMap: flatMap_,
|
32
|
+
};
|
41
33
|
|
42
|
-
export const Foldable: P.Foldable<MaybeF> =
|
43
|
-
foldLeft_,
|
44
|
-
foldRight_,
|
45
|
-
}
|
34
|
+
export const Foldable: P.Foldable<MaybeF> = {
|
35
|
+
foldLeft: foldLeft_,
|
36
|
+
foldRight: foldRight_,
|
37
|
+
};
|
46
38
|
|
47
|
-
export const Filterable: P.Filterable<MaybeF> =
|
48
|
-
|
49
|
-
filter_,
|
50
|
-
filterMap_,
|
51
|
-
partition_,
|
52
|
-
partitionMap_,
|
53
|
-
}
|
39
|
+
export const Filterable: P.Filterable<MaybeF> = {
|
40
|
+
...Functor,
|
41
|
+
filter: filter_,
|
42
|
+
filterMap: filterMap_,
|
43
|
+
partition: partition_,
|
44
|
+
partitionMap: partitionMap_,
|
45
|
+
};
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @tsplus derive fncts.Guard[fncts.Maybe]<_> 10
|
49
|
+
*/
|
50
|
+
export function deriveGuard<A extends Maybe<any>>(
|
51
|
+
...[guard]: [A] extends [Maybe<infer A>] ? [guard: Guard<A>] : never
|
52
|
+
): Guard<A> {
|
53
|
+
return Guard((u): u is A => {
|
54
|
+
if (Maybe.isMaybe(u)) {
|
55
|
+
if (u.isNothing()) {
|
56
|
+
return true;
|
57
|
+
}
|
58
|
+
if (u.isJust()) {
|
59
|
+
return guard.is(u.value);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
return false;
|
63
|
+
});
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* @tsplus derive fncts.Decoder[fncts.Maybe]<_> 10
|
68
|
+
*/
|
69
|
+
export function deriveDecoder<A extends Maybe<any>>(
|
70
|
+
...[value]: [A] extends [Maybe<infer A>] ? [value: Decoder<A>] : never
|
71
|
+
): Decoder<A> {
|
72
|
+
const label = `Maybe<${value.label}>`;
|
73
|
+
return Decoder(
|
74
|
+
(input) =>
|
75
|
+
MaybeJson.getDecoder(value)
|
76
|
+
.decode(input)
|
77
|
+
.map((decoded) => (decoded._tag === "Nothing" ? (Nothing() as A) : (Just(decoded.value) as A))),
|
78
|
+
label,
|
79
|
+
);
|
80
|
+
}
|
package/_src/data/Newtype.ts
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @tsplus type fncts.Newtype
|
3
3
|
*/
|
4
|
-
export interface Newtype<URI, A
|
4
|
+
export interface Newtype<URI, A> {
|
5
5
|
readonly _URI: URI;
|
6
|
-
readonly
|
7
|
-
readonly _C: C;
|
6
|
+
readonly [HKT.A]: A;
|
8
7
|
}
|
9
8
|
|
10
9
|
export declare namespace Newtype {
|
11
|
-
export type Iso<N extends NewtypeHKT
|
10
|
+
export type Iso<N extends NewtypeHKT> = NewtypeIso<N>;
|
12
11
|
}
|
13
12
|
|
14
13
|
/**
|
@@ -19,42 +18,22 @@ export interface NewtypeOps {}
|
|
19
18
|
export const Newtype: NewtypeOps = {};
|
20
19
|
|
21
20
|
export interface NewtypeHKT extends HKT {
|
22
|
-
readonly
|
21
|
+
readonly [HKT.T]: Newtype<any, any>;
|
23
22
|
}
|
24
23
|
|
25
|
-
export interface NewtypeIso<N extends NewtypeHKT
|
24
|
+
export interface NewtypeIso<N extends NewtypeHKT> {
|
26
25
|
/**
|
27
26
|
* @tsplus macro identity
|
28
27
|
*/
|
29
|
-
get: <
|
30
|
-
|
31
|
-
|
32
|
-
W extends HKT.GetExtends<C, "W", any>,
|
33
|
-
X extends HKT.GetExtends<C, "X", any>,
|
34
|
-
I extends HKT.GetExtends<C, "I", any>,
|
35
|
-
S extends HKT.GetExtends<C, "S", any>,
|
36
|
-
R extends HKT.GetExtends<C, "E", any>,
|
37
|
-
E extends HKT.GetExtends<C, "E", any>,
|
38
|
-
A extends HKT.GetExtends<C, "A", any>,
|
39
|
-
>(
|
40
|
-
_: HKT.Kind<N, N["type"]["_C"], K, Q, W, X, I, S, R, E, A>["_A"],
|
41
|
-
) => HKT.Kind<N, HKT.None, K, Q, W, X, I, S, R, E, A>;
|
28
|
+
get: <K, Q, W, X, I, S, R, E, A>(
|
29
|
+
_: HKT.Kind<N, K, Q, W, X, I, S, R, E, A>[HKT.A],
|
30
|
+
) => HKT.Kind<N, K, Q, W, X, I, S, R, E, A>;
|
42
31
|
/**
|
43
32
|
* @tsplus macro identity
|
44
33
|
*/
|
45
|
-
reverseGet: <
|
46
|
-
|
47
|
-
|
48
|
-
W extends HKT.GetExtends<C, "W", any>,
|
49
|
-
X extends HKT.GetExtends<C, "X", any>,
|
50
|
-
I extends HKT.GetExtends<C, "I", any>,
|
51
|
-
S extends HKT.GetExtends<C, "S", any>,
|
52
|
-
R extends HKT.GetExtends<C, "E", any>,
|
53
|
-
E extends HKT.GetExtends<C, "E", any>,
|
54
|
-
A extends HKT.GetExtends<C, "A", any>,
|
55
|
-
>(
|
56
|
-
_: HKT.Kind<N, HKT.None, K, Q, W, X, I, S, R, E, A>,
|
57
|
-
) => HKT.Kind<N, HKT.None, K, Q, W, X, I, S, R, E, A>["_A"];
|
34
|
+
reverseGet: <K, Q, W, X, I, S, R, E, A>(
|
35
|
+
_: HKT.Kind<N, K, Q, W, X, I, S, R, E, A>,
|
36
|
+
) => HKT.Kind<N, K, Q, W, X, I, S, R, E, A>[HKT.A];
|
58
37
|
}
|
59
38
|
|
60
39
|
/**
|
package/_src/data/Patch/api.ts
CHANGED
@@ -49,7 +49,7 @@ const OrdEnvironmentMap = Number.Ord.contramap((_: readonly [Tag<unknown>, reado
|
|
49
49
|
* @tsplus static fncts.Environment.PatchOps diff
|
50
50
|
*/
|
51
51
|
export function diff<In, Out>(oldValue: Environment<In>, newValue: Environment<Out>): Patch<In, Out> {
|
52
|
-
const sorted = newValue.map.toArray.sort(OrdEnvironmentMap.
|
52
|
+
const sorted = newValue.map.toArray.sort(OrdEnvironmentMap.compare);
|
53
53
|
const [missingServices, patch] = sorted.foldLeft(
|
54
54
|
[oldValue.map.beginMutation, Patch.empty() as Patch<any, any>],
|
55
55
|
([map, patch], [tag, [newService, newIndex]]) =>
|
@@ -2,8 +2,10 @@
|
|
2
2
|
* @tsplus fluent fncts.Refinement and
|
3
3
|
* @tsplus operator fncts.Refinement &&
|
4
4
|
*/
|
5
|
-
export function and<A, B extends A, C extends B>(self: Refinement<A, B>, that: Refinement<B, C>): Refinement<A, C
|
6
|
-
|
5
|
+
export function and<A, B extends A, C extends B>(self: Refinement<A, B>, that: Refinement<B, C>): Refinement<A, C>;
|
6
|
+
export function and<A, B extends A>(self: Refinement<A, B>, that: Predicate<B>): Refinement<A, B>;
|
7
|
+
export function and<A, B extends A>(self: Refinement<A, B>, that: Predicate<B>): Refinement<A, B> {
|
8
|
+
return (a): a is B => self(a) && that(a);
|
7
9
|
}
|
8
10
|
|
9
11
|
/**
|
@@ -0,0 +1,184 @@
|
|
1
|
+
import type { Both, Left, Right } from "@fncts/base/data/These/definition";
|
2
|
+
import type * as P from "@fncts/base/typeclass";
|
3
|
+
|
4
|
+
import { TheseTag } from "@fncts/base/data/These/definition";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @tsplus fluent fncts.These isLeft
|
8
|
+
*/
|
9
|
+
export function isLeft<E, A>(self: These<E, A>): self is Left<E> {
|
10
|
+
return self._tag === TheseTag.Left;
|
11
|
+
}
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @tsplus fluent fncts.These isRight
|
15
|
+
*/
|
16
|
+
export function isRight<E, A>(self: These<E, A>): self is Right<A> {
|
17
|
+
return self._tag === TheseTag.Right;
|
18
|
+
}
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @tsplus fluent fncts.These isBoth
|
22
|
+
*/
|
23
|
+
export function isBoth<E, A>(self: These<E, A>): self is Both<E, A> {
|
24
|
+
return self._tag === TheseTag.Both;
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @tsplus fluent fncts.These map
|
29
|
+
*/
|
30
|
+
export function map<E, A, B>(self: These<E, A>, f: (a: A) => B): These<E, B> {
|
31
|
+
switch (self._tag) {
|
32
|
+
case TheseTag.Left:
|
33
|
+
return self;
|
34
|
+
case TheseTag.Right:
|
35
|
+
return These.right(f(self.right));
|
36
|
+
case TheseTag.Both:
|
37
|
+
return These.both(self.left, f(self.right));
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @tsplus fluent fncts.These mapLeft
|
43
|
+
*/
|
44
|
+
export function mapLeft<E, A, E1>(self: These<E, A>, f: (e: E) => E1): These<E1, A> {
|
45
|
+
switch (self._tag) {
|
46
|
+
case TheseTag.Left:
|
47
|
+
return These.left(f(self.left));
|
48
|
+
case TheseTag.Right:
|
49
|
+
return self;
|
50
|
+
case TheseTag.Both:
|
51
|
+
return These.both(f(self.left), self.right);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* @tsplus fluent fncts.These bimap
|
57
|
+
*/
|
58
|
+
export function bimap<E, A, E1, B>(self: These<E, A>, f: (e: E) => E1, g: (a: A) => B): These<E1, B> {
|
59
|
+
switch (self._tag) {
|
60
|
+
case TheseTag.Left:
|
61
|
+
return These.left(f(self.left));
|
62
|
+
case TheseTag.Right:
|
63
|
+
return These.right(g(self.right));
|
64
|
+
case TheseTag.Both:
|
65
|
+
return These.both(f(self.left), g(self.right));
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* @tsplus fluent fncts.These zipWith
|
71
|
+
*/
|
72
|
+
export function zipWith<E, A, B, C>(
|
73
|
+
self: These<E, A>,
|
74
|
+
that: These<E, B>,
|
75
|
+
f: (a: A, b: B) => C,
|
76
|
+
/** @tsplus auto */ S: P.Semigroup<E>,
|
77
|
+
): These<E, C> {
|
78
|
+
switch (self._tag) {
|
79
|
+
case TheseTag.Left:
|
80
|
+
switch (that._tag) {
|
81
|
+
case TheseTag.Left:
|
82
|
+
return These.left(S.combine(self.left, that.left));
|
83
|
+
case TheseTag.Right:
|
84
|
+
return self;
|
85
|
+
case TheseTag.Both:
|
86
|
+
return These.left(S.combine(self.left, that.left));
|
87
|
+
}
|
88
|
+
case TheseTag.Right:
|
89
|
+
switch (that._tag) {
|
90
|
+
case TheseTag.Left:
|
91
|
+
return that;
|
92
|
+
case TheseTag.Right:
|
93
|
+
return These.right(f(self.right, that.right));
|
94
|
+
case TheseTag.Both:
|
95
|
+
return These.left(that.left);
|
96
|
+
}
|
97
|
+
case TheseTag.Both:
|
98
|
+
switch (that._tag) {
|
99
|
+
case TheseTag.Left:
|
100
|
+
return These.left(S.combine(self.left, that.left));
|
101
|
+
case TheseTag.Right:
|
102
|
+
return These.both(self.left, f(self.right, that.right));
|
103
|
+
case TheseTag.Both:
|
104
|
+
return These.both(S.combine(self.left, that.left), f(self.right, that.right));
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
/**
|
110
|
+
* @tsplus fluent fncts.These zip
|
111
|
+
*/
|
112
|
+
export function zip<E, A, B>(
|
113
|
+
self: These<E, A>,
|
114
|
+
that: These<E, B>,
|
115
|
+
/** @tsplus auto */ S: P.Semigroup<E>,
|
116
|
+
): These<E, readonly [A, B]> {
|
117
|
+
return self.zipWith(that, (a, b) => [a, b], S);
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* @tsplus fluent fncts.These ap
|
122
|
+
*/
|
123
|
+
export function ap<E, A, B>(
|
124
|
+
self: These<E, (a: A) => B>,
|
125
|
+
that: These<E, A>,
|
126
|
+
/** @tsplus auto */ S: P.Semigroup<E>,
|
127
|
+
): These<E, B> {
|
128
|
+
return self.zipWith(that, (f, a) => f(a), S);
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @tsplus fluent fncts.These flatMap
|
133
|
+
*/
|
134
|
+
export function flatMap<E, A, B>(
|
135
|
+
self: These<E, A>,
|
136
|
+
f: (a: A) => These<E, B>,
|
137
|
+
/** @tsplus auto */ S: P.Semigroup<E>,
|
138
|
+
): These<E, B> {
|
139
|
+
if (self._tag === TheseTag.Left) {
|
140
|
+
return self;
|
141
|
+
}
|
142
|
+
if (self._tag === TheseTag.Right) {
|
143
|
+
return f(self.right);
|
144
|
+
}
|
145
|
+
const that = f(self.right);
|
146
|
+
switch (that._tag) {
|
147
|
+
case TheseTag.Left:
|
148
|
+
return These.left(S.combine(self.left, that.left));
|
149
|
+
case TheseTag.Right:
|
150
|
+
return These.both(self.left, that.right);
|
151
|
+
case TheseTag.Both:
|
152
|
+
return These.both(S.combine(self.left, that.left), that.right);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @tsplus fluent fncts.These catchAll
|
158
|
+
*/
|
159
|
+
export function catchAll_<E, A, B>(self: These<E, A>, f: (e: E) => These<E, B>): These<E, A | B> {
|
160
|
+
if (self._tag === TheseTag.Left) {
|
161
|
+
return f(self.left);
|
162
|
+
}
|
163
|
+
return self;
|
164
|
+
}
|
165
|
+
|
166
|
+
/**
|
167
|
+
* @tsplus getter fncts.These condemn
|
168
|
+
*/
|
169
|
+
export function condemn<E, A>(self: These<E, A>): These<E, A> {
|
170
|
+
if (self._tag === TheseTag.Both) {
|
171
|
+
return These.left(self.left);
|
172
|
+
}
|
173
|
+
return self;
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* @tsplus fluent fncts.These condemnWhen
|
178
|
+
*/
|
179
|
+
export function condemnWhen<E, A>(self: These<E, A>, p: Predicate<E>): These<E, A> {
|
180
|
+
if(self._tag === TheseTag.Both && p(self.left)) {
|
181
|
+
return These.left(self.left);
|
182
|
+
}
|
183
|
+
return self;
|
184
|
+
}
|
@@ -23,3 +23,13 @@ export function right<E = never, A = never>(a: A): These<E, A> {
|
|
23
23
|
export function both<E = never, A = never>(e: E, a: A): These<E, A> {
|
24
24
|
return new Both(e, a);
|
25
25
|
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @tsplus static fncts.TheseOps rightOrBoth
|
29
|
+
*/
|
30
|
+
export function rightOrBoth<E = never, A = never>(e: Maybe<E>, a: A): These<E, A> {
|
31
|
+
return e.match(
|
32
|
+
() => These.right(a),
|
33
|
+
(e) => These.both(e, a)
|
34
|
+
);
|
35
|
+
}
|
@@ -45,3 +45,10 @@ export type These<E, A> = Left<E> | Right<A> | Both<E, A>;
|
|
45
45
|
export interface TheseOps {}
|
46
46
|
|
47
47
|
export const These: TheseOps = {};
|
48
|
+
|
49
|
+
/**
|
50
|
+
* @tsplus static fncts.TheseOps isThese
|
51
|
+
*/
|
52
|
+
export function isThese(u: unknown): u is These<unknown, unknown> {
|
53
|
+
return hasTypeId(u, TheseTypeId);
|
54
|
+
}
|
@@ -1,5 +1,33 @@
|
|
1
1
|
import { TheseTag } from "./definition.js";
|
2
2
|
|
3
|
+
/**
|
4
|
+
* @tsplus getter fncts.These right
|
5
|
+
*/
|
6
|
+
export function unsafeGetRight<E, A>(self: These<E, A>): A | undefined {
|
7
|
+
return self.isRight() || self.isBoth() ? self.right : undefined;
|
8
|
+
}
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @tsplus getter fncts.These left
|
12
|
+
*/
|
13
|
+
export function unsafeGetLeft<E, A>(self: These<E, A>): E | undefined {
|
14
|
+
return self.isLeft() ? self.left : undefined;
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @tsplus getter fncts.These rightMaybe
|
19
|
+
*/
|
20
|
+
export function rightMaybe<E, A>(self: These<E, A>): Maybe<A> {
|
21
|
+
return self.isRight() || self.isBoth() ? Just(self.right) : Nothing();
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @tsplus getter fncts.These leftMaybe
|
26
|
+
*/
|
27
|
+
export function leftMaybe<E, A>(self: These<E, A>): Maybe<E> {
|
28
|
+
return self.isLeft() ? Just(self.left) : Nothing();
|
29
|
+
}
|
30
|
+
|
3
31
|
/**
|
4
32
|
* @tsplus fluent fncts.These match
|
5
33
|
*/
|
@@ -18,3 +46,20 @@ export function match_<E, A, B, C, D>(
|
|
18
46
|
return both(self.left, self.right);
|
19
47
|
}
|
20
48
|
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* @tsplus fluent fncts.These match2
|
52
|
+
*/
|
53
|
+
export function match2<E, A, B, C>(
|
54
|
+
self: These<E, A>,
|
55
|
+
left: (e: E) => B,
|
56
|
+
right: (e: Maybe<E>, a: A) => C
|
57
|
+
): B | C {
|
58
|
+
switch(self._tag) {
|
59
|
+
case TheseTag.Left:
|
60
|
+
return left(self.left);
|
61
|
+
case TheseTag.Right:
|
62
|
+
case TheseTag.Both:
|
63
|
+
return right(self.leftMaybe, self.right);
|
64
|
+
}
|
65
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { TheseJson } from "@fncts/base/json/TheseJson";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @tsplus derive fncts.Guard[fncts.These]<_> 10
|
5
|
+
*/
|
6
|
+
export function deriveGuard<A extends These<any, any>>(
|
7
|
+
...[left, right]: [A] extends [These<infer E, infer A>] ? [left: Guard<E>, right: Guard<A>] : never
|
8
|
+
): Guard<A> {
|
9
|
+
return Guard((u): u is A => {
|
10
|
+
if (These.isThese(u)) {
|
11
|
+
if (u.isLeft()) {
|
12
|
+
return left.is(u.left);
|
13
|
+
}
|
14
|
+
if (u.isRight()) {
|
15
|
+
return right.is(u.right);
|
16
|
+
}
|
17
|
+
return right.is(u.right) && left.is(u.left);
|
18
|
+
}
|
19
|
+
return false;
|
20
|
+
});
|
21
|
+
}
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @tsplus derive fncts.Decoder[fncts.These]<_> 10
|
25
|
+
*/
|
26
|
+
export function deriveDecoder<A extends These<any, any>>(
|
27
|
+
...[left, right]: [A] extends [These<infer E, infer A>] ? [left: Decoder<E>, right: Decoder<A>] : never
|
28
|
+
): Decoder<A> {
|
29
|
+
const label = `These<${left.label}, ${right.label}>`;
|
30
|
+
return Decoder(
|
31
|
+
(input) =>
|
32
|
+
TheseJson.getDecoder(left, right)
|
33
|
+
.decode(input)
|
34
|
+
.map((result) =>
|
35
|
+
result._tag === "Left"
|
36
|
+
? (These.left(result.left) as A)
|
37
|
+
: result._tag === "Right"
|
38
|
+
? (These.right(result.right) as A)
|
39
|
+
: (These.both(result.left, result.right) as A),
|
40
|
+
),
|
41
|
+
label,
|
42
|
+
);
|
43
|
+
}
|
package/_src/data/These.ts
CHANGED
@@ -1,15 +1,25 @@
|
|
1
|
+
import { isNumber } from "@fncts/base/util/predicates";
|
2
|
+
|
1
3
|
import * as P from "../../typeclass.js";
|
2
4
|
import { EQ, GT, LT } from "../../typeclass.js";
|
3
5
|
|
4
6
|
/**
|
5
7
|
* @tsplus static fncts.NumberOps Eq
|
8
|
+
* @tsplus implicit
|
6
9
|
*/
|
7
|
-
export const Eq: P.Eq<number> = P.Eq({
|
10
|
+
export const Eq: P.Eq<number> = P.Eq({ equals: (x, y) => x === y });
|
8
11
|
|
9
12
|
/**
|
10
13
|
* @tsplus static fncts.NumberOps Ord
|
14
|
+
* @tsplus implicit
|
11
15
|
*/
|
12
16
|
export const Ord: P.Ord<number> = P.Ord({
|
13
|
-
|
14
|
-
|
17
|
+
compare: (x, y) => (x < y ? LT : x > y ? GT : EQ),
|
18
|
+
equals: (x, y) => x === y,
|
15
19
|
});
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @tsplus static fncts.NumberOps Guard
|
23
|
+
* @tsplus implicit
|
24
|
+
*/
|
25
|
+
export const Guard: P.Guard<number> = P.Guard(isNumber);
|
@@ -1,24 +1,36 @@
|
|
1
|
+
import { isString } from "@fncts/base/util/predicates";
|
2
|
+
|
1
3
|
import * as P from "../../typeclass.js";
|
2
4
|
|
3
5
|
/**
|
4
6
|
* @tsplus static fncts.StringOps Eq
|
7
|
+
* @tsplus implicit
|
5
8
|
*/
|
6
|
-
export const Eq: P.Eq<string> = P.Eq({
|
9
|
+
export const Eq: P.Eq<string> = P.Eq({ equals: (x, y) => x === y });
|
7
10
|
|
8
11
|
/**
|
9
12
|
* @tsplus static fncts.StringOps Semigroup
|
13
|
+
* @tsplus implicit
|
10
14
|
*/
|
11
|
-
export const Semigroup: P.Semigroup<string> = P.Semigroup({
|
15
|
+
export const Semigroup: P.Semigroup<string> = P.Semigroup({ combine: (x, y) => x + y });
|
12
16
|
|
13
17
|
/**
|
14
18
|
* @tsplus static fncts.StringOps Monoid
|
19
|
+
* @tsplus implicit
|
15
20
|
*/
|
16
|
-
export const Monoid: P.Monoid<string> = P.Monoid({
|
21
|
+
export const Monoid: P.Monoid<string> = P.Monoid({ combine: (x, y) => x + y, nat: "" });
|
17
22
|
|
18
23
|
/**
|
19
24
|
* @tsplus static fncts.StringOps Ord
|
25
|
+
* @tsplus implicit
|
20
26
|
*/
|
21
27
|
export const Ord: P.Ord<string> = P.Ord({
|
22
|
-
|
23
|
-
|
28
|
+
...Eq,
|
29
|
+
compare: (x, y) => (x < y ? -1 : x > y ? 1 : 0),
|
24
30
|
});
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @tsplus static fncts.StringOps Guard
|
34
|
+
* @tsplus implicit
|
35
|
+
*/
|
36
|
+
export const Guard: P.Guard<string> = P.Guard(isString);
|