@fncts/base 0.0.12 → 0.0.13
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 +16 -21
- package/_cjs/collection/Iterable/api/traverseConc.cjs.map +1 -1
- package/_cjs/collection/compat/Record/instances.cjs +67 -16
- package/_cjs/collection/compat/Record/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +9 -12
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/definition.cjs +41 -43
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Dictionary/definition.cjs +2 -4
- package/_cjs/collection/immutable/Dictionary/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +26 -29
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +15 -17
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +136 -153
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +10 -12
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs +11 -9
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs +21 -22
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs +3 -9
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs +8 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/definition.cjs +13 -15
- package/_cjs/collection/immutable/RoseTree/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +8 -12
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs +11 -13
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakMap.cjs +51 -2
- package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
- package/_cjs/collection/weak/IterableWeakSet.cjs +59 -7
- package/_cjs/collection/weak/IterableWeakSet.cjs.map +1 -1
- package/_cjs/control/Eval/api.cjs +9 -3
- package/_cjs/control/Eval/api.cjs.map +1 -1
- package/_cjs/control/Eval/definition.cjs +0 -7
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Eval/instance.cjs +6 -0
- package/_cjs/control/Eval/instance.cjs.map +1 -1
- package/_cjs/control/Z/api.cjs +16 -14
- package/_cjs/control/Z/api.cjs.map +1 -1
- package/_cjs/control/Z/definition.cjs +9 -14
- package/_cjs/control/Z/definition.cjs.map +1 -1
- package/_cjs/control/Z/instances.cjs +6 -0
- package/_cjs/control/Z/instances.cjs.map +1 -1
- package/_cjs/control/Z/runtime.cjs +15 -13
- package/_cjs/control/Z/runtime.cjs.map +1 -1
- package/_cjs/data/Const/definition.cjs +0 -7
- package/_cjs/data/Const/definition.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +7 -5
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/Datum/api.cjs +479 -0
- package/_cjs/data/Datum/api.cjs.map +1 -0
- package/_cjs/data/Datum/definition.cjs +142 -0
- package/_cjs/data/Datum/definition.cjs.map +1 -0
- package/_cjs/data/Datum/instances.cjs +69 -0
- package/_cjs/data/Datum/instances.cjs.map +1 -0
- package/_cjs/data/DatumEither/api.cjs +365 -0
- package/_cjs/data/DatumEither/api.cjs.map +1 -0
- package/_cjs/data/DatumEither/definition.cjs +9 -0
- package/_cjs/data/DatumEither/definition.cjs.map +1 -0
- package/_cjs/data/DecodeError/definition.cjs +3 -3
- package/_cjs/data/DecodeError/definition.cjs.map +1 -1
- package/_cjs/data/Decoder/definition.cjs +3 -10
- package/_cjs/data/Decoder/definition.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +21 -5
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +3 -10
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +25 -23
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/EitherT/api.cjs +106 -0
- package/_cjs/data/EitherT/api.cjs.map +1 -0
- package/_cjs/data/EitherT/definition.cjs +9 -0
- package/_cjs/data/EitherT/definition.cjs.map +1 -0
- package/_cjs/data/Environment/api.cjs +15 -14
- package/_cjs/data/Environment/api.cjs.map +1 -1
- package/_cjs/data/Environment/definition.cjs.map +1 -1
- package/_cjs/data/Identity/api.cjs +3 -1
- package/_cjs/data/Identity/api.cjs.map +1 -1
- package/_cjs/data/Identity/definition.cjs +2 -4
- package/_cjs/data/Identity/definition.cjs.map +1 -1
- package/_cjs/data/Identity/instances.cjs +6 -0
- package/_cjs/data/Identity/instances.cjs.map +1 -1
- package/_cjs/data/Intervals.cjs +292 -0
- package/_cjs/data/Intervals.cjs.map +1 -0
- package/_cjs/data/Maybe/api.cjs +3 -1
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +11 -13
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +13 -11
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Newtype.cjs +3 -5
- package/_cjs/data/Newtype.cjs.map +1 -1
- package/_cjs/data/Struct/definition.cjs +2 -4
- package/_cjs/data/Struct/definition.cjs.map +1 -1
- package/_cjs/data/Zipped.cjs +55 -0
- package/_cjs/data/Zipped.cjs.map +1 -0
- package/_cjs/data/function/api.cjs +10 -0
- package/_cjs/data/function/api.cjs.map +1 -1
- package/_cjs/data/object/instances.cjs +9 -1
- package/_cjs/data/object/instances.cjs.map +1 -1
- package/_cjs/optics/Optional/definition.cjs +4 -6
- 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 +1 -1
- package/_cjs/optics/Traversal/api/fromTraversable.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +3 -3
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/typeclass/Alt.cjs +0 -7
- package/_cjs/typeclass/Alt.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +9 -35
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Apply.cjs +39 -66
- package/_cjs/typeclass/Apply.cjs.map +1 -1
- package/_cjs/typeclass/Chain.cjs +6 -28
- package/_cjs/typeclass/Chain.cjs.map +1 -1
- package/_cjs/typeclass/Fail.cjs +0 -10
- package/_cjs/typeclass/Fail.cjs.map +1 -1
- package/_cjs/typeclass/Filterable.cjs +0 -36
- package/_cjs/typeclass/Filterable.cjs.map +1 -1
- package/_cjs/typeclass/Foldable.cjs +4 -34
- package/_cjs/typeclass/Foldable.cjs.map +1 -1
- package/_cjs/typeclass/FoldableWithIndex.cjs +4 -34
- package/_cjs/typeclass/FoldableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Functor.cjs +3 -18
- package/_cjs/typeclass/Functor.cjs.map +1 -1
- package/_cjs/typeclass/Guard/definition.cjs +3 -10
- package/_cjs/typeclass/Guard/definition.cjs.map +1 -1
- package/_cjs/typeclass/MonadExcept.cjs +2 -10
- package/_cjs/typeclass/MonadExcept.cjs.map +1 -1
- package/_cjs/typeclass/Nil.cjs +0 -10
- package/_cjs/typeclass/Nil.cjs.map +1 -1
- package/_cjs/typeclass/Pointed.cjs +0 -11
- package/_cjs/typeclass/Pointed.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +18 -46
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Semimonoidal.cjs +0 -11
- package/_cjs/typeclass/Semimonoidal.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs +12 -12
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/typeclass/Traversable.cjs +7 -26
- package/_cjs/typeclass/Traversable.cjs.map +1 -1
- package/_cjs/typeclass/TraversableWithIndex.cjs +3 -7
- package/_cjs/typeclass/TraversableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +3 -45
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +8 -44
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_mjs/collection/Iterable/api/traverseConc.mjs +16 -21
- package/_mjs/collection/Iterable/api/traverseConc.mjs.map +1 -1
- package/_mjs/collection/compat/Record/instances.mjs +62 -16
- package/_mjs/collection/compat/Record/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api.mjs +7 -11
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs +41 -42
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Dictionary/definition.mjs +2 -3
- package/_mjs/collection/immutable/Dictionary/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +18 -20
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +15 -16
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +128 -147
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +10 -11
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs +9 -8
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +18 -19
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs +0 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs +4 -3
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/definition.mjs +13 -14
- package/_mjs/collection/immutable/RoseTree/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +8 -12
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs +11 -12
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/weak/IterableWeakMap.mjs +51 -2
- package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
- package/_mjs/collection/weak/IterableWeakSet.mjs +59 -7
- package/_mjs/collection/weak/IterableWeakSet.mjs.map +1 -1
- package/_mjs/control/Eval/api.mjs +9 -4
- package/_mjs/control/Eval/api.mjs.map +1 -1
- package/_mjs/control/Eval/definition.mjs +0 -1
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/instance.mjs +1 -0
- package/_mjs/control/Eval/instance.mjs.map +1 -1
- package/_mjs/control/Z/api.mjs +16 -15
- package/_mjs/control/Z/api.mjs.map +1 -1
- package/_mjs/control/Z/definition.mjs +4 -5
- package/_mjs/control/Z/definition.mjs.map +1 -1
- package/_mjs/control/Z/instances.mjs +1 -0
- package/_mjs/control/Z/instances.mjs.map +1 -1
- package/_mjs/control/Z/runtime.mjs +14 -13
- package/_mjs/control/Z/runtime.mjs.map +1 -1
- package/_mjs/data/Const/definition.mjs +0 -3
- package/_mjs/data/Const/definition.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +6 -5
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/Datum/api.mjs +403 -0
- package/_mjs/data/Datum/api.mjs.map +1 -0
- package/_mjs/data/Datum/definition.mjs +112 -0
- package/_mjs/data/Datum/definition.mjs.map +1 -0
- package/_mjs/data/Datum/instances.mjs +52 -0
- package/_mjs/data/Datum/instances.mjs.map +1 -0
- package/_mjs/data/DatumEither/api.mjs +290 -0
- package/_mjs/data/DatumEither/api.mjs.map +1 -0
- package/_mjs/data/DatumEither/definition.mjs +2 -0
- package/_mjs/data/DatumEither/definition.mjs.map +1 -0
- package/_mjs/data/DecodeError/definition.mjs +3 -3
- package/_mjs/data/DecodeError/definition.mjs.map +1 -1
- package/_mjs/data/Decoder/definition.mjs +0 -2
- package/_mjs/data/Decoder/definition.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +16 -3
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +0 -2
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +23 -22
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/EitherT/api.mjs +73 -0
- package/_mjs/data/EitherT/api.mjs.map +1 -0
- package/_mjs/data/EitherT/definition.mjs +2 -0
- package/_mjs/data/EitherT/definition.mjs.map +1 -0
- package/_mjs/data/Environment/api.mjs +12 -13
- package/_mjs/data/Environment/api.mjs.map +1 -1
- package/_mjs/data/Environment/definition.mjs.map +1 -1
- package/_mjs/data/Identity/api.mjs +2 -1
- package/_mjs/data/Identity/api.mjs.map +1 -1
- package/_mjs/data/Identity/definition.mjs +2 -3
- package/_mjs/data/Identity/definition.mjs.map +1 -1
- package/_mjs/data/Identity/instances.mjs +1 -0
- package/_mjs/data/Identity/instances.mjs.map +1 -1
- package/_mjs/data/Intervals.mjs +257 -0
- package/_mjs/data/Intervals.mjs.map +1 -0
- package/_mjs/data/Maybe/api.mjs +2 -1
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs +8 -10
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +12 -11
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Newtype.mjs +3 -4
- package/_mjs/data/Newtype.mjs.map +1 -1
- package/_mjs/data/Struct/definition.mjs +2 -3
- package/_mjs/data/Struct/definition.mjs.map +1 -1
- package/_mjs/data/Zipped.mjs +37 -0
- package/_mjs/data/Zipped.mjs.map +1 -0
- package/_mjs/data/function/api.mjs +8 -0
- package/_mjs/data/function/api.mjs.map +1 -1
- package/_mjs/data/object/instances.mjs +7 -1
- package/_mjs/data/object/instances.mjs.map +1 -1
- package/_mjs/optics/Optional/definition.mjs +4 -5
- 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 +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +3 -3
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/typeclass/Alt.mjs +0 -5
- package/_mjs/typeclass/Alt.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +7 -32
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Apply.mjs +35 -65
- package/_mjs/typeclass/Apply.mjs.map +1 -1
- package/_mjs/typeclass/Chain.mjs +4 -25
- package/_mjs/typeclass/Chain.mjs.map +1 -1
- package/_mjs/typeclass/Fail.mjs +1 -8
- package/_mjs/typeclass/Fail.mjs.map +1 -1
- package/_mjs/typeclass/Filterable.mjs +0 -28
- package/_mjs/typeclass/Filterable.mjs.map +1 -1
- package/_mjs/typeclass/Foldable.mjs +3 -30
- package/_mjs/typeclass/Foldable.mjs.map +1 -1
- package/_mjs/typeclass/FoldableWithIndex.mjs +3 -30
- package/_mjs/typeclass/FoldableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Functor.mjs +3 -16
- package/_mjs/typeclass/Functor.mjs.map +1 -1
- package/_mjs/typeclass/Guard/definition.mjs +0 -2
- package/_mjs/typeclass/Guard/definition.mjs.map +1 -1
- package/_mjs/typeclass/MonadExcept.mjs +2 -9
- package/_mjs/typeclass/MonadExcept.mjs.map +1 -1
- package/_mjs/typeclass/Nil.mjs +1 -8
- package/_mjs/typeclass/Nil.mjs.map +1 -1
- package/_mjs/typeclass/Pointed.mjs +0 -9
- package/_mjs/typeclass/Pointed.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +17 -45
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Semimonoidal.mjs +0 -9
- package/_mjs/typeclass/Semimonoidal.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs +12 -12
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/typeclass/Traversable.mjs +6 -25
- package/_mjs/typeclass/Traversable.mjs.map +1 -1
- package/_mjs/typeclass/TraversableWithIndex.mjs +2 -6
- package/_mjs/typeclass/TraversableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +3 -40
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +6 -41
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_src/collection/Iterable/api/traverseConc.ts +24 -21
- package/_src/collection/compat/Record/instances.ts +44 -0
- package/_src/collection/immutable/Conc/api.ts +9 -11
- package/_src/collection/immutable/Conc/definition.ts +9 -5
- package/_src/collection/immutable/Dictionary/definition.ts +1 -1
- package/_src/collection/immutable/HashMap/api.ts +20 -17
- package/_src/collection/immutable/HashMap/definition.ts +10 -6
- package/_src/collection/immutable/ImmutableArray/api.ts +56 -113
- package/_src/collection/immutable/ImmutableArray/definition.ts +8 -5
- package/_src/collection/immutable/ImmutableArray/instances.ts +42 -42
- package/_src/collection/immutable/ImmutableNonEmptyArray/api.ts +13 -11
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +8 -3
- package/_src/collection/immutable/ImmutableNonEmptyArray/instances.ts +24 -25
- package/_src/collection/immutable/RoseTree/definition.ts +7 -4
- package/_src/collection/immutable/Vector/api.ts +12 -16
- package/_src/collection/immutable/Vector/definition.ts +9 -9
- package/_src/collection/weak/IterableWeakMap.ts +50 -5
- package/_src/collection/weak/IterableWeakSet.ts +57 -9
- package/_src/control/Eval/api.ts +5 -2
- package/_src/control/Eval/definition.ts +7 -4
- package/_src/control/Eval/instance.ts +7 -7
- package/_src/control/Z/api.ts +16 -25
- package/_src/control/Z/definition.ts +32 -31
- package/_src/control/Z/instances.ts +3 -3
- package/_src/control/Z/runtime.ts +7 -7
- package/_src/data/Const/definition.ts +9 -17
- package/_src/data/Const/instances.ts +5 -5
- package/_src/data/Datum/api.ts +376 -0
- package/_src/data/Datum/definition.ts +102 -0
- package/_src/data/Datum/instances.ts +34 -0
- package/_src/data/DatumEither/api.ts +348 -0
- package/_src/data/DatumEither/definition.ts +20 -0
- package/_src/data/DecodeError/definition.ts +3 -3
- package/_src/data/Decoder/definition.ts +7 -4
- package/_src/data/Either/api.ts +12 -2
- package/_src/data/Either/definition.ts +9 -14
- package/_src/data/Either/instances.ts +6 -6
- package/_src/data/EitherT/api.ts +239 -0
- package/_src/data/EitherT/definition.ts +23 -0
- package/_src/data/Environment/api.ts +8 -6
- package/_src/data/Environment/definition.ts +2 -2
- package/_src/data/Identity/api.ts +2 -2
- package/_src/data/Identity/definition.ts +2 -2
- package/_src/data/Identity/instances.ts +7 -7
- package/_src/data/Intervals.ts +126 -0
- package/_src/data/Maybe/api.ts +2 -2
- package/_src/data/Maybe/definition.ts +7 -4
- package/_src/data/Maybe/instances.ts +10 -10
- package/_src/data/Newtype.ts +32 -11
- package/_src/data/Struct/definition.ts +1 -1
- package/_src/data/Tag/definition.ts +2 -2
- package/_src/data/Zipped.ts +52 -0
- package/_src/data/function/api.ts +8 -0
- package/_src/data/object/instances.ts +11 -1
- package/_src/optics/Optional/definition.ts +2 -2
- package/_src/optics/Traversal/api/compose.ts +1 -1
- package/_src/optics/Traversal/api/fromTraversable.ts +11 -11
- package/_src/optics/Traversal/definition.ts +13 -12
- package/_src/typeclass/Align.ts +1 -1
- package/_src/typeclass/Alt.ts +24 -54
- package/_src/typeclass/Alternative.ts +1 -1
- package/_src/typeclass/Applicative.ts +6 -1
- package/_src/typeclass/ApplicativeExcept.ts +55 -81
- package/_src/typeclass/Apply.ts +224 -253
- package/_src/typeclass/Chain.ts +71 -98
- package/_src/typeclass/Fail.ts +10 -28
- package/_src/typeclass/Filterable.ts +13 -67
- package/_src/typeclass/FilterableWithIndex.ts +13 -13
- package/_src/typeclass/Foldable.ts +16 -35
- package/_src/typeclass/FoldableWithIndex.ts +14 -37
- package/_src/typeclass/Functor.ts +11 -21
- package/_src/typeclass/FunctorWithIndex.ts +4 -4
- package/_src/typeclass/Guard/definition.ts +1 -3
- package/_src/typeclass/Monad.ts +1 -1
- package/_src/typeclass/MonadExcept.ts +11 -7
- package/_src/typeclass/Nil.ts +10 -27
- package/_src/typeclass/Pointed.ts +11 -30
- package/_src/typeclass/Semialign.ts +285 -253
- package/_src/typeclass/Semimonoidal.ts +23 -54
- package/_src/typeclass/Showable/show.ts +8 -10
- package/_src/typeclass/Traversable.ts +45 -63
- package/_src/typeclass/TraversableWithIndex.ts +37 -34
- package/_src/typeclass/Witherable.ts +28 -115
- package/_src/typeclass/WitherableWithIndex.ts +82 -115
- package/_src/types/extractions.ts +1 -1
- package/collection/Iterable/api/traverseConc.d.ts +4 -6
- package/collection/compat/Record/instances.d.ts +12 -0
- package/collection/immutable/Conc/api.d.ts +4 -6
- package/collection/immutable/Conc/definition.d.ts +9 -6
- package/collection/immutable/Dictionary/definition.d.ts +1 -1
- package/collection/immutable/HashMap/api.d.ts +13 -13
- package/collection/immutable/HashMap/definition.d.ts +10 -7
- package/collection/immutable/ImmutableArray/api.d.ts +16 -18
- package/collection/immutable/ImmutableArray/definition.d.ts +8 -6
- package/collection/immutable/ImmutableArray/instances.d.ts +17 -17
- package/collection/immutable/ImmutableNonEmptyArray/api.d.ts +6 -5
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +7 -3
- package/collection/immutable/ImmutableNonEmptyArray/instances.d.ts +10 -10
- package/collection/immutable/RoseTree/definition.d.ts +7 -5
- package/collection/immutable/Vector/api.d.ts +4 -4
- package/collection/immutable/Vector/definition.d.ts +8 -9
- package/collection/weak/IterableWeakMap.d.ts +9 -3
- package/collection/weak/IterableWeakSet.d.ts +10 -4
- package/control/Eval/api.d.ts +6 -1
- package/control/Eval/definition.d.ts +6 -4
- package/control/Eval/instance.d.ts +3 -3
- package/control/Z/api.d.ts +8 -6
- package/control/Z/definition.d.ts +38 -32
- package/control/Z/instances.d.ts +2 -2
- package/control/Z/runtime.d.ts +5 -4
- package/data/Const/definition.d.ts +8 -16
- package/data/Const/instances.d.ts +4 -3
- package/data/Datum/api.d.ts +188 -0
- package/data/Datum/definition.d.ts +75 -0
- package/data/Datum/instances.d.ts +32 -0
- package/data/DatumEither/api.d.ts +169 -0
- package/data/DatumEither/definition.d.ts +21 -0
- package/data/Decoder/definition.d.ts +6 -4
- package/data/Either/api.d.ts +10 -0
- package/data/Either/definition.d.ts +8 -14
- package/data/Either/instances.d.ts +4 -3
- package/data/EitherT/api.d.ts +60 -0
- package/data/EitherT/definition.d.ts +12 -0
- package/data/Environment/api.d.ts +7 -5
- package/data/Environment/definition.d.ts +3 -3
- package/data/Identity/api.d.ts +2 -1
- package/data/Identity/definition.d.ts +2 -2
- package/data/Identity/instances.d.ts +3 -3
- package/data/Intervals.d.ts +53 -0
- package/data/Maybe/api.d.ts +2 -1
- package/data/Maybe/definition.d.ts +7 -4
- package/data/Maybe/instances.d.ts +6 -6
- package/data/Newtype.d.ts +9 -8
- package/data/Struct/definition.d.ts +1 -1
- package/data/Tag/definition.d.ts +2 -2
- package/data/Zipped.d.ts +24 -0
- package/data/function/api.d.ts +6 -0
- package/data/object/instances.d.ts +6 -1
- package/optics/Traversal/api/fromTraversable.d.ts +1 -1
- package/optics/Traversal/definition.d.ts +2 -4
- package/package.json +2 -2
- package/typeclass/Align.d.ts +1 -1
- package/typeclass/Alt.d.ts +2 -4
- package/typeclass/Alternative.d.ts +1 -1
- package/typeclass/Applicative.d.ts +2 -1
- package/typeclass/ApplicativeExcept.d.ts +5 -13
- package/typeclass/Apply.d.ts +20 -32
- package/typeclass/Chain.d.ts +5 -13
- package/typeclass/Fail.d.ts +2 -7
- package/typeclass/Filterable.d.ts +7 -31
- package/typeclass/FilterableWithIndex.d.ts +7 -7
- package/typeclass/Foldable.d.ts +6 -19
- package/typeclass/FoldableWithIndex.d.ts +6 -19
- package/typeclass/Functor.d.ts +4 -11
- package/typeclass/FunctorWithIndex.d.ts +2 -2
- package/typeclass/Guard/definition.d.ts +1 -4
- package/typeclass/Monad.d.ts +1 -1
- package/typeclass/MonadExcept.d.ts +3 -4
- package/typeclass/Nil.d.ts +2 -7
- package/typeclass/Pointed.d.ts +2 -7
- package/typeclass/Semialign.d.ts +26 -32
- package/typeclass/Semimonoidal.d.ts +3 -8
- package/typeclass/Traversable.d.ts +21 -12
- package/typeclass/TraversableWithIndex.d.ts +19 -6
- package/typeclass/Witherable.d.ts +5 -19
- package/typeclass/WitherableWithIndex.d.ts +33 -19
- package/types/extractions.d.ts +1 -1
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
export const traverse = traverse_1;
|
|
2
1
|
import { identity } from "@fncts/base/data/function";
|
|
3
2
|
export const Traversable = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
function traverse_1(ta, f,
|
|
9
|
-
/** @tsplus auto */
|
|
10
|
-
F,
|
|
11
|
-
/** @tsplus auto */
|
|
12
|
-
G) {
|
|
13
|
-
return F.traverse(ta, f, G);
|
|
3
|
+
export function mkTraverse_() {
|
|
4
|
+
return i => i();
|
|
14
5
|
}
|
|
15
6
|
/**
|
|
16
|
-
* @tsplus
|
|
7
|
+
* @tsplus static fncts.TraversableOps sequence
|
|
17
8
|
*/
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
F,
|
|
23
|
-
/** @tsplus auto */
|
|
24
|
-
G) {
|
|
25
|
-
const G_1 =
|
|
26
|
-
/** @tsplus auto */
|
|
27
|
-
G;
|
|
28
|
-
const F_1 =
|
|
29
|
-
/** @tsplus auto */
|
|
30
|
-
F;
|
|
31
|
-
return traverse_1(ta, identity, F_1, G_1);
|
|
10
|
+
export function sequence(F) {
|
|
11
|
+
// @ts-expect-error
|
|
12
|
+
return ta => G => F.traverse(ta)(G)(identity);
|
|
32
13
|
}
|
|
33
14
|
//# sourceMappingURL=Traversable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Traversable.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"Traversable.mjs","mappings":"AAIA,SAASA,QAAT,QAAyB,2BAAzB;AAoBA,OAAO,MAAMC,WAAW,GAAmB,EAApC;AAwBP,OAAM,SAAUC,WAAV,GAAqB;EACzB,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD;AAED;;;;AAGA,OAAM,SAAUC,QAAV,CACJC,CADI,EACiB;EAUrB;EACA,OAAQC,EAAD,IAASC,CAAD,IAAOF,CAAC,CAACG,QAAF,CAAWF,EAAX,EAAeC,CAAf,EAAkBP,QAAlB,CAAtB;AACD","names":["identity","Traversable","mkTraverse_","i","sequence","F","ta","G","traverse"],"sourceRoot":"","sources":["../../_src/typeclass/Traversable.ts"],"sourcesContent":[null]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export const TraversableWithIndex = {};
|
|
2
|
-
export function
|
|
3
|
-
|
|
4
|
-
F,
|
|
5
|
-
/** @tsplus auto */
|
|
6
|
-
G) {
|
|
7
|
-
return F.traverseWithIndex(ta, f, G);
|
|
2
|
+
export function mkTraverseWithIndex_() {
|
|
3
|
+
return i => i();
|
|
8
4
|
}
|
|
9
5
|
//# sourceMappingURL=TraversableWithIndex.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraversableWithIndex.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"TraversableWithIndex.mjs","mappings":"AA0BA,OAAO,MAAMA,oBAAoB,GAA4B,EAAtD;AA0BP,OAAM,SAAUC,oBAAV,GAA8B;EAClC,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD","names":["TraversableWithIndex","mkTraverseWithIndex_","i"],"sourceRoot":"","sources":["../../_src/typeclass/TraversableWithIndex.ts"],"sourcesContent":[null]}
|
|
@@ -1,47 +1,10 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/base/typeclass/Functor";
|
|
3
|
-
export const wither = wither_1;
|
|
4
2
|
export const Witherable = {};
|
|
5
3
|
/**
|
|
6
|
-
* @tsplus
|
|
4
|
+
* @tsplus static fncts.WitherableOps filterA
|
|
7
5
|
*/
|
|
8
6
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
F,
|
|
12
|
-
/** @tsplus auto */
|
|
13
|
-
G) {
|
|
14
|
-
const G_1 =
|
|
15
|
-
/** @tsplus auto */
|
|
16
|
-
G;
|
|
17
|
-
return F.wither(wa, f, G_1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function wilt(wa, f,
|
|
21
|
-
/** @tsplus auto */
|
|
22
|
-
F,
|
|
23
|
-
/** @tsplus auto */
|
|
24
|
-
G) {
|
|
25
|
-
const G_2 =
|
|
26
|
-
/** @tsplus auto */
|
|
27
|
-
G;
|
|
28
|
-
return F.wilt(wa, f, G_2);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @tsplus fluent fncts.Kind filterA
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
export function filterA(fa, p,
|
|
35
|
-
/** @tsplus auto */
|
|
36
|
-
F,
|
|
37
|
-
/** @tsplus auto */
|
|
38
|
-
G) {
|
|
39
|
-
const G_3 =
|
|
40
|
-
/** @tsplus auto */
|
|
41
|
-
G;
|
|
42
|
-
const F_1 =
|
|
43
|
-
/** @tsplus auto */
|
|
44
|
-
F;
|
|
45
|
-
return wither_1(fa, a => tsplus_module_2.map(p(a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing(), G), F_1, G_3);
|
|
7
|
+
export function filterA(F) {
|
|
8
|
+
return fa => G => p => F.wither(fa)(G)(a => G.map(p(a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing()));
|
|
46
9
|
}
|
|
47
10
|
//# sourceMappingURL=Witherable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witherable.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"Witherable.mjs","mappings":";AAyCA,OAAO,MAAMA,UAAU,GAAkB,EAAlC;AAEP;;;;AAGA,OAAM,SAAUC,OAAV,CACJC,CADI,EACgB;EAQpB,OAAQC,EAAD,IAASC,CAAD,IAAQC,CAAD,IAAOH,CAAC,CAACI,MAAF,CAASH,EAAT,EAAaC,CAAb,EAAiBG,CAAD,IAAOH,CAAC,CAACI,GAAF,CAAMH,CAAC,CAACE,CAAD,CAAP,EAAaE,EAAD,IAASA,EAAE,GAAGC,qBAAKH,CAAL,CAAH,GAAaG,yBAApC,CAAvB,CAA7B;AACD","names":["Witherable","filterA","F","fa","G","p","wither","a","map","bb","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/typeclass/Witherable.ts"],"sourcesContent":[null]}
|
|
@@ -1,47 +1,12 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/base/typeclass/Functor";
|
|
3
|
-
export const witherWithIndex = witherWithIndex_1;
|
|
4
2
|
export const WitherableWithIndex = {};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
function witherWithIndex_1(wa, f,
|
|
10
|
-
/** @tsplus auto */
|
|
11
|
-
F,
|
|
12
|
-
/** @tsplus auto */
|
|
13
|
-
G) {
|
|
14
|
-
const G_1 =
|
|
15
|
-
/** @tsplus auto */
|
|
16
|
-
G;
|
|
17
|
-
return F.witherWithIndex(wa, f, G_1);
|
|
3
|
+
export function makeWitherWithIndex() {
|
|
4
|
+
return i => i();
|
|
18
5
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export function wiltWithIndex(wa, f,
|
|
25
|
-
/** @tsplus auto */
|
|
26
|
-
F,
|
|
27
|
-
/** @tsplus auto */
|
|
28
|
-
G) {
|
|
29
|
-
const G_2 =
|
|
30
|
-
/** @tsplus auto */
|
|
31
|
-
G;
|
|
32
|
-
return F.wiltWithIndex(wa, f, G_2);
|
|
6
|
+
export function makeWiltWithIndex() {
|
|
7
|
+
return i => i();
|
|
33
8
|
}
|
|
34
|
-
export function filterWithIndexA(
|
|
35
|
-
|
|
36
|
-
F,
|
|
37
|
-
/** @tsplus auto */
|
|
38
|
-
G) {
|
|
39
|
-
const G_3 =
|
|
40
|
-
/** @tsplus auto */
|
|
41
|
-
G;
|
|
42
|
-
const F_1 =
|
|
43
|
-
/** @tsplus auto */
|
|
44
|
-
F;
|
|
45
|
-
return witherWithIndex_1(fa, (i, a) => tsplus_module_2.map(p(i, a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing(), G), F_1, G_3);
|
|
9
|
+
export function filterWithIndexA(F) {
|
|
10
|
+
return fa => G => p => F.witherWithIndex(fa)(G)((i, a) => G.map(p(i, a), bb => bb ? tsplus_module_1.just(a) : tsplus_module_1.nothing()));
|
|
46
11
|
}
|
|
47
12
|
//# sourceMappingURL=WitherableWithIndex.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WitherableWithIndex.mjs","mappings":"
|
|
1
|
+
{"version":3,"file":"WitherableWithIndex.mjs","mappings":";AA6CA,OAAO,MAAMA,mBAAmB,GAA2B,EAApD;AA0BP,OAAM,SAAUC,mBAAV,GAA6B;EACjC,OAAQC,CAAD,IAAYA,CAAC,EAApB;AACD;AA8BD,OAAM,SAAUC,iBAAV,GAA2B;EAC/B,OAAQD,CAAD,IAAYA,CAAC,EAApB;AACD;AAED,OAAM,SAAUE,gBAAV,CACJC,CADI,EACyB;EAQ7B,OAAQC,EAAD,IAASC,CAAD,IAAQC,CAAD,IAAOH,CAAC,CAACI,eAAF,CAAkBH,EAAlB,EAAsBC,CAAtB,EAAyB,CAACL,CAAD,EAAIQ,CAAJ,KAAUH,CAAC,CAACI,GAAF,CAAMH,CAAC,CAACN,CAAD,EAAIQ,CAAJ,CAAP,EAAgBE,EAAD,IAASA,EAAE,GAAGC,qBAAKH,CAAL,CAAH,GAAaG,yBAAvC,CAAnC,CAA7B;AACD","names":["WitherableWithIndex","makeWitherWithIndex","i","makeWiltWithIndex","filterWithIndexA","F","fa","G","p","witherWithIndex","a","map","bb","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/typeclass/WitherableWithIndex.ts"],"sourcesContent":[null]}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import type * as P from "@fncts/base/typeclass";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @tsplus
|
|
4
|
+
* @tsplus getter fncts.Iterable traverseToConcWithIndex
|
|
5
5
|
*/
|
|
6
|
-
export function traverseToConcWithIndex_<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
): HKT.Kind<G, K, Q, W, X, I, S, R, E, Conc<B>> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export function traverseToConcWithIndex_<A>(ta: Iterable<A>) {
|
|
7
|
+
return <G extends HKT, GC = HKT.None>(G: P.Applicative<G, GC>) =>
|
|
8
|
+
<K, Q, W, X, I, S, R, E, B>(
|
|
9
|
+
f: (i: number, a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
|
|
10
|
+
): HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Conc<B>> => {
|
|
11
|
+
let output = G.pure<Conc<B>, K, Q, W, X, I, S, R, E>(Conc.empty<B>());
|
|
12
|
+
const iterator = ta[Symbol.iterator]();
|
|
13
|
+
let result: IteratorResult<A>;
|
|
14
|
+
let i = 0;
|
|
15
|
+
while (!(result = iterator.next()).done) {
|
|
16
|
+
output = G.zipWith(output, f(i, result.value), (bs, b) => bs.append(b)) as typeof output;
|
|
17
|
+
i++;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
return output;
|
|
21
|
+
};
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* @tsplus
|
|
25
|
+
* @tsplus getter fncts.Iterable traverseToConc
|
|
25
26
|
*/
|
|
26
|
-
export function traverseToConc_<
|
|
27
|
+
export function traverseToConc_<A>(
|
|
27
28
|
ta: Iterable<A>,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
29
|
+
): <G extends HKT, GC = HKT.None>(
|
|
30
|
+
G: P.Applicative<G, GC>,
|
|
31
|
+
) => <K, Q, W, X, I, S, R, E, B>(
|
|
32
|
+
f: (a: A) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, B>,
|
|
33
|
+
) => HKT.Kind<G, GC, K, Q, W, X, I, S, R, E, Conc<B>> {
|
|
34
|
+
return (G) => (f) => ta.traverseToConcWithIndex(G)((_, a) => f(a));
|
|
32
35
|
}
|
|
@@ -2,6 +2,49 @@ import type { Check } from "@fncts/typelevel/Check";
|
|
|
2
2
|
|
|
3
3
|
import { CompoundError, MissingKeyError, OptionalKeyError, RequiredKeyError } from "@fncts/base/data/DecodeError";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @tsplus derive fncts.Guard<_> 15
|
|
7
|
+
*/
|
|
8
|
+
export function deriveDictionaryGuard<A extends Record<string, any>>(
|
|
9
|
+
...[value]: Check<Check.IsDictionary<A>> extends Check.True ? [value: Guard<A[keyof A]>] : never
|
|
10
|
+
): Guard<A> {
|
|
11
|
+
return Guard((u): u is A => {
|
|
12
|
+
if (!Derive<Guard<{}>>().is(u)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
for (const k of Object.keys(u)) {
|
|
16
|
+
if (!value.is(u[k])) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @tsplus derive fncts.Guard<_> 15
|
|
26
|
+
*/
|
|
27
|
+
export function deriveGuard<A extends Record<string, any>>(
|
|
28
|
+
...[key, value, requiredKeys]: Check<Check.IsRecord<A>> extends Check.True
|
|
29
|
+
? [key: Guard<keyof A>, value: Guard<A[keyof A]>, requiredKeys: { [k in keyof A]: 0 }]
|
|
30
|
+
: never
|
|
31
|
+
): Guard<A> {
|
|
32
|
+
const requiredKeysSet = new Set(Object.keys(requiredKeys));
|
|
33
|
+
return Guard((record): record is A => {
|
|
34
|
+
const missing = new Set(requiredKeysSet);
|
|
35
|
+
if (!Derive<Guard<{}>>().is(record)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
for (const k of Object.keys(record)) {
|
|
39
|
+
if (requiredKeysSet.has(k) && !value.is(record[k])) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
missing.delete(k);
|
|
43
|
+
}
|
|
44
|
+
return missing.size === 0;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
5
48
|
/**
|
|
6
49
|
* @tsplus derive fncts.Decoder<_> 15
|
|
7
50
|
*/
|
|
@@ -57,3 +100,4 @@ export function deriveDecoder<A extends Record<string, any>>(
|
|
|
57
100
|
return These.right(res as A);
|
|
58
101
|
}, `Record<string, ${valueDecoder.label}>`);
|
|
59
102
|
}
|
|
103
|
+
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Concat, ConcF } from "@fncts/base/collection/immutable/Conc/definition";
|
|
2
2
|
import type { Eq } from "@fncts/base/typeclass";
|
|
3
|
-
import type * as P from "@fncts/base/typeclass";
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
_Empty,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
import { EitherTag } from "@fncts/base/data/Either";
|
|
15
14
|
import { identity, tuple } from "@fncts/base/data/function";
|
|
16
15
|
import { Stack } from "@fncts/base/internal/Stack";
|
|
16
|
+
import * as P from "@fncts/base/typeclass";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @tsplus fluent fncts.Conc align
|
|
@@ -978,20 +978,18 @@ export function takeWhile_<A>(self: Conc<A>, p: Predicate<A>): Conc<A> {
|
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
/**
|
|
981
|
-
* @tsplus
|
|
981
|
+
* @tsplus getter fncts.Conc traverse
|
|
982
982
|
*/
|
|
983
|
-
export const traverse: P.Traversable<ConcF>["traverse"] = (self
|
|
983
|
+
export const traverse: P.Traversable<ConcF>["traverse"] = (self) => (G) => (f) =>
|
|
984
|
+
self.traverseWithIndex(G)((_, a) => f(a));
|
|
984
985
|
|
|
985
986
|
/**
|
|
986
|
-
* @tsplus
|
|
987
|
+
* @tsplus getter fncts.Conc traverseWithIndex
|
|
987
988
|
*/
|
|
988
|
-
export
|
|
989
|
-
self
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
): HKT.Kind<G, KG, QG, WG, XG, IG, SG, RG, EG, Conc<B>> {
|
|
993
|
-
return self.foldLeftWithIndex(G.pure(Conc.empty()), (i, fbs, a) => fbs.zipWith(f(i, a), (bs, b) => bs.append(b), G));
|
|
994
|
-
}
|
|
989
|
+
export const traverseWithIndex = P.TraversableWithIndex.makeTraverseWithIndex<ConcF>()(
|
|
990
|
+
() => (self) => (G) => (f) =>
|
|
991
|
+
self.foldLeftWithIndex(G.pure(Conc.empty()), (i, fbs, a) => G.zipWith(fbs, f(i, a), (bs, b) => bs.append(b))),
|
|
992
|
+
);
|
|
995
993
|
|
|
996
994
|
/**
|
|
997
995
|
* @tsplus getter fncts.Conc toBuffer
|
|
@@ -19,17 +19,20 @@ export const enum ConcTag {
|
|
|
19
19
|
ByteChunk = "ByteChunk",
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface ConcF extends
|
|
22
|
+
export interface ConcF extends HKT {
|
|
23
|
+
type: Conc<this["A"]>;
|
|
24
|
+
variance: {
|
|
25
|
+
A: "+";
|
|
26
|
+
};
|
|
27
|
+
index: number;
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
31
|
* @tsplus type fncts.Conc
|
|
26
32
|
* @tsplus companion fncts.ConcOps
|
|
27
33
|
*/
|
|
28
34
|
export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
29
|
-
|
|
30
|
-
[HKT.A]?: () => A;
|
|
31
|
-
[HKT.T]?: Conc<HKT._A<this>>;
|
|
32
|
-
[HKT.Ix]?: number;
|
|
35
|
+
readonly _A!: () => A;
|
|
33
36
|
|
|
34
37
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
|
35
38
|
abstract readonly length: number;
|
|
@@ -46,6 +49,7 @@ export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
|
46
49
|
|
|
47
50
|
abstract class ConcImplementation<A> implements Iterable<A> {
|
|
48
51
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
|
52
|
+
readonly _A!: () => A;
|
|
49
53
|
get [Symbol.hash](): number {
|
|
50
54
|
return Hashable.iterator(this[Symbol.iterator]());
|
|
51
55
|
}
|
|
@@ -55,8 +55,8 @@ export function makeDefault<K, V>(): HashMap<K, V> {
|
|
|
55
55
|
*
|
|
56
56
|
* @tsplus fluent fncts.HashMapOps fromFoldable
|
|
57
57
|
*/
|
|
58
|
-
export function fromFoldable<F extends HKT, C, K, A>(config: P.HashEq<K>, S: P.Semigroup<A>, F: P.Foldable<F>) {
|
|
59
|
-
return <K_, Q, W, X, I, S, R, E>(fka: HKT.Kind<F, K_, Q, W, X, I, S, R, E, readonly [K, A]>): HashMap<K, A> => {
|
|
58
|
+
export function fromFoldable<F extends HKT, C, K, A>(config: P.HashEq<K>, S: P.Semigroup<A>, F: P.Foldable<F, C>) {
|
|
59
|
+
return <K_, Q, W, X, I, S, R, E>(fka: HKT.Kind<F, C, K_, Q, W, X, I, S, R, E, readonly [K, A]>): HashMap<K, A> => {
|
|
60
60
|
return F.foldLeft(fka, makeWith(config), (b, [k, a]) => {
|
|
61
61
|
const oa = b.get(k);
|
|
62
62
|
if (oa.isJust()) {
|
|
@@ -529,15 +529,18 @@ export function foldLeft_<K, V, Z>(map: HashMap<K, V>, z: Z, f: (z: Z, v: V) =>
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
/**
|
|
532
|
-
* @tsplus
|
|
532
|
+
* @tsplus getter fncts.HashMap traverseWithIndex
|
|
533
533
|
*/
|
|
534
|
-
export const
|
|
535
|
-
|
|
534
|
+
export const traverseWithIndex = P.TraversableWithIndex.makeTraverseWithIndex<HashMapF>()(
|
|
535
|
+
() => (ta) => (G) => (f) =>
|
|
536
|
+
ta.foldLeftWithIndex(G.pure(makeWith(ta.config)), (k, b, a) => G.zipWith(b, f(k, a), (map, b) => map.set(k, b))),
|
|
537
|
+
);
|
|
536
538
|
|
|
537
539
|
/**
|
|
538
|
-
* @tsplus
|
|
540
|
+
* @tsplus getter fncts.HashMap traverse
|
|
539
541
|
*/
|
|
540
|
-
export const
|
|
542
|
+
export const traverse: P.Traversable<HashMapF>["traverse"] = (ta) => (G) => (f) =>
|
|
543
|
+
ta.traverseWithIndex(G)((_, a) => f(a));
|
|
541
544
|
|
|
542
545
|
/**
|
|
543
546
|
* @tsplus fluent fncts.HashMap unsafeGet
|
|
@@ -547,26 +550,26 @@ export function unsafeGet_<K, V>(self: HashMap<K, V>, key: K): V | undefined {
|
|
|
547
550
|
}
|
|
548
551
|
|
|
549
552
|
/**
|
|
550
|
-
* @tsplus
|
|
553
|
+
* @tsplus getter fncts.HashMap witherWithIndex
|
|
551
554
|
*/
|
|
552
|
-
export const
|
|
553
|
-
wa.traverseWithIndex(
|
|
555
|
+
export const witherWithIndex: P.WitherableWithIndex<HashMapF>["witherWithIndex"] = (wa) => (G) => (f) =>
|
|
556
|
+
G.map(wa.traverseWithIndex(G)(f), compact);
|
|
554
557
|
|
|
555
558
|
/**
|
|
556
|
-
* @tsplus
|
|
559
|
+
* @tsplus getter fncts.HashMap wither
|
|
557
560
|
*/
|
|
558
|
-
export const
|
|
561
|
+
export const wither: P.Witherable<HashMapF>["wither"] = (wa) => (G) => (f) => wa.witherWithIndex(G)((_, a) => f(a));
|
|
559
562
|
|
|
560
563
|
/**
|
|
561
|
-
* @tsplus
|
|
564
|
+
* @tsplus getter fncts.HashMap wiltWithIndex
|
|
562
565
|
*/
|
|
563
|
-
export const
|
|
564
|
-
wa.traverseWithIndex(
|
|
566
|
+
export const wiltWithIndex: P.WitherableWithIndex<HashMapF>["wiltWithIndex"] = (wa) => (G) => (f) =>
|
|
567
|
+
G.map(wa.traverseWithIndex(G)(f), separate);
|
|
565
568
|
|
|
566
569
|
/**
|
|
567
|
-
* @tsplus
|
|
570
|
+
* @tsplus getter fncts.HashMap wilt
|
|
568
571
|
*/
|
|
569
|
-
export const
|
|
572
|
+
export const wilt: P.Witherable<HashMapF>["wilt"] = (wa) => (G) => (f) => wa.wiltWithIndex(G)((_, a) => f(a));
|
|
570
573
|
|
|
571
574
|
/**
|
|
572
575
|
* @tsplus fluent fncts.HashMap unionWith
|
|
@@ -4,18 +4,22 @@ import type { HashEq } from "@fncts/base/typeclass";
|
|
|
4
4
|
import { isEmptyNode } from "@fncts/base/collection/immutable/HashMap/internal";
|
|
5
5
|
import { identity, tuple } from "@fncts/base/data/function";
|
|
6
6
|
|
|
7
|
-
export interface HashMapF extends
|
|
7
|
+
export interface HashMapF extends HKT {
|
|
8
|
+
type: HashMap<this["K"], this["A"]>;
|
|
9
|
+
variance: {
|
|
10
|
+
K: "+";
|
|
11
|
+
A: "+";
|
|
12
|
+
};
|
|
13
|
+
index: this["K"];
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
/**
|
|
10
17
|
* @tsplus type fncts.HashMap
|
|
11
18
|
* @tsplus companion fncts.HashMapOps
|
|
12
19
|
*/
|
|
13
20
|
export class HashMap<K, V> implements Iterable<readonly [K, V]>, Hashable, Equatable {
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly [HKT.A]!: () => V;
|
|
17
|
-
readonly [HKT.T]!: HashMap<HKT._K<this>, HKT._A<this>>;
|
|
18
|
-
readonly [HKT.Ix]!: K;
|
|
21
|
+
readonly _K!: () => K;
|
|
22
|
+
readonly _A!: () => V;
|
|
19
23
|
|
|
20
24
|
constructor(
|
|
21
25
|
public editable: boolean,
|