@fncts/base 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/_cjs/collection/compat/Array/api.cjs +10 -10
- package/_cjs/collection/compat/Array/derivations.cjs +96 -0
- package/_cjs/collection/compat/Array/derivations.cjs.map +1 -0
- package/_cjs/collection/compat/Array.cjs +13 -0
- package/_cjs/collection/compat/Array.cjs.map +1 -1
- package/_cjs/collection/compat.cjs +6 -0
- package/_cjs/collection/compat.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/derivations.cjs +45 -0
- package/_cjs/collection/immutable/Conc/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/Conc.cjs +13 -0
- package/_cjs/collection/immutable/Conc.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +6 -6
- package/_cjs/collection/immutable/ImmutableArray/constructors.cjs +2 -2
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs +9 -4
- package/_cjs/collection/immutable/ImmutableArray/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs +41 -0
- package/_cjs/collection/immutable/ImmutableArray/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableArray/instances.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray.cjs +13 -0
- package/_cjs/collection/immutable/ImmutableArray.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +2 -2
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs +62 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/derivations.cjs.map +1 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs +13 -0
- package/_cjs/collection/immutable/ImmutableNonEmptyArray.cjs.map +1 -1
- package/_cjs/collection/immutable/List/definition.cjs +2 -2
- package/_cjs/collection/immutable/Vector/internal.cjs +1 -1
- package/_cjs/collection/immutable.cjs +6 -0
- package/_cjs/collection/immutable.cjs.map +1 -0
- package/_cjs/collection/mutable/HashMap.cjs +4 -0
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/collection/mutable.cjs +6 -0
- package/_cjs/collection/mutable.cjs.map +1 -0
- package/_cjs/collection/weak.cjs +6 -0
- package/_cjs/collection/weak.cjs.map +1 -0
- package/_cjs/collection.cjs +6 -0
- package/_cjs/collection.cjs.map +1 -0
- package/_cjs/control/Eval/definition.cjs +1 -1
- package/_cjs/control/Eval/definition.cjs.map +1 -1
- package/_cjs/control/Z/api.cjs +9 -9
- package/_cjs/control/Z/api.cjs.map +1 -1
- package/_cjs/control/Z/definition.cjs +0 -1
- package/_cjs/control/Z/definition.cjs.map +1 -1
- package/_cjs/control/Z/runtime.cjs +2 -0
- package/_cjs/control/Z/runtime.cjs.map +1 -1
- package/_cjs/control.cjs +6 -0
- package/_cjs/control.cjs.map +1 -0
- package/_cjs/data/Cause/api/isEmpty.cjs +2 -0
- package/_cjs/data/Cause/api/isEmpty.cjs.map +1 -1
- package/_cjs/data/Cause/api/linearize.cjs +2 -0
- package/_cjs/data/Cause/api/linearize.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +2 -0
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/Const/instances.cjs +4 -3
- package/_cjs/data/Const/instances.cjs.map +1 -1
- package/_cjs/data/DecodeError/definition.cjs +13 -1
- package/_cjs/data/DecodeError/definition.cjs.map +1 -1
- package/_cjs/data/DecodeError/instances.cjs +6 -0
- package/_cjs/data/DecodeError/instances.cjs.map +1 -0
- package/_cjs/data/DecodeError.cjs +13 -0
- package/_cjs/data/DecodeError.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/definition.cjs +1 -1
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Intervals.cjs +2 -2
- package/_cjs/data/Intervals.cjs.map +1 -1
- package/_cjs/data/Patch/api.cjs +2 -0
- package/_cjs/data/Patch/api.cjs.map +1 -1
- package/_cjs/data/Struct/api.cjs +2 -0
- package/_cjs/data/Struct/api.cjs.map +1 -1
- package/_cjs/data/These/definition.cjs +1 -1
- package/_cjs/data/These/definition.cjs.map +1 -1
- package/_cjs/data/string/api.cjs +1 -1
- package/_cjs/data.cjs +6 -0
- package/_cjs/data.cjs.map +1 -0
- package/_cjs/global.cjs +6 -0
- package/_cjs/global.cjs.map +1 -0
- package/_cjs/index.cjs +6 -0
- package/_cjs/index.cjs.map +1 -0
- package/_cjs/json.cjs +6 -0
- package/_cjs/json.cjs.map +1 -0
- package/_cjs/optics/At/definition.cjs +2 -0
- package/_cjs/optics/At/definition.cjs.map +1 -1
- package/_cjs/optics/Iso/definition.cjs +4 -0
- package/_cjs/optics/Iso/definition.cjs.map +1 -1
- package/_cjs/optics/Lens/definition.cjs +4 -0
- package/_cjs/optics/Lens/definition.cjs.map +1 -1
- package/_cjs/optics/Optional/definition.cjs +2 -0
- package/_cjs/optics/Optional/definition.cjs.map +1 -1
- package/_cjs/optics/Prism/definition.cjs +2 -0
- package/_cjs/optics/Prism/definition.cjs.map +1 -1
- package/_cjs/optics/Traversal/definition.cjs +4 -0
- package/_cjs/optics/Traversal/definition.cjs.map +1 -1
- package/_cjs/optics.cjs +6 -0
- package/_cjs/optics.cjs.map +1 -0
- package/_cjs/typeclass/HashEq.cjs +2 -0
- package/_cjs/typeclass/HashEq.cjs.map +1 -1
- package/_cjs/typeclass/Monoid.cjs +2 -0
- package/_cjs/typeclass/Monoid.cjs.map +1 -1
- package/_cjs/typeclass/Ord/definition.cjs +2 -0
- package/_cjs/typeclass/Ord/definition.cjs.map +1 -1
- package/_cjs/typeclass/Ord/instances.cjs +4 -3
- package/_cjs/typeclass/Ord/instances.cjs.map +1 -1
- package/_cjs/typeclass/Showable/show.cjs.map +1 -1
- package/_cjs/util.cjs +6 -0
- package/_cjs/util.cjs.map +1 -0
- package/_mjs/collection/compat/Array/api.mjs +10 -10
- package/_mjs/collection/compat/Array/derivations.mjs +70 -0
- package/_mjs/collection/compat/Array/derivations.mjs.map +1 -0
- package/_mjs/collection/compat/Array.mjs +1 -0
- package/_mjs/collection/compat/Array.mjs.map +1 -1
- package/_mjs/collection/compat.mjs +2 -0
- package/_mjs/collection/compat.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc/api.mjs +1 -0
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/derivations.mjs +27 -0
- package/_mjs/collection/immutable/Conc/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/Conc.mjs +2 -1
- package/_mjs/collection/immutable/Conc.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +1 -0
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +6 -6
- package/_mjs/collection/immutable/ImmutableArray/constructors.mjs +2 -2
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs +7 -2
- package/_mjs/collection/immutable/ImmutableArray/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs +25 -0
- package/_mjs/collection/immutable/ImmutableArray/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableArray/instances.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray.mjs +1 -0
- package/_mjs/collection/immutable/ImmutableArray.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +2 -2
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs +39 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/derivations.mjs.map +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs +1 -0
- package/_mjs/collection/immutable/ImmutableNonEmptyArray.mjs.map +1 -1
- package/_mjs/collection/immutable/List/definition.mjs +2 -2
- package/_mjs/collection/immutable/SortedMap/api.mjs +1 -0
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/internal.mjs +1 -1
- package/_mjs/collection/immutable.mjs +2 -0
- package/_mjs/collection/immutable.mjs.map +1 -0
- package/_mjs/collection/mutable/HashMap.mjs +4 -0
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/collection/mutable.mjs +2 -0
- package/_mjs/collection/mutable.mjs.map +1 -0
- package/_mjs/collection/weak.mjs +2 -0
- package/_mjs/collection/weak.mjs.map +1 -0
- package/_mjs/collection.mjs +2 -0
- package/_mjs/collection.mjs.map +1 -0
- package/_mjs/control/Eval/definition.mjs +1 -1
- package/_mjs/control/Eval/definition.mjs.map +1 -1
- package/_mjs/control/Eval/run.mjs +1 -0
- package/_mjs/control/Eval/run.mjs.map +1 -1
- package/_mjs/control/Z/api.mjs +9 -9
- package/_mjs/control/Z/api.mjs.map +1 -1
- package/_mjs/control/Z/definition.mjs +0 -1
- package/_mjs/control/Z/definition.mjs.map +1 -1
- package/_mjs/control/Z/runtime.mjs +1 -0
- package/_mjs/control/Z/runtime.mjs.map +1 -1
- package/_mjs/control.mjs +2 -0
- package/_mjs/control.mjs.map +1 -0
- package/_mjs/data/Branded/derivations.mjs +1 -0
- package/_mjs/data/Branded/derivations.mjs.map +1 -1
- package/_mjs/data/Cause/api/isEmpty.mjs +1 -0
- package/_mjs/data/Cause/api/isEmpty.mjs.map +1 -1
- package/_mjs/data/Cause/api/linearize.mjs +1 -0
- package/_mjs/data/Cause/api/linearize.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +2 -1
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/Const/instances.mjs +1 -0
- package/_mjs/data/Const/instances.mjs.map +1 -1
- package/_mjs/data/Datum/api.mjs +1 -0
- package/_mjs/data/Datum/api.mjs.map +1 -1
- package/_mjs/data/DecodeError/definition.mjs +9 -0
- package/_mjs/data/DecodeError/definition.mjs.map +1 -1
- package/_mjs/data/DecodeError/instances.mjs +2 -0
- package/_mjs/data/DecodeError/instances.mjs.map +1 -0
- package/_mjs/data/DecodeError.mjs +1 -0
- package/_mjs/data/DecodeError.mjs.map +1 -1
- package/_mjs/data/Decoder/api.mjs +1 -0
- package/_mjs/data/Decoder/api.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +1 -0
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +1 -1
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +1 -1
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +1 -1
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/Intervals.mjs +2 -2
- package/_mjs/data/Intervals.mjs.map +1 -1
- package/_mjs/data/Patch/api.mjs +1 -0
- package/_mjs/data/Patch/api.mjs.map +1 -1
- package/_mjs/data/Struct/api.mjs +1 -0
- package/_mjs/data/Struct/api.mjs.map +1 -1
- package/_mjs/data/These/definition.mjs +1 -1
- package/_mjs/data/These/definition.mjs.map +1 -1
- package/_mjs/data/string/api.mjs +1 -1
- package/_mjs/data.mjs +2 -0
- package/_mjs/data.mjs.map +1 -0
- package/_mjs/global.mjs +2 -0
- package/_mjs/global.mjs.map +1 -0
- package/_mjs/index.mjs +2 -0
- package/_mjs/index.mjs.map +1 -0
- package/_mjs/json.mjs +2 -0
- package/_mjs/json.mjs.map +1 -0
- package/_mjs/optics/At/api.mjs +1 -0
- package/_mjs/optics/At/api.mjs.map +1 -1
- package/_mjs/optics/At/definition.mjs +1 -0
- package/_mjs/optics/At/definition.mjs.map +1 -1
- package/_mjs/optics/Index/api.mjs +1 -0
- package/_mjs/optics/Index/api.mjs.map +1 -1
- package/_mjs/optics/Iso/api.mjs +1 -0
- package/_mjs/optics/Iso/api.mjs.map +1 -1
- package/_mjs/optics/Iso/definition.mjs +2 -0
- package/_mjs/optics/Iso/definition.mjs.map +1 -1
- package/_mjs/optics/Lens/api.mjs +1 -0
- package/_mjs/optics/Lens/api.mjs.map +1 -1
- package/_mjs/optics/Lens/definition.mjs +2 -0
- package/_mjs/optics/Lens/definition.mjs.map +1 -1
- package/_mjs/optics/Optional/api/compose.mjs +1 -0
- package/_mjs/optics/Optional/api/compose.mjs.map +1 -1
- package/_mjs/optics/Optional/definition.mjs +1 -0
- package/_mjs/optics/Optional/definition.mjs.map +1 -1
- package/_mjs/optics/Prism/api/compose.mjs +1 -0
- package/_mjs/optics/Prism/api/compose.mjs.map +1 -1
- package/_mjs/optics/Prism/api/fromNullable.mjs +1 -0
- package/_mjs/optics/Prism/api/fromNullable.mjs.map +1 -1
- package/_mjs/optics/Prism/api/just.mjs +1 -0
- package/_mjs/optics/Prism/api/just.mjs.map +1 -1
- package/_mjs/optics/Prism/definition.mjs +1 -0
- package/_mjs/optics/Prism/definition.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/compose.mjs +1 -0
- package/_mjs/optics/Traversal/api/compose.mjs.map +1 -1
- package/_mjs/optics/Traversal/api/fromTraversable.mjs +1 -0
- package/_mjs/optics/Traversal/api/fromTraversable.mjs.map +1 -1
- package/_mjs/optics/Traversal/definition.mjs +2 -0
- package/_mjs/optics/Traversal/definition.mjs.map +1 -1
- package/_mjs/optics.mjs +2 -0
- package/_mjs/optics.mjs.map +1 -0
- package/_mjs/typeclass/Eq/derivations.mjs +1 -0
- package/_mjs/typeclass/Eq/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Guard/api.mjs +1 -0
- package/_mjs/typeclass/Guard/api.mjs.map +1 -1
- package/_mjs/typeclass/HashEq.mjs +1 -0
- package/_mjs/typeclass/HashEq.mjs.map +1 -1
- package/_mjs/typeclass/Monoid.mjs +1 -0
- package/_mjs/typeclass/Monoid.mjs.map +1 -1
- package/_mjs/typeclass/Ord/definition.mjs +1 -0
- package/_mjs/typeclass/Ord/definition.mjs.map +1 -1
- package/_mjs/typeclass/Ord/instances.mjs +3 -0
- package/_mjs/typeclass/Ord/instances.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/api.mjs +1 -0
- package/_mjs/typeclass/Semigroup/api.mjs.map +1 -1
- package/_mjs/typeclass/Semigroup/derivations.mjs +1 -0
- package/_mjs/typeclass/Semigroup/derivations.mjs.map +1 -1
- package/_mjs/typeclass/Showable/show.mjs.map +1 -1
- package/_mjs/util.mjs +2 -0
- package/_mjs/util.mjs.map +1 -0
- package/_src/collection/compat/Array/api.ts +10 -10
- package/_src/collection/compat/Array/definition.ts +3 -3
- package/_src/collection/compat/Array/derivations.ts +85 -0
- package/_src/collection/compat/Array.ts +1 -0
- package/_src/collection/compat/Record/instances.ts +0 -1
- package/_src/collection/compat.ts +4 -0
- package/_src/collection/immutable/Conc/definition.ts +11 -10
- package/_src/collection/immutable/Conc/derivations.ts +28 -0
- package/_src/collection/immutable/Conc.ts +1 -0
- package/_src/collection/immutable/ImmutableArray/api.ts +6 -6
- package/_src/collection/immutable/ImmutableArray/constructors.ts +2 -2
- package/_src/collection/immutable/ImmutableArray/definition.ts +3 -0
- package/_src/collection/immutable/ImmutableArray/derivations.ts +28 -0
- package/_src/collection/immutable/ImmutableArray/instances.ts +5 -0
- package/_src/collection/immutable/ImmutableArray.ts +1 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray/constructors.ts +2 -2
- package/_src/collection/immutable/ImmutableNonEmptyArray/definition.ts +2 -2
- package/_src/collection/immutable/ImmutableNonEmptyArray/derivations.ts +44 -0
- package/_src/collection/immutable/ImmutableNonEmptyArray.ts +1 -0
- package/_src/collection/immutable/List/definition.ts +2 -2
- package/_src/collection/immutable/Vector/definition.ts +1 -1
- package/_src/collection/immutable/Vector/internal.ts +1 -1
- package/_src/collection/immutable.ts +12 -0
- package/_src/collection/mutable/HashMap.ts +4 -0
- package/_src/collection/mutable.ts +6 -0
- package/_src/collection/weak.ts +4 -0
- package/_src/collection.ts +7 -0
- package/_src/control/Eval/definition.ts +1 -1
- package/_src/control/Z/api.ts +24 -27
- package/_src/control/Z/definition.ts +6 -7
- package/_src/control/Z/runtime.ts +4 -4
- package/_src/control.ts +5 -0
- package/_src/data/DecodeError/definition.ts +8 -0
- package/_src/data/DecodeError/instances.ts +0 -0
- package/_src/data/DecodeError.ts +1 -0
- package/_src/data/Either/definition.ts +1 -1
- package/_src/data/Maybe/definition.ts +2 -2
- package/_src/data/These/definition.ts +1 -1
- package/_src/data/string/api.ts +1 -1
- package/_src/data.ts +35 -0
- package/_src/global.ts +252 -0
- package/_src/index.ts +8 -0
- package/_src/json.ts +5 -0
- package/_src/optics.ts +12 -0
- package/_src/typeclass/Showable/show.ts +2 -2
- package/_src/util.ts +8 -0
- package/collection/compat/Array/api.d.ts +10 -10
- package/collection/compat/Array/definition.d.ts +3 -3
- package/collection/compat/Array/derivations.d.ts +24 -0
- package/collection/compat/Array.d.ts +1 -0
- package/collection/compat.d.ts +2 -0
- package/collection/immutable/Conc/definition.d.ts +17 -16
- package/collection/immutable/Conc/derivations.d.ts +14 -0
- package/collection/immutable/Conc.d.ts +1 -0
- package/collection/immutable/ImmutableArray/api.d.ts +6 -6
- package/collection/immutable/ImmutableArray/constructors.d.ts +2 -2
- package/collection/immutable/ImmutableArray/definition.d.ts +4 -0
- package/collection/immutable/ImmutableArray/derivations.d.ts +14 -0
- package/collection/immutable/ImmutableArray.d.ts +1 -0
- package/collection/immutable/ImmutableNonEmptyArray/constructors.d.ts +2 -2
- package/collection/immutable/ImmutableNonEmptyArray/definition.d.ts +2 -2
- package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +14 -0
- package/collection/immutable/ImmutableNonEmptyArray.d.ts +1 -0
- package/collection/immutable/List/definition.d.ts +2 -2
- package/collection/immutable/Vector/definition.d.ts +1 -1
- package/collection/immutable/Vector/internal.d.ts +1 -1
- package/collection/immutable.d.ts +10 -0
- package/collection/mutable/HashMap.d.ts +1 -0
- package/collection/mutable.d.ts +4 -0
- package/collection/weak.d.ts +2 -0
- package/collection.d.ts +5 -0
- package/control/Z/api.d.ts +24 -24
- package/control/Z/definition.d.ts +6 -6
- package/control/Z/runtime.d.ts +4 -4
- package/control.d.ts +3 -0
- package/data/DecodeError/definition.d.ts +6 -0
- package/data/DecodeError/instances.d.ts +1 -0
- package/data/DecodeError.d.ts +1 -0
- package/data/Maybe/definition.d.ts +4 -2
- package/data/string/api.d.ts +1 -1
- package/data.d.ts +33 -0
- package/global.d.ts +237 -0
- package/index.d.ts +8 -0
- package/json.d.ts +3 -0
- package/optics.d.ts +10 -0
- package/package.json +1 -1
- package/typeclass/Showable/show.d.ts +1 -1
- package/util.d.ts +6 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.mjs","mappings":"","names":[],"sourceRoot":"","sources":[],"sourcesContent":[]}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { Eq } from "@fncts/base/typeclass";
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @tsplus getter fncts.
|
5
|
-
* @tsplus getter fncts.
|
4
|
+
* @tsplus getter fncts.Array elem
|
5
|
+
* @tsplus getter fncts.ReadonlyArray elem
|
6
6
|
*/
|
7
7
|
export function elem<A>(self: ReadonlyArray<A>) {
|
8
8
|
return (eq: Eq<A>) =>
|
@@ -17,32 +17,32 @@ export function elem<A>(self: ReadonlyArray<A>) {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
/**
|
20
|
-
* @tsplus fluent fncts.
|
21
|
-
* @tsplus fluent fncts.
|
20
|
+
* @tsplus fluent fncts.Array isEmpty
|
21
|
+
* @tsplus fluent fncts.ReadonlyArray isEmpty
|
22
22
|
*/
|
23
23
|
export function isEmpty<A>(self: ReadonlyArray<A>): boolean {
|
24
24
|
return self.length === 0;
|
25
25
|
}
|
26
26
|
|
27
27
|
/**
|
28
|
-
* @tsplus fluent fncts.
|
29
|
-
* @tsplus fluent fncts.
|
28
|
+
* @tsplus fluent fncts.Array isNonEmpty
|
29
|
+
* @tsplus fluent fncts.ReadonlyArray isNonEmpty
|
30
30
|
*/
|
31
31
|
export function isNonEmpty<A>(self: ReadonlyArray<A>): self is ReadonlyNonEmptyArray<A> {
|
32
32
|
return self.length > 0;
|
33
33
|
}
|
34
34
|
|
35
35
|
/**
|
36
|
-
* @tsplus fluent fncts.
|
37
|
-
* @tsplus fluent fncts.
|
36
|
+
* @tsplus fluent fncts.Array foldLeft
|
37
|
+
* @tsplus fluent fncts.ReadonlyArray foldLeft
|
38
38
|
*/
|
39
39
|
export function foldLeft<A, B>(self: ReadonlyArray<A>, b: B, f: (b: B, a: A) => B): B {
|
40
40
|
return self.foldLeftWithIndex(b, (_, b, a) => f(b, a));
|
41
41
|
}
|
42
42
|
|
43
43
|
/**
|
44
|
-
* @tsplus fluent fncts.
|
45
|
-
* @tsplus fluent fncts.
|
44
|
+
* @tsplus fluent fncts.Array foldLeftWithIndex
|
45
|
+
* @tsplus fluent fncts.ReadonlyArray foldLeftWithIndex
|
46
46
|
*/
|
47
47
|
export function foldLeftWithIndex<A, B>(self: ReadonlyArray<A>, b: B, f: (i: number, b: B, a: A) => B): B {
|
48
48
|
let out = b;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
declare global {
|
2
2
|
/**
|
3
|
-
* @tsplus type fncts.
|
3
|
+
* @tsplus type fncts.ReadonlyArray
|
4
4
|
*/
|
5
5
|
export interface ReadonlyArray<T> {}
|
6
6
|
|
7
7
|
/**
|
8
|
-
* @tsplus type fncts.
|
8
|
+
* @tsplus type fncts.Array
|
9
9
|
*/
|
10
10
|
export interface Array<T> {}
|
11
11
|
|
12
12
|
/**
|
13
|
-
* @tsplus type fncts.
|
13
|
+
* @tsplus type fncts.ArrayOps
|
14
14
|
*/
|
15
15
|
export interface ArrayConstructor {}
|
16
16
|
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import type { DecodeError } from "@fncts/base/data/DecodeError";
|
2
|
+
import type { Check } from "@fncts/typelevel/Check";
|
3
|
+
|
4
|
+
import { CompoundError, OptionalIndexError, PrimitiveError } from "@fncts/base/data/DecodeError";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @tsplus derive fncts.Guard[fncts.Array]<_> 10
|
8
|
+
*/
|
9
|
+
export function deriveGuard<A extends Array<any>>(
|
10
|
+
...[element]: [A] extends [Array<infer _A>]
|
11
|
+
? Check<Check.IsEqual<A, Array<_A>>> extends Check.True
|
12
|
+
? [element: Guard<_A>]
|
13
|
+
: never
|
14
|
+
: never
|
15
|
+
): Guard<A> {
|
16
|
+
return Guard((u): u is A => {
|
17
|
+
if (Array.isArray(u)) {
|
18
|
+
return u.every(element.is);
|
19
|
+
}
|
20
|
+
return false;
|
21
|
+
});
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @tsplus derive fncts.Guard[fncts.ReadonlyArray]<_> 10
|
26
|
+
*/
|
27
|
+
export const deriveReadonlyArrayGuard: <A extends ReadonlyArray<any>>(
|
28
|
+
...[element]: [A] extends [ReadonlyArray<infer _A>]
|
29
|
+
? Check<Check.IsEqual<A, ReadonlyArray<_A>>> extends Check.True
|
30
|
+
? [element: Guard<_A>]
|
31
|
+
: never
|
32
|
+
: never
|
33
|
+
) => Guard<A> = deriveGuard.unsafeCoerce();
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @tsplus derive fncts.Decoder[fncts.Array]<_> 10
|
37
|
+
*/
|
38
|
+
export function deriveDecoder<A extends Array<any>>(
|
39
|
+
...[element]: [A] extends [Array<infer _A>]
|
40
|
+
? Check<Check.IsEqual<A, Array<_A>>> extends Check.True
|
41
|
+
? [element: Decoder<_A>]
|
42
|
+
: never
|
43
|
+
: never
|
44
|
+
): Decoder<A> {
|
45
|
+
return Decoder((u) => {
|
46
|
+
if (Array.isArray(u)) {
|
47
|
+
const errors = Vector.emptyPushable<DecodeError>();
|
48
|
+
let failed = false;
|
49
|
+
const out = Array(u.length);
|
50
|
+
for (let i = 0; i < u.length; i++) {
|
51
|
+
const decoded = element.decode(u[i]!);
|
52
|
+
decoded.match2(
|
53
|
+
(err) => {
|
54
|
+
failed = true;
|
55
|
+
errors.push(new OptionalIndexError(i, err));
|
56
|
+
},
|
57
|
+
(warning, value) => {
|
58
|
+
out[i] = value;
|
59
|
+
if (warning.isJust()) {
|
60
|
+
errors.push(warning.value);
|
61
|
+
}
|
62
|
+
},
|
63
|
+
);
|
64
|
+
}
|
65
|
+
if (failed) {
|
66
|
+
return These.left(new CompoundError("Array", errors));
|
67
|
+
}
|
68
|
+
return These.rightOrBoth(errors.length > 0 ? Just(new CompoundError("Array", errors)) : Nothing(), out as A);
|
69
|
+
}
|
70
|
+
return These.left(new PrimitiveError(u, "Array"));
|
71
|
+
}, `Array<${element.label}>`);
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* @tsplus derive fncts.Decoder[fncts.ReadonlyArray]<_> 10
|
76
|
+
*/
|
77
|
+
export function deriveReadonlyArrayDecoder<A extends ReadonlyArray<any>>(
|
78
|
+
...[element]: [A] extends [ReadonlyArray<infer _A>]
|
79
|
+
? Check<Check.IsEqual<A, ReadonlyArray<_A>>> extends Check.True
|
80
|
+
? [element: Decoder<_A>]
|
81
|
+
: never
|
82
|
+
: never
|
83
|
+
): Decoder<A> {
|
84
|
+
return Decoder((u) => deriveDecoder(element).decode(u) as These<DecodeError, A>, `ReadonlyArray<${element.label}>`);
|
85
|
+
}
|
@@ -32,7 +32,7 @@ export interface ConcF extends HKT {
|
|
32
32
|
* @tsplus companion fncts.ConcOps
|
33
33
|
*/
|
34
34
|
export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
35
|
-
|
35
|
+
declare _A: () => A;
|
36
36
|
|
37
37
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
38
38
|
abstract readonly length: number;
|
@@ -43,19 +43,19 @@ export abstract class Conc<A> implements Iterable<A>, Hashable, Equatable {
|
|
43
43
|
}
|
44
44
|
|
45
45
|
[Symbol.equals](that: unknown): boolean {
|
46
|
-
return Conc.
|
46
|
+
return Conc.is(that) && (this as Conc<A>).corresponds(that, Equatable.strictEquals);
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
50
50
|
abstract class ConcImplementation<A> implements Iterable<A> {
|
51
51
|
readonly _typeId: ConcTypeId = ConcTypeId;
|
52
|
-
|
52
|
+
declare _A: () => A;
|
53
53
|
get [Symbol.hash](): number {
|
54
54
|
return Hashable.iterator(this[Symbol.iterator]());
|
55
55
|
}
|
56
56
|
|
57
57
|
[Symbol.equals](that: unknown): boolean {
|
58
|
-
return Conc.
|
58
|
+
return Conc.is(that) && (this as Conc<A>).corresponds(that, Equatable.strictEquals);
|
59
59
|
}
|
60
60
|
|
61
61
|
abstract readonly length: number;
|
@@ -108,8 +108,8 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
concat<B>(that: ConcImplementation<B>): ConcImplementation<A | B> {
|
111
|
-
concrete
|
112
|
-
concrete
|
111
|
+
concrete(this);
|
112
|
+
concrete(that);
|
113
113
|
if (this._tag === ConcTag.Empty) {
|
114
114
|
return that;
|
115
115
|
}
|
@@ -126,7 +126,7 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
126
126
|
}
|
127
127
|
const diff = that.depth - this.depth;
|
128
128
|
if (Math.abs(diff) <= 1) {
|
129
|
-
return new Concat(this, that);
|
129
|
+
return new Concat<A | B>(this, that);
|
130
130
|
} else if (diff < -1) {
|
131
131
|
if (this.left.depth >= this.right.depth) {
|
132
132
|
const nr = this.right.concat(that);
|
@@ -165,7 +165,7 @@ abstract class ConcImplementation<A> implements Iterable<A> {
|
|
165
165
|
} else if (n >= this.length) {
|
166
166
|
return this;
|
167
167
|
} else {
|
168
|
-
concrete
|
168
|
+
concrete(this);
|
169
169
|
switch (this._tag) {
|
170
170
|
case ConcTag.Empty:
|
171
171
|
return _Empty;
|
@@ -267,9 +267,10 @@ export class Empty<A> extends ConcImplementation<A> {
|
|
267
267
|
}
|
268
268
|
}
|
269
269
|
|
270
|
-
export const _Empty = new Empty<
|
270
|
+
export const _Empty = new Empty<never>();
|
271
271
|
|
272
272
|
export class Concat<A> extends ConcImplementation<A> {
|
273
|
+
declare _A: () => A;
|
273
274
|
readonly _tag = ConcTag.Concat;
|
274
275
|
|
275
276
|
length = this.left.length + this.right.length;
|
@@ -729,7 +730,7 @@ export function fromArray<A>(array: ArrayLike<A>): ConcImplementation<A> {
|
|
729
730
|
}
|
730
731
|
|
731
732
|
/**
|
732
|
-
* @tsplus static fncts.ConcOps
|
733
|
+
* @tsplus static fncts.ConcOps is
|
733
734
|
*/
|
734
735
|
export function isConc<A>(u: Iterable<A>): u is Conc<A>;
|
735
736
|
export function isConc(u: unknown): u is Conc<unknown>;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Check } from "@fncts/typelevel/Check";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @tsplus derive fncts.Guard[fncts.Conc]<_> 10
|
5
|
+
*/
|
6
|
+
export function deriveGuard<A extends Conc<any>>(
|
7
|
+
...[elem]: [A] extends [Conc<infer _A>] ? [elem: Guard<_A>] : never
|
8
|
+
): Guard<A> {
|
9
|
+
return Guard((u): u is A => {
|
10
|
+
if (Conc.is(u)) {
|
11
|
+
return u.every(elem.is);
|
12
|
+
}
|
13
|
+
return false;
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @tsplus derive fncts.Decoder[fncts.Conc]<_> 10
|
19
|
+
*/
|
20
|
+
export function deriveDecoder<A extends Conc<any>>(
|
21
|
+
...[array, elem]: [A] extends [Conc<infer _A>]
|
22
|
+
? Check<Check.IsEqual<A, Conc<_A>>> extends Check.True
|
23
|
+
? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
|
24
|
+
: never
|
25
|
+
: never
|
26
|
+
): Decoder<A> {
|
27
|
+
return Decoder((u) => array.decode(u).map((a) => Conc.from(a) as A), `Conc<${elem.label}>`);
|
28
|
+
}
|
@@ -538,7 +538,7 @@ export function findLastMapWithIndex_<A, B>(as: ImmutableArray<A>, f: (i: number
|
|
538
538
|
|
539
539
|
/**
|
540
540
|
* @tsplus fluent fncts.ImmutableArray foldLeftWithIndex
|
541
|
-
* @tsplus fluent fncts.
|
541
|
+
* @tsplus fluent fncts.MutableArray foldLeftWithIndex
|
542
542
|
*/
|
543
543
|
export function foldLeftWithIndex_<A, B>(self: ImmutableArray<A>, b: B, f: (i: number, b: B, a: A) => B): B {
|
544
544
|
const len = self.length;
|
@@ -551,7 +551,7 @@ export function foldLeftWithIndex_<A, B>(self: ImmutableArray<A>, b: B, f: (i: n
|
|
551
551
|
|
552
552
|
/**
|
553
553
|
* @tsplus fluent fncts.ImmutableArray foldLeft
|
554
|
-
* @tsplus fluent fncts.
|
554
|
+
* @tsplus fluent fncts.MutableArray foldLeft
|
555
555
|
*/
|
556
556
|
export function foldLeft_<A, B>(self: ImmutableArray<A>, b: B, f: (b: B, a: A) => B): B {
|
557
557
|
return self.foldLeftWithIndex(b, (_, b, a) => f(b, a));
|
@@ -559,7 +559,7 @@ export function foldLeft_<A, B>(self: ImmutableArray<A>, b: B, f: (b: B, a: A) =
|
|
559
559
|
|
560
560
|
/**
|
561
561
|
* @tsplus fluent fncts.ImmutableArray foldLeftWhile
|
562
|
-
* @tsplus fluent fncts.
|
562
|
+
* @tsplus fluent fncts.MutableArray foldLeftWhile
|
563
563
|
*/
|
564
564
|
export function foldLeftWhile_<A, B>(self: ImmutableArray<A>, b: B, p: Predicate<B>, f: (b: B, a: A) => B): B {
|
565
565
|
return self.foldLeftWithIndexWhile(b, p, (_, b, a) => f(b, a));
|
@@ -567,7 +567,7 @@ export function foldLeftWhile_<A, B>(self: ImmutableArray<A>, b: B, p: Predicate
|
|
567
567
|
|
568
568
|
/**
|
569
569
|
* @tsplus fluent fncts.ImmutableArray foldLeftWithIndexWhile
|
570
|
-
* @tsplus fluent fncts.
|
570
|
+
* @tsplus fluent fncts.MutableArray foldLeftWithIndexWhile
|
571
571
|
*/
|
572
572
|
export function foldLeftWithIndexWhile_<A, B>(
|
573
573
|
self: ImmutableArray<A>,
|
@@ -661,7 +661,7 @@ export function forEach_<A, B>(self: ImmutableArray<A>, f: (a: A) => B): void {
|
|
661
661
|
|
662
662
|
/**
|
663
663
|
* @tsplus fluent fncts.ImmutableArray get
|
664
|
-
* @tsplus fluent fncts.
|
664
|
+
* @tsplus fluent fncts.MutableArray get
|
665
665
|
*/
|
666
666
|
export function get_<A>(self: ImmutableArray<A>, i: number): Maybe<A> {
|
667
667
|
return self.isOutOfBound(i) ? Nothing() : Just(self._array[i]!);
|
@@ -954,7 +954,7 @@ export function prepend_<A, B>(self: ImmutableArray<A>, head: B): ImmutableArray
|
|
954
954
|
|
955
955
|
/**
|
956
956
|
* @tsplus fluent fncts.ImmutableArray prependAll
|
957
|
-
* @tsplus fluent fncts.
|
957
|
+
* @tsplus fluent fncts.MutableArray prependAll
|
958
958
|
*/
|
959
959
|
export function prependAll_<A>(self: ImmutableArray<A>, a: A): ImmutableArray<A> {
|
960
960
|
const out: Array<A> = [];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
* @tsplus getter fncts.
|
3
|
-
* @tsplus getter fncts.
|
2
|
+
* @tsplus getter fncts.ReadonlyArray asImmutableArray
|
3
|
+
* @tsplus getter fncts.Array asImmutableArray
|
4
4
|
*/
|
5
5
|
export function asImmutableArray<A>(self: ReadonlyArray<A>): ImmutableArray<A> {
|
6
6
|
return new ImmutableArray(self);
|
@@ -35,6 +35,9 @@ export class ImmutableArray<A> implements Equatable, Hashable, Iterable<A> {
|
|
35
35
|
}
|
36
36
|
}
|
37
37
|
|
38
|
+
/**
|
39
|
+
* @tsplus static fncts.ImmutableArrayOps is
|
40
|
+
*/
|
38
41
|
export function isImmutableArray(u: unknown): u is ImmutableArray<unknown> {
|
39
42
|
return hasTypeId(u, ImmutableArrayTypeId);
|
40
43
|
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Check } from "@fncts/typelevel/Check";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @tsplus derive fncts.Guard[fncts.ImmutableArray]<_> 10
|
5
|
+
*/
|
6
|
+
export function deriveGuard<A extends ImmutableArray<any>>(
|
7
|
+
...[element]: [A] extends [ImmutableArray<infer A>] ? [element: Guard<A>] : never
|
8
|
+
): Guard<A> {
|
9
|
+
return Guard((u): u is A => {
|
10
|
+
if (ImmutableArray.is(u)) {
|
11
|
+
return u._array.every(element.is);
|
12
|
+
}
|
13
|
+
return false;
|
14
|
+
});
|
15
|
+
}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @tsplus derive fncts.Decoder[fncts.ImmutableArray]<_> 10
|
19
|
+
*/
|
20
|
+
export function deriveDecoder<A extends ImmutableArray<any>>(
|
21
|
+
...[array, elem]: [A] extends [ImmutableArray<infer _A>]
|
22
|
+
? Check<Check.IsEqual<A, ImmutableArray<_A>>> extends Check.True
|
23
|
+
? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
|
24
|
+
: never
|
25
|
+
: never
|
26
|
+
): Decoder<A> {
|
27
|
+
return Decoder((u) => array.decode(u).map((as) => new ImmutableArray(as) as A), `ImmutableArray<${elem.label}>`);
|
28
|
+
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import type { ImmutableArrayF } from "@fncts/base/collection/immutable/ImmutableArray/definition";
|
2
|
+
import type { DecodeError } from "@fncts/base/data/DecodeError";
|
2
3
|
import type * as P from "@fncts/base/typeclass";
|
4
|
+
import type { Check } from "@fncts/typelevel/Check";
|
3
5
|
|
4
6
|
import {
|
5
7
|
alignWith_,
|
@@ -29,6 +31,9 @@ import {
|
|
29
31
|
witherWithIndex,
|
30
32
|
} from "@fncts/base/collection/immutable/ImmutableArray/api";
|
31
33
|
import { empty } from "@fncts/base/collection/immutable/ImmutableArray/constructors";
|
34
|
+
import { isImmutableArray } from "@fncts/base/collection/immutable/ImmutableArray/definition";
|
35
|
+
import { CompoundError, OptionalIndexError, PrimitiveError } from "@fncts/base/data/DecodeError";
|
36
|
+
import { Decoder } from "@fncts/base/data/Decoder";
|
32
37
|
|
33
38
|
/**
|
34
39
|
* @tsplus implicit
|
@@ -7,8 +7,8 @@ export function allocWithHead<A>(head: A, length: number): Array<A> & { 0: A } {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
/**
|
10
|
-
* @tsplus getter fncts.
|
11
|
-
* @tsplus getter fncts.
|
10
|
+
* @tsplus getter fncts.ReadonlyArray unsafeAsNonEmptyArray
|
11
|
+
* @tsplus getter fncts.Array unsafeAsNonEmptyArray
|
12
12
|
*/
|
13
13
|
export function unsafeAsNonEmptyArray<A>(self: ReadonlyArray<A>): ImmutableNonEmptyArray<A> {
|
14
14
|
if (self.length === 0) {
|
@@ -20,14 +20,14 @@ export class ImmutableNonEmptyArray<A> extends ImmutableArray<A> {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
/**
|
23
|
-
* @tsplus type fncts.
|
23
|
+
* @tsplus type fncts.NonEmptyArray
|
24
24
|
*/
|
25
25
|
export interface NonEmptyArray<T> extends Array<T> {
|
26
26
|
0: T;
|
27
27
|
}
|
28
28
|
|
29
29
|
/**
|
30
|
-
* @tsplus type fncts.
|
30
|
+
* @tsplus type fncts.ReadonlyNonEmptyArray
|
31
31
|
*/
|
32
32
|
export interface ReadonlyNonEmptyArray<T> extends ReadonlyArray<T> {
|
33
33
|
readonly 0: T;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { Check } from "@fncts/typelevel/Check";
|
2
|
+
|
3
|
+
import { CompoundError, EmptyError } from "@fncts/base/data/DecodeError";
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @tsplus derive fncts.Guard[fncts.ImmutableNonEmptyArray]<_> 10
|
7
|
+
*/
|
8
|
+
export function deriveGuard<A extends ImmutableNonEmptyArray<any>>(
|
9
|
+
...[elem]: [A] extends [ImmutableNonEmptyArray<infer _A>] ? [elem: Guard<_A>] : never
|
10
|
+
): Guard<A> {
|
11
|
+
return Guard((u): u is A => {
|
12
|
+
if (ImmutableNonEmptyArray.is(u)) {
|
13
|
+
return u.every(elem.is);
|
14
|
+
}
|
15
|
+
return false;
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @tsplus derive fncts.Decoder[fncts.ImmutableNonEmptyArray]<_> 10
|
21
|
+
*/
|
22
|
+
export function deriveDecoder<A extends ImmutableNonEmptyArray<any>>(
|
23
|
+
...[array, elem]: [A] extends [ImmutableNonEmptyArray<infer _A>]
|
24
|
+
? Check<Check.IsEqual<A, ImmutableNonEmptyArray<_A>>> extends Check.True
|
25
|
+
? [array: Decoder<Array<_A>>, elem: Decoder<_A>]
|
26
|
+
: never
|
27
|
+
: never
|
28
|
+
): Decoder<A> {
|
29
|
+
return Decoder(
|
30
|
+
(u) =>
|
31
|
+
array.decode(u).match2(These.left, (warn, as) => {
|
32
|
+
if (as.isNonEmpty()) {
|
33
|
+
return These.right(new ImmutableNonEmptyArray(as) as A);
|
34
|
+
} else {
|
35
|
+
const err = new EmptyError(as);
|
36
|
+
return warn.match(
|
37
|
+
() => These.left(err),
|
38
|
+
(err0) => These.left(new CompoundError(`ImmutableNonEmptyArray<${elem.label}>`, Vector(err0, err))),
|
39
|
+
);
|
40
|
+
}
|
41
|
+
}),
|
42
|
+
`ImmutableNonEmptyArray<${elem.label}>`,
|
43
|
+
);
|
44
|
+
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
export * from "./ImmutableNonEmptyArray/api.js";
|
3
3
|
export * from "./ImmutableNonEmptyArray/constructors.js";
|
4
4
|
export * from "./ImmutableNonEmptyArray/definition.js";
|
5
|
+
export * from "./ImmutableNonEmptyArray/derivations.js";
|
5
6
|
export * from "./ImmutableNonEmptyArray/destructors.js";
|
6
7
|
export * from "./ImmutableNonEmptyArray/instances.js";
|
7
8
|
// codegen:end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
/**
|
16
|
-
* @tsplus type fncts.
|
16
|
+
* @tsplus type fncts.List.Cons
|
17
17
|
* @tsplus companion fncts.ConsOps
|
18
18
|
*/
|
19
19
|
export class Cons<A> implements Iterable<A> {
|
@@ -48,7 +48,7 @@ export class Cons<A> implements Iterable<A> {
|
|
48
48
|
}
|
49
49
|
|
50
50
|
/**
|
51
|
-
* @tsplus type fncts.
|
51
|
+
* @tsplus type fncts.List.Nil
|
52
52
|
* @tsplus companion fncts.NilOps
|
53
53
|
*/
|
54
54
|
export class Nil<A> implements Iterable<A> {
|
@@ -357,7 +357,7 @@ export function decrementDepth(bits: number): number {
|
|
357
357
|
/**
|
358
358
|
* Appends the value to the Vector by _mutating_ the Vector and its content.
|
359
359
|
*
|
360
|
-
* @tsplus fluent fncts.
|
360
|
+
* @tsplus fluent fncts.MutableVector push
|
361
361
|
*/
|
362
362
|
export function push<A>(l: MutableVector<A>, value: A): MutableVector<A> {
|
363
363
|
const suffixSize = getSuffixSize(l);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./immutable/*.ts }
|
2
|
+
export type {} from "./immutable/Conc.js";
|
3
|
+
export type {} from "./immutable/HashMap.js";
|
4
|
+
export type {} from "./immutable/HashSet.js";
|
5
|
+
export type {} from "./immutable/ImmutableArray.js";
|
6
|
+
export type {} from "./immutable/ImmutableNonEmptyArray.js";
|
7
|
+
export type {} from "./immutable/List.js";
|
8
|
+
export type {} from "./immutable/Queue.js";
|
9
|
+
export type {} from "./immutable/RoseTree.js";
|
10
|
+
export type {} from "./immutable/SortedMap.js";
|
11
|
+
export type {} from "./immutable/Vector.js";
|
12
|
+
// codegen:end
|
@@ -56,6 +56,10 @@ export class HashMap<K, V> implements Iterable<readonly [K, V]> {
|
|
56
56
|
return this.findNode(key) !== undefined;
|
57
57
|
}
|
58
58
|
|
59
|
+
unsafeGet(key: K): V | undefined {
|
60
|
+
return this.findNode(key)?.value;
|
61
|
+
}
|
62
|
+
|
59
63
|
get(key: K): Maybe<V> {
|
60
64
|
const n = this.findNode(key);
|
61
65
|
return n ? Just(n.value) : Nothing();
|
@@ -0,0 +1,6 @@
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./mutable/*.ts }
|
2
|
+
export type {} from "./mutable/HashMap.js";
|
3
|
+
export type {} from "./mutable/HashSet.js";
|
4
|
+
export type {} from "./mutable/internal.js";
|
5
|
+
export type {} from "./mutable/ListBuffer.js";
|
6
|
+
// codegen:end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
// codegen:start { preset: type-barrel, include: ./collection/*.ts }
|
2
|
+
export type {} from "./collection/compat.js";
|
3
|
+
export type {} from "./collection/immutable.js";
|
4
|
+
export type {} from "./collection/Iterable.js";
|
5
|
+
export type {} from "./collection/mutable.js";
|
6
|
+
export type {} from "./collection/weak.js";
|
7
|
+
// codegen:end
|