@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
@@ -1,80 +1,131 @@
|
|
1
|
+
import type { Either1F, EitherF } from "@fncts/base/data/Either/definition.js";
|
2
|
+
|
3
|
+
import { map_ } from "@fncts/base/data/Either/api";
|
4
|
+
import { concrete, Either, EitherTag, Right } from "@fncts/base/data/Either/definition";
|
5
|
+
import { EitherJson } from "@fncts/base/json/EitherJson";
|
6
|
+
|
1
7
|
import * as P from "../../typeclass.js";
|
2
|
-
import { map_ } from "./api.js";
|
3
|
-
import { EitherTag, Left, Right } from "./definition.js";
|
4
8
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
9
|
+
/**
|
10
|
+
* @tsplus implicit
|
11
|
+
*/
|
12
|
+
export const Functor: P.Functor<EitherF> = {
|
13
|
+
map: map_,
|
14
|
+
};
|
12
15
|
|
13
16
|
/**
|
14
17
|
* @tsplus static fncts.EitherOps getEq
|
15
18
|
*/
|
16
19
|
export function getEq<E, A>(EE: P.Eq<E>, EA: P.Eq<A>): P.Eq<Either<E, A>> {
|
17
20
|
return P.Eq({
|
18
|
-
|
21
|
+
equals: (x, y) =>
|
19
22
|
x === y ||
|
20
23
|
x.match(
|
21
24
|
(e1) =>
|
22
25
|
y.match(
|
23
|
-
(e2) => EE.
|
26
|
+
(e2) => EE.equals(e1, e2),
|
24
27
|
() => false,
|
25
28
|
),
|
26
29
|
(a1) =>
|
27
30
|
y.match(
|
28
31
|
() => false,
|
29
|
-
(a2) => EA.
|
32
|
+
(a2) => EA.equals(a1, a2),
|
30
33
|
),
|
31
34
|
),
|
32
35
|
});
|
33
36
|
}
|
34
37
|
|
35
38
|
/**
|
36
|
-
* @tsplus
|
39
|
+
* @tsplus derive fncts.Eq[fncts.Either]<_> 10
|
37
40
|
*/
|
38
|
-
export function
|
39
|
-
|
40
|
-
|
41
|
-
|
41
|
+
export function deriveEq<A extends Either<any, any>>(
|
42
|
+
...[left, right]: [A] extends [Either<infer E, infer A>] ? [left: P.Eq<E>, right: P.Eq<A>] : never
|
43
|
+
): P.Eq<A> {
|
44
|
+
return Either.getEq(left, right);
|
45
|
+
}
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
return [
|
53
|
-
|
47
|
+
/**
|
48
|
+
* @tsplus static fncts.EitherOps getFilterable
|
49
|
+
*/
|
50
|
+
export function getFilerable<E>(/** @tsplus auto */ ME: P.Monoid<E>): P.Filterable<Either1F<E>> {
|
51
|
+
return <P.Filterable<Either1F<E>>>{
|
52
|
+
...Functor,
|
53
|
+
partitionMap: (fa, f) => {
|
54
|
+
concrete(fa);
|
55
|
+
if (fa._tag === EitherTag.Left) {
|
56
|
+
return [fa, fa];
|
57
|
+
}
|
58
|
+
const fb = f(fa.right);
|
59
|
+
concrete(fb);
|
60
|
+
switch (fb._tag) {
|
61
|
+
case EitherTag.Left:
|
62
|
+
return [Right(fb.left), Either.left(ME.nat)];
|
63
|
+
case EitherTag.Right:
|
64
|
+
return [Either.left(ME.nat), fb];
|
65
|
+
}
|
66
|
+
},
|
67
|
+
filter: <A>(fa: Either<E, A>, p: Predicate<A>) => {
|
68
|
+
concrete(fa);
|
69
|
+
switch (fa._tag) {
|
70
|
+
case EitherTag.Left:
|
71
|
+
return fa;
|
72
|
+
case EitherTag.Right:
|
73
|
+
return p(fa.right) ? fa : Either.left(ME.nat);
|
74
|
+
}
|
75
|
+
},
|
76
|
+
filterMap: (fa, f) => {
|
77
|
+
concrete(fa);
|
78
|
+
if (fa._tag === EitherTag.Left) {
|
79
|
+
return fa;
|
80
|
+
}
|
81
|
+
return f(fa.right).match(
|
82
|
+
() => Either.left(ME.nat),
|
83
|
+
(b) => Either.right(b),
|
84
|
+
);
|
85
|
+
},
|
86
|
+
partition: <A>(fa: Either<E, A>, p: Predicate<A>): readonly [Either<E, A>, Either<E, A>] => {
|
87
|
+
concrete(fa);
|
88
|
+
if (fa._tag === EitherTag.Left) {
|
89
|
+
return [fa, fa];
|
90
|
+
}
|
91
|
+
return p(fa.right) ? [Either.left(ME.nat), fa] : [fa, Either.left(ME.nat)];
|
92
|
+
},
|
54
93
|
};
|
94
|
+
}
|
55
95
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
);
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
return P.Filterable<EitherF, FixE>({
|
74
|
-
map_,
|
75
|
-
filter_,
|
76
|
-
filterMap_,
|
77
|
-
partition_,
|
78
|
-
partitionMap_,
|
96
|
+
/**
|
97
|
+
* @tsplus derive fncts.Guard[fncts.Either]<_> 10
|
98
|
+
*/
|
99
|
+
export function deriveGuard<A extends Either<any, any>>(
|
100
|
+
...[left, right]: [A] extends [Either<infer E, infer A>] ? [left: Guard<E>, right: Guard<A>] : never
|
101
|
+
): Guard<A> {
|
102
|
+
return Guard((u): u is A => {
|
103
|
+
if (Either.isEither(u)) {
|
104
|
+
if (u.isLeft()) {
|
105
|
+
return left.is(u.left);
|
106
|
+
}
|
107
|
+
if (u.isRight()) {
|
108
|
+
return right.is(u.right);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
return false;
|
79
112
|
});
|
80
113
|
}
|
114
|
+
|
115
|
+
/**
|
116
|
+
* @tsplus derive fncts.Decoder[fncts.Either]<_> 10
|
117
|
+
*/
|
118
|
+
export function deriveDecoder<A extends Either<any, any>>(
|
119
|
+
...[left, right]: [A] extends [Either<infer E, infer A>] ? [left: Decoder<E>, right: Decoder<A>] : never
|
120
|
+
): Decoder<A> {
|
121
|
+
const jsonDecoder = EitherJson.getDecoder(left, right);
|
122
|
+
return Decoder(
|
123
|
+
(u) =>
|
124
|
+
jsonDecoder
|
125
|
+
.decode(u)
|
126
|
+
.map((result) =>
|
127
|
+
result._tag === "Left" ? (Either.left(result.left) as A) : (Either.right(result.right) as A),
|
128
|
+
),
|
129
|
+
`Either<${left.label}, ${right.label}>`,
|
130
|
+
);
|
131
|
+
}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
* @tsplus fluent fncts.Environment add
|
3
3
|
*/
|
4
4
|
export function add<R, S, H extends S = S>(self: Environment<R>, service: H, tag: Tag<S>): Environment<R & Has<S>> {
|
5
|
-
|
5
|
+
const self0 = self.index === Number.MAX_SAFE_INTEGER ? self.clean : self;
|
6
|
+
return new Environment(self0.map.set(tag, [service, self0.index]), self0.index + 1);
|
6
7
|
}
|
7
8
|
|
8
9
|
/**
|
@@ -36,12 +37,27 @@ export function make(): Environment<unknown> {
|
|
36
37
|
* @tsplus fluent fncts.Environment union
|
37
38
|
*/
|
38
39
|
export function union<R, R1>(self: Environment<R>, that: Environment<R1>): Environment<R & R1> {
|
40
|
+
const [self0, that0] = self.index + that.index < self.index ? [self.clean, that.clean] : [self, that];
|
39
41
|
return new Environment(
|
40
|
-
|
41
|
-
|
42
|
+
self0.map.union(that0.map.map(([service, index]) => [service, self0.index + index] as const)),
|
43
|
+
self0.index + that0.index,
|
42
44
|
);
|
43
45
|
}
|
44
46
|
|
47
|
+
/**
|
48
|
+
* @tsplus getter fncts.Environment clean
|
49
|
+
*/
|
50
|
+
export function clean<R>(self: Environment<R>): Environment<R> {
|
51
|
+
const [map, index] = self.map.toList
|
52
|
+
.sort(Number.Ord.contramap(([, [, idx]]) => idx))
|
53
|
+
.foldLeft(
|
54
|
+
[HashMap.makeDefault<Tag<unknown>, readonly [unknown, number]>(), 0],
|
55
|
+
([map, index], [tag, [service]]) => [map.set(tag, [service, index] as const), index + 1],
|
56
|
+
);
|
57
|
+
|
58
|
+
return new Environment(map, index);
|
59
|
+
}
|
60
|
+
|
45
61
|
/**
|
46
62
|
* @tsplus fluent fncts.Environment unsafeGet
|
47
63
|
*/
|
@@ -67,7 +83,6 @@ export function unsafeGet<R, S>(self: Environment<R>, tag: Tag<S>): S {
|
|
67
83
|
},
|
68
84
|
(a) => a as S,
|
69
85
|
);
|
70
|
-
// return self.cache.unsafeGet(tag) as S;
|
71
86
|
}
|
72
87
|
|
73
88
|
/**
|
@@ -2,14 +2,14 @@
|
|
2
2
|
* @tsplus fluent fncts.Identity ap
|
3
3
|
*/
|
4
4
|
export function ap_<A, B>(fab: Identity<(a: A) => B>, fa: Identity<A>): Identity<B> {
|
5
|
-
return fab(fa);
|
5
|
+
return Identity.get(Identity.reverseGet(fab)(Identity.reverseGet(fa)));
|
6
6
|
}
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @tsplus fluent fncts.Identity map
|
10
10
|
*/
|
11
11
|
export function map_<A, B>(fa: Identity<A>, f: (a: A) => B): Identity<B> {
|
12
|
-
return f(fa);
|
12
|
+
return Identity.get(f(Identity.reverseGet(fa)));
|
13
13
|
}
|
14
14
|
|
15
15
|
/**
|
@@ -17,12 +17,27 @@ export function map_<A, B>(fa: Identity<A>, f: (a: A) => B): Identity<B> {
|
|
17
17
|
* @tsplus static fncts.IdentityOps __call
|
18
18
|
*/
|
19
19
|
export function pure<A>(a: A): Identity<A> {
|
20
|
-
return a;
|
20
|
+
return Identity.get(a);
|
21
21
|
}
|
22
22
|
|
23
23
|
/**
|
24
24
|
* @tsplus fluent fncts.Identity zipWith
|
25
25
|
*/
|
26
26
|
export function zipWith_<A, B, C>(fa: Identity<A>, fb: Identity<B>, f: (a: A, b: B) => C): Identity<C> {
|
27
|
-
return f(fa, fb);
|
27
|
+
return Identity.get(f(Identity.reverseGet(fa), Identity.reverseGet(fb)));
|
28
28
|
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @tsplus fluent fncts.Identity zip
|
32
|
+
*/
|
33
|
+
export function zip_<A, B>(fa: Identity<A>, fb: Identity<B>): Identity<readonly [A, B]> {
|
34
|
+
return fa.zipWith(fb, (a, b) => [a, b]);
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @tsplus getter fncts.Identity getIdentity
|
39
|
+
* @tsplus macro identity
|
40
|
+
*/
|
41
|
+
export function getIdentity<A>(self: Identity<A>): A {
|
42
|
+
return Identity.reverseGet(self);
|
43
|
+
}
|
@@ -1,11 +1,15 @@
|
|
1
|
+
export interface IdentityN {
|
2
|
+
readonly [HKT.T]: Identity<HKT._A<this>>
|
3
|
+
}
|
4
|
+
|
1
5
|
/**
|
2
6
|
* @tsplus type fncts.Identity
|
3
7
|
*/
|
4
|
-
export
|
8
|
+
export interface Identity<A> extends Newtype<"Identity", A> {}
|
5
9
|
|
6
10
|
/**
|
7
11
|
* @tsplus type fncts.IdentityOps
|
8
12
|
*/
|
9
|
-
export interface IdentityOps {}
|
13
|
+
export interface IdentityOps extends NewtypeIso<IdentityN> {}
|
10
14
|
|
11
|
-
export const Identity: IdentityOps =
|
15
|
+
export const Identity: IdentityOps = Newtype<IdentityN>();
|
@@ -1,21 +1,28 @@
|
|
1
|
-
import * as P from "../../typeclass.js";
|
2
|
-
import {
|
1
|
+
import type * as P from "../../typeclass.js";
|
2
|
+
import type { IdentityN } from "@fncts/base/data/Identity/definition";
|
3
3
|
|
4
|
-
|
5
|
-
readonly type: Identity<this["A"]>;
|
6
|
-
}
|
4
|
+
import { ap_, map_, pure, zip_, zipWith_ } from "./api.js";
|
7
5
|
|
8
6
|
/**
|
9
7
|
* @tsplus static fncts.IdentityOps Functor
|
10
8
|
*/
|
11
|
-
export const Functor
|
9
|
+
export const Functor: P.Functor<IdentityN> = {
|
10
|
+
map: map_,
|
11
|
+
};
|
12
12
|
|
13
13
|
/**
|
14
14
|
* @tsplus static fncts.IdentityOps Apply
|
15
15
|
*/
|
16
|
-
export const Apply
|
16
|
+
export const Apply: P.Apply<IdentityN> = {
|
17
|
+
...Functor,
|
18
|
+
zip: zip_,
|
19
|
+
zipWith: zipWith_,
|
20
|
+
};
|
17
21
|
|
18
22
|
/**
|
19
23
|
* @tsplus static fncts.IdentityOps Applicative
|
20
24
|
*/
|
21
|
-
export const Applicative
|
25
|
+
export const Applicative: P.Applicative<IdentityN> = {
|
26
|
+
...Apply,
|
27
|
+
pure,
|
28
|
+
};
|
@@ -0,0 +1,103 @@
|
|
1
|
+
/**
|
2
|
+
* @tsplus type fncts.io.Schedule.Interval
|
3
|
+
* @tsplus companion fncts.io.Schedule.IntervalOps
|
4
|
+
*/
|
5
|
+
export class Interval {
|
6
|
+
constructor(readonly startMilliseconds: number, readonly endMilliseconds: number) {}
|
7
|
+
}
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @tsplus static fncts.io.Schedule.IntervalOps after
|
11
|
+
*/
|
12
|
+
export function after(start: number): Interval {
|
13
|
+
return Interval(start, Number.MAX_SAFE_INTEGER);
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @tsplus static fncts.io.Schedule.IntervalOps before
|
18
|
+
*/
|
19
|
+
export function before(end: number): Interval {
|
20
|
+
return Interval(Number.MIN_SAFE_INTEGER, end);
|
21
|
+
}
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @tsplus static fncts.io.Schedule.IntervalOps empty
|
25
|
+
*/
|
26
|
+
export const empty: Interval = new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
27
|
+
|
28
|
+
/**
|
29
|
+
* @tsplus getter fncts.io.Schedule.Interval isEmpty
|
30
|
+
*/
|
31
|
+
export function isEmpty(self: Interval): boolean {
|
32
|
+
return self.startMilliseconds >= self.endMilliseconds;
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @tsplus fluent fncts.io.Schedule.Interval intersect
|
37
|
+
*/
|
38
|
+
export function intersect_(self: Interval, that: Interval): Interval {
|
39
|
+
const start = Math.max(self.startMilliseconds, that.startMilliseconds);
|
40
|
+
const end = Math.min(self.endMilliseconds, that.endMilliseconds);
|
41
|
+
return Interval(start, end);
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @tsplus fluent fncts.io.Schedule.Interval lt
|
46
|
+
* @tsplus operator fncts.io.Schedule.Interval <
|
47
|
+
*/
|
48
|
+
export function lt_(self: Interval, that: Interval): boolean {
|
49
|
+
return self.min(that) === self;
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* @tsplus static fncts.io.Schedule.IntervalOps __call
|
54
|
+
*/
|
55
|
+
export function makeInterval(start: number, end: number): Interval {
|
56
|
+
if (start <= end) return Interval(start, end);
|
57
|
+
else return Interval.empty;
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* @tsplus fluent fncts.io.Schedule.Interval max
|
62
|
+
*/
|
63
|
+
export function max_(self: Interval, that: Interval): Interval {
|
64
|
+
const m = self.min(that);
|
65
|
+
if (m === self) return that;
|
66
|
+
else return self;
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* @tsplus fluent fncts.io.Schedule.Interval min
|
71
|
+
*/
|
72
|
+
export function min_(self: Interval, that: Interval): Interval {
|
73
|
+
if (self.endMilliseconds <= that.startMilliseconds) return self;
|
74
|
+
if (that.endMilliseconds <= self.startMilliseconds) return that;
|
75
|
+
if (self.startMilliseconds < that.startMilliseconds) return self;
|
76
|
+
if (that.startMilliseconds < self.startMilliseconds) return that;
|
77
|
+
if (self.endMilliseconds <= that.endMilliseconds) return self;
|
78
|
+
return that;
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @tsplus getter fncts.io.Schedule.Interval isNonEmpty
|
83
|
+
*/
|
84
|
+
export function isNonEmpty(self: Interval): boolean {
|
85
|
+
return !self.isEmpty;
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* @tsplus getter fncts.io.Schedule.Interval size
|
90
|
+
*/
|
91
|
+
export function size(self: Interval): number {
|
92
|
+
return self.endMilliseconds - self.startMilliseconds;
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @tsplus fluent fncts.io.Schedule.Interval union
|
97
|
+
*/
|
98
|
+
export function union_(self: Interval, that: Interval): Maybe<Interval> {
|
99
|
+
const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
|
100
|
+
const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
|
101
|
+
if (istart <= iend) return Nothing();
|
102
|
+
else return Just(Interval(istart, iend));
|
103
|
+
}
|
package/_src/data/Maybe/api.ts
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
import type { MaybeF } from "./instances.js";
|
2
1
|
import type { Eq, Monoid } from "@fncts/base/typeclass";
|
3
2
|
import type { Nullable } from "@fncts/base/types";
|
4
3
|
|
5
|
-
import { Apply } from "@fncts/base/typeclass";
|
6
|
-
|
7
4
|
import { identity } from "../function.js";
|
8
5
|
import { MaybeTag } from "./definition.js";
|
9
6
|
|
@@ -11,14 +8,11 @@ import { MaybeTag } from "./definition.js";
|
|
11
8
|
* @tsplus fluent fncts.Maybe ap
|
12
9
|
*/
|
13
10
|
export function ap_<A, B>(self: Maybe<(a: A) => B>, fa: Maybe<A>): Maybe<B> {
|
11
|
+
self.concrete();
|
12
|
+
fa.concrete();
|
14
13
|
return self._tag === MaybeTag.Just && fa._tag === MaybeTag.Just ? Just(self.value(fa.value)) : Nothing();
|
15
14
|
}
|
16
15
|
|
17
|
-
/**
|
18
|
-
* @tsplus static fncts.MaybeOps sequenceS
|
19
|
-
*/
|
20
|
-
export const sequenceS = Apply.sequenceSF<MaybeF>({ map_, ap_, zipWith_ });
|
21
|
-
|
22
16
|
/**
|
23
17
|
* Applies `f` to the value contained in `Maybe` if it is `Just` and returns the result,
|
24
18
|
* otherwise returns `Nothing`.
|
@@ -26,23 +20,16 @@ export const sequenceS = Apply.sequenceSF<MaybeF>({ map_, ap_, zipWith_ });
|
|
26
20
|
* @tsplus fluent fncts.Maybe flatMap
|
27
21
|
*/
|
28
22
|
export function flatMap_<A, B>(self: Maybe<A>, f: (a: A) => Maybe<B>): Maybe<B> {
|
23
|
+
self.concrete();
|
29
24
|
return self._tag === MaybeTag.Just ? f(self.value) : (self as Nothing);
|
30
25
|
}
|
31
26
|
|
32
|
-
/**
|
33
|
-
* @constrained
|
34
|
-
*/
|
35
|
-
export function elem_<A>(E: Eq<A>) {
|
36
|
-
return (self: Maybe<A>, elem: A): boolean => (self._tag === MaybeTag.Just ? E.equals_(self.value, elem) : false);
|
37
|
-
}
|
38
|
-
|
39
27
|
/**
|
40
28
|
* @tsplus fluent fncts.Maybe elem
|
41
29
|
*/
|
42
|
-
export function
|
43
|
-
|
44
|
-
|
45
|
-
elem_(E)(self, elem);
|
30
|
+
export function elem_<A>(self: Maybe<A>, elem: A, E: Eq<A>): boolean {
|
31
|
+
self.concrete();
|
32
|
+
return self._tag === MaybeTag.Just ? E.equals(self.value, elem) : false;
|
46
33
|
}
|
47
34
|
|
48
35
|
/**
|
@@ -50,6 +37,7 @@ export function elemSelf<A>(self: Maybe<A>) {
|
|
50
37
|
* @tsplus fluent fncts.Maybe exists
|
51
38
|
*/
|
52
39
|
export function exists_<A>(self: Maybe<A>, p: Predicate<A>): boolean {
|
40
|
+
self.concrete();
|
53
41
|
return self._tag === MaybeTag.Just ? p(self.value) : false;
|
54
42
|
}
|
55
43
|
|
@@ -59,6 +47,7 @@ export function exists_<A>(self: Maybe<A>, p: Predicate<A>): boolean {
|
|
59
47
|
export function filter_<A, B>(self: Maybe<A>, p: Predicate<A>): Maybe<A>;
|
60
48
|
export function filter_<A, B extends A>(self: Maybe<A>, p: Refinement<A, B>): Maybe<B>;
|
61
49
|
export function filter_<A, B>(self: Maybe<A>, p: Predicate<A>): Maybe<A> {
|
50
|
+
self.concrete();
|
62
51
|
return self._tag === MaybeTag.Just && p(self.value) ? self : Nothing();
|
63
52
|
}
|
64
53
|
|
@@ -82,6 +71,7 @@ export function flatten<A>(self: Maybe<Maybe<A>>): Maybe<A> {
|
|
82
71
|
export function partition_<A>(self: Maybe<A>, p: Predicate<A>): readonly [Maybe<A>, Maybe<A>];
|
83
72
|
export function partition_<A, B extends A>(self: Maybe<A>, p: Refinement<A, B>): readonly [Maybe<A>, Maybe<B>];
|
84
73
|
export function partition_<A>(self: Maybe<A>, p: Predicate<A>): readonly [Maybe<A>, Maybe<A>] {
|
74
|
+
self.concrete();
|
85
75
|
return self._tag === MaybeTag.Just && p(self.value) ? [Nothing(), self] : [self, Nothing()];
|
86
76
|
}
|
87
77
|
|
@@ -89,6 +79,7 @@ export function partition_<A>(self: Maybe<A>, p: Predicate<A>): readonly [Maybe<
|
|
89
79
|
* @tsplus fluent fncts.Maybe partitionMap
|
90
80
|
*/
|
91
81
|
export function partitionMap_<A, B, C>(self: Maybe<A>, f: (a: A) => Either<B, C>): readonly [Maybe<B>, Maybe<C>] {
|
82
|
+
self.concrete();
|
92
83
|
if (self._tag === MaybeTag.Just) {
|
93
84
|
return f(self.value).match(
|
94
85
|
(b) => [Just(b), Nothing()],
|
@@ -103,6 +94,7 @@ export function partitionMap_<A, B, C>(self: Maybe<A>, f: (a: A) => Either<B, C>
|
|
103
94
|
* @tsplus fluent fncts.Maybe foldLeft
|
104
95
|
*/
|
105
96
|
export function foldLeft_<A, B>(self: Maybe<A>, b: B, f: (b: B, a: A) => B): B {
|
97
|
+
self.concrete();
|
106
98
|
return self._tag === MaybeTag.Just ? f(b, self.value) : b;
|
107
99
|
}
|
108
100
|
|
@@ -110,23 +102,16 @@ export function foldLeft_<A, B>(self: Maybe<A>, b: B, f: (b: B, a: A) => B): B {
|
|
110
102
|
* @tsplus fluent fncts.Maybe foldRight
|
111
103
|
*/
|
112
104
|
export function foldRight_<A, B>(self: Maybe<A>, b: B, f: (a: A, b: B) => B): B {
|
105
|
+
self.concrete();
|
113
106
|
return self._tag === MaybeTag.Just ? f(self.value, b) : b;
|
114
107
|
}
|
115
108
|
|
116
109
|
/**
|
117
|
-
* @
|
118
|
-
*/
|
119
|
-
export function foldMap_<M>(M: Monoid<M>) {
|
120
|
-
return <A>(self: Maybe<A>, f: (a: A) => M): M => (self._tag === MaybeTag.Just ? f(self.value) : M.nat);
|
121
|
-
}
|
122
|
-
|
123
|
-
/**
|
124
|
-
* @tsplus getter fncts.Maybe foldMap
|
110
|
+
* @tsplus fluent fncts.Maybe foldMap
|
125
111
|
*/
|
126
|
-
export function
|
127
|
-
|
128
|
-
|
129
|
-
foldMap_(M)(self, f);
|
112
|
+
export function foldMap_<A, M>(self: Maybe<A>, f: (a: A) => M, /** @tsplus auto */ M: Monoid<M>): M {
|
113
|
+
self.concrete();
|
114
|
+
return self._tag === MaybeTag.Just ? f(self.value) : M.nat;
|
130
115
|
}
|
131
116
|
|
132
117
|
/**
|
@@ -135,6 +120,7 @@ export function foldMapSelf<A>(self: Maybe<A>) {
|
|
135
120
|
* @tsplus fluent fncts.Maybe getOrElse
|
136
121
|
*/
|
137
122
|
export function getOrElse_<A, B>(self: Maybe<A>, orElse: Lazy<B>): A | B {
|
123
|
+
self.concrete();
|
138
124
|
return self._tag === MaybeTag.Just ? self.value : orElse();
|
139
125
|
}
|
140
126
|
|
@@ -144,6 +130,7 @@ export function getOrElse_<A, B>(self: Maybe<A>, orElse: Lazy<B>): A | B {
|
|
144
130
|
* @tsplus fluent fncts.Maybe map
|
145
131
|
*/
|
146
132
|
export function map_<A, B>(self: Maybe<A>, f: (a: A) => B): Maybe<B> {
|
133
|
+
self.concrete();
|
147
134
|
return self._tag === MaybeTag.Just ? Just(f(self.value)) : (self as Nothing);
|
148
135
|
}
|
149
136
|
|
@@ -160,6 +147,7 @@ export function mapNullable_<A, B>(self: Maybe<A>, f: (a: A) => Nullable<B>): Ma
|
|
160
147
|
* @tsplus fluent fncts.Maybe orElse
|
161
148
|
*/
|
162
149
|
export function orElse_<A, B>(self: Maybe<A>, fb: Lazy<Maybe<B>>): Maybe<A | B> {
|
150
|
+
self.concrete();
|
163
151
|
return self._tag === MaybeTag.Nothing ? fb() : self;
|
164
152
|
}
|
165
153
|
|
@@ -176,6 +164,8 @@ export function toUndefined<A>(self: Maybe<A>): A | undefined {
|
|
176
164
|
* @tsplus fluent fncts.Maybe zipWith
|
177
165
|
*/
|
178
166
|
export function zipWith_<A, B, C>(self: Maybe<A>, fb: Maybe<B>, f: (a: A, b: B) => C): Maybe<C> {
|
167
|
+
self.concrete();
|
168
|
+
fb.concrete();
|
179
169
|
return self._tag === MaybeTag.Just && fb._tag === MaybeTag.Just ? Just(f(self.value, fb.value)) : Nothing();
|
180
170
|
}
|
181
171
|
|
@@ -8,17 +8,31 @@ export const enum MaybeTag {
|
|
8
8
|
export const MaybeTypeId = Symbol.for("fncts.Maybe");
|
9
9
|
export type MaybeTypdId = typeof MaybeTypeId;
|
10
10
|
|
11
|
+
export type MaybeF = Maybe<any>;
|
12
|
+
|
11
13
|
const _justHash = Hashable.string("fncts.Just");
|
12
14
|
const _nothingHash = Hashable.string("fncts.Nothing");
|
13
15
|
|
16
|
+
/**
|
17
|
+
* @tsplus type fncts.Maybe
|
18
|
+
* @tsplus companion fncts.MaybeOps
|
19
|
+
*/
|
20
|
+
export class Maybe<A> {
|
21
|
+
readonly _typeId: MaybeTypdId = MaybeTypeId;
|
22
|
+
readonly [HKT.F]!: MaybeF;
|
23
|
+
readonly [HKT.A]!: () => A;
|
24
|
+
readonly [HKT.T]!: Maybe<HKT._A<this>>;
|
25
|
+
}
|
26
|
+
|
14
27
|
/**
|
15
28
|
* @tsplus type fncts.Just
|
16
29
|
* @tsplus companion fncts.JustOps
|
17
30
|
*/
|
18
|
-
export class Just<A> {
|
19
|
-
readonly
|
20
|
-
readonly
|
21
|
-
|
31
|
+
export class Just<A> extends Maybe<A> {
|
32
|
+
readonly _tag = MaybeTag.Just;
|
33
|
+
constructor(readonly value: A) {
|
34
|
+
super();
|
35
|
+
}
|
22
36
|
[Symbol.equals](that: unknown): boolean {
|
23
37
|
return isMaybe(that) && that.isJust() && Equatable.strictEquals(this.value, that.value);
|
24
38
|
}
|
@@ -31,9 +45,8 @@ export class Just<A> {
|
|
31
45
|
* @tsplus type fncts.Nothing
|
32
46
|
* @tsplus companion fncts.NothingOps
|
33
47
|
*/
|
34
|
-
export class Nothing {
|
35
|
-
readonly
|
36
|
-
readonly _tag = MaybeTag.Nothing;
|
48
|
+
export class Nothing extends Maybe<never> {
|
49
|
+
readonly _tag = MaybeTag.Nothing;
|
37
50
|
[Symbol.equals](that: unknown): boolean {
|
38
51
|
return isMaybe(that) && that.isNothing();
|
39
52
|
}
|
@@ -42,18 +55,6 @@ export class Nothing {
|
|
42
55
|
}
|
43
56
|
}
|
44
57
|
|
45
|
-
/**
|
46
|
-
* @tsplus type fncts.Maybe
|
47
|
-
*/
|
48
|
-
export type Maybe<A> = Just<A> | Nothing;
|
49
|
-
|
50
|
-
/**
|
51
|
-
* @tsplus type fncts.MaybeOps
|
52
|
-
*/
|
53
|
-
export interface MaybeOps {}
|
54
|
-
|
55
|
-
export const Maybe: MaybeOps = {};
|
56
|
-
|
57
58
|
/**
|
58
59
|
* @tsplus unify fncts.Maybe
|
59
60
|
*/
|
@@ -78,6 +79,7 @@ export function isMaybe(u: unknown): u is Maybe<unknown> {
|
|
78
79
|
* @tsplus fluent fncts.Maybe isJust
|
79
80
|
*/
|
80
81
|
export function isJust<A>(self: Maybe<A>): self is Just<A> {
|
82
|
+
self.concrete();
|
81
83
|
return self._tag === MaybeTag.Just;
|
82
84
|
}
|
83
85
|
|
@@ -87,5 +89,15 @@ export function isJust<A>(self: Maybe<A>): self is Just<A> {
|
|
87
89
|
* @tsplus fluent fncts.Maybe isNothing
|
88
90
|
*/
|
89
91
|
export function isNothing<A>(self: Maybe<A>): self is Nothing {
|
92
|
+
self.concrete();
|
90
93
|
return self._tag === MaybeTag.Nothing;
|
91
94
|
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* @tsplus fluent fncts.Maybe concrete
|
98
|
+
* @tsplus static fncts.MaybeOps concrete
|
99
|
+
* @tsplus macro remove
|
100
|
+
*/
|
101
|
+
export function concrete<A>(self: Maybe<A>): asserts self is Just<A> | Nothing {
|
102
|
+
//
|
103
|
+
}
|