@fncts/base 0.0.26 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/_cjs/collection/Iterable/api.cjs +3 -2
- package/_cjs/collection/Iterable/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Conc/api.cjs +25 -12
- package/_cjs/collection/immutable/Conc/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/api.cjs +20 -8
- package/_cjs/collection/immutable/HashMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/definition.cjs +3 -2
- package/_cjs/collection/immutable/HashMap/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/HashMap/internal.cjs +9 -7
- package/_cjs/collection/immutable/HashMap/internal.cjs.map +1 -1
- package/_cjs/collection/immutable/HashSet/api.cjs +7 -6
- package/_cjs/collection/immutable/HashSet/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableArray/api.cjs +18 -17
- package/_cjs/collection/immutable/ImmutableArray/api.cjs.map +1 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs +2 -1
- package/_cjs/collection/immutable/ImmutableNonEmptyArray/constructors.cjs.map +1 -1
- package/_cjs/collection/immutable/List/api.cjs +3 -2
- package/_cjs/collection/immutable/List/api.cjs.map +1 -1
- package/_cjs/collection/immutable/List/definition.cjs +19 -4
- package/_cjs/collection/immutable/List/definition.cjs.map +1 -1
- package/_cjs/collection/immutable/Queue/api.cjs +7 -6
- package/_cjs/collection/immutable/Queue/api.cjs.map +1 -1
- package/_cjs/collection/immutable/RoseTree/api.cjs +1 -1
- package/_cjs/collection/immutable/RoseTree/api.cjs.map +1 -1
- package/_cjs/collection/immutable/SortedMap/api.cjs +23 -22
- package/_cjs/collection/immutable/SortedMap/api.cjs.map +1 -1
- package/_cjs/collection/immutable/SortedMap/iterator.cjs +7 -6
- package/_cjs/collection/immutable/SortedMap/iterator.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/api.cjs +62 -19
- package/_cjs/collection/immutable/Vector/api.cjs.map +1 -1
- package/_cjs/collection/immutable/Vector/definition.cjs.map +1 -1
- package/_cjs/collection/mutable/HashMap.cjs +6 -19
- package/_cjs/collection/mutable/HashMap.cjs.map +1 -1
- package/_cjs/control/CompletablePromise.cjs +21 -0
- package/_cjs/control/CompletablePromise.cjs.map +1 -0
- package/_cjs/control/Z/api.cjs +1 -1
- package/_cjs/control/Z/api.cjs.map +1 -1
- package/_cjs/control/Z/runtime.cjs +2 -2
- package/_cjs/control/Z/runtime.cjs.map +1 -1
- package/_cjs/data/Branded/definition.cjs +4 -3
- package/_cjs/data/Branded/definition.cjs.map +1 -1
- package/_cjs/data/Cause/api/fold.cjs +8 -7
- package/_cjs/data/Cause/api/fold.cjs.map +1 -1
- package/_cjs/data/Cause/api.cjs +124 -128
- package/_cjs/data/Cause/api.cjs.map +1 -1
- package/_cjs/data/DatumEither/api.cjs +5 -4
- package/_cjs/data/DatumEither/api.cjs.map +1 -1
- package/_cjs/data/Decoder/api.cjs +2 -1
- package/_cjs/data/Decoder/api.cjs.map +1 -1
- package/_cjs/data/Either/api/alignWith.cjs +2 -1
- package/_cjs/data/Either/api/alignWith.cjs.map +1 -1
- package/_cjs/data/Either/api.cjs +25 -16
- package/_cjs/data/Either/api.cjs.map +1 -1
- package/_cjs/data/Either/constructors.cjs +10 -9
- package/_cjs/data/Either/constructors.cjs.map +1 -1
- package/_cjs/data/Either/definition.cjs +34 -6
- package/_cjs/data/Either/definition.cjs.map +1 -1
- package/_cjs/data/Either/instances.cjs +7 -6
- package/_cjs/data/Either/instances.cjs.map +1 -1
- package/_cjs/data/EitherT/api.cjs +4 -3
- package/_cjs/data/EitherT/api.cjs.map +1 -1
- package/_cjs/data/Eq/api.cjs +20 -0
- package/_cjs/data/Eq/api.cjs.map +1 -0
- package/_cjs/data/Eq.cjs +11 -0
- package/_cjs/data/Eq.cjs.map +1 -1
- package/_cjs/data/Equatable/api.cjs +39 -11
- package/_cjs/data/Equatable/api.cjs.map +1 -1
- package/_cjs/data/Equatable/definition.cjs +1 -1
- package/_cjs/data/Equatable/definition.cjs.map +1 -1
- package/_cjs/data/Exit/api.cjs +32 -6
- package/_cjs/data/Exit/api.cjs.map +1 -1
- package/_cjs/data/Exit/constructors.cjs +13 -12
- package/_cjs/data/Exit/constructors.cjs.map +1 -1
- package/_cjs/data/Exit/definition.cjs +11 -6
- package/_cjs/data/Exit/definition.cjs.map +1 -1
- package/_cjs/data/FiberId/api.cjs +16 -15
- package/_cjs/data/FiberId/api.cjs.map +1 -1
- package/_cjs/data/Interval.cjs +2 -1
- package/_cjs/data/Interval.cjs.map +1 -1
- package/_cjs/data/Maybe/api.cjs +8 -7
- package/_cjs/data/Maybe/api.cjs.map +1 -1
- package/_cjs/data/Maybe/constructors.cjs +11 -11
- package/_cjs/data/Maybe/constructors.cjs.map +1 -1
- package/_cjs/data/Maybe/definition.cjs +10 -5
- package/_cjs/data/Maybe/definition.cjs.map +1 -1
- package/_cjs/data/Maybe/instances.cjs +30 -8
- package/_cjs/data/Maybe/instances.cjs.map +1 -1
- package/_cjs/data/Showable/show.cjs +2 -2
- package/_cjs/data/Showable/show.cjs.map +1 -1
- package/_cjs/data/These/destructors.cjs +3 -2
- package/_cjs/data/These/destructors.cjs.map +1 -1
- package/_cjs/data/exceptions/IOError.cjs +25 -0
- package/_cjs/data/exceptions/IOError.cjs.map +1 -0
- package/_cjs/data/exceptions/NoSuchElementError.cjs.map +1 -1
- package/_cjs/data/exceptions.cjs +11 -0
- package/_cjs/data/exceptions.cjs.map +1 -1
- package/_cjs/optics/Lens/definition.cjs +2 -1
- package/_cjs/optics/Lens/definition.cjs.map +1 -1
- package/_cjs/optics/Prism/api/just.cjs +2 -1
- package/_cjs/optics/Prism/api/just.cjs.map +1 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs +2 -1
- package/_cjs/typeclass/ApplicativeExcept.cjs.map +1 -1
- package/_cjs/typeclass/Semialign.cjs +2 -1
- package/_cjs/typeclass/Semialign.cjs.map +1 -1
- package/_cjs/typeclass/Witherable.cjs +2 -1
- package/_cjs/typeclass/Witherable.cjs.map +1 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs +2 -1
- package/_cjs/typeclass/WitherableWithIndex.cjs.map +1 -1
- package/_cjs/typeclass.cjs +2 -2
- package/_cjs/types.cjs +0 -11
- package/_cjs/types.cjs.map +1 -1
- package/_cjs/util/predicates.cjs +4 -0
- package/_cjs/util/predicates.cjs.map +1 -1
- package/_cjs/util/rand/Random.cjs.map +1 -1
- package/_mjs/collection/Iterable/api.mjs +3 -2
- package/_mjs/collection/Iterable/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Conc/api.mjs +24 -12
- package/_mjs/collection/immutable/Conc/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/api.mjs +19 -8
- package/_mjs/collection/immutable/HashMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/definition.mjs +3 -2
- package/_mjs/collection/immutable/HashMap/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/HashMap/internal.mjs +8 -7
- package/_mjs/collection/immutable/HashMap/internal.mjs.map +1 -1
- package/_mjs/collection/immutable/HashSet/api.mjs +7 -6
- package/_mjs/collection/immutable/HashSet/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableArray/api.mjs +18 -17
- package/_mjs/collection/immutable/ImmutableArray/api.mjs.map +1 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs +2 -1
- package/_mjs/collection/immutable/ImmutableNonEmptyArray/constructors.mjs.map +1 -1
- package/_mjs/collection/immutable/List/api.mjs +3 -2
- package/_mjs/collection/immutable/List/api.mjs.map +1 -1
- package/_mjs/collection/immutable/List/definition.mjs +13 -2
- package/_mjs/collection/immutable/List/definition.mjs.map +1 -1
- package/_mjs/collection/immutable/Queue/api.mjs +7 -6
- package/_mjs/collection/immutable/Queue/api.mjs.map +1 -1
- package/_mjs/collection/immutable/RoseTree/api.mjs +1 -1
- package/_mjs/collection/immutable/RoseTree/api.mjs.map +1 -1
- package/_mjs/collection/immutable/SortedMap/api.mjs +23 -22
- package/_mjs/collection/immutable/SortedMap/api.mjs.map +1 -1
- package/_mjs/collection/immutable/SortedMap/iterator.mjs +7 -6
- package/_mjs/collection/immutable/SortedMap/iterator.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/api.mjs +54 -16
- package/_mjs/collection/immutable/Vector/api.mjs.map +1 -1
- package/_mjs/collection/immutable/Vector/definition.mjs.map +1 -1
- package/_mjs/collection/mutable/HashMap.mjs +6 -5
- package/_mjs/collection/mutable/HashMap.mjs.map +1 -1
- package/_mjs/control/CompletablePromise.mjs +15 -0
- package/_mjs/control/CompletablePromise.mjs.map +1 -0
- package/_mjs/control/Z/api.mjs +1 -1
- package/_mjs/control/Z/api.mjs.map +1 -1
- package/_mjs/control/Z/runtime.mjs +2 -2
- package/_mjs/control/Z/runtime.mjs.map +1 -1
- package/_mjs/data/Branded/definition.mjs +4 -3
- package/_mjs/data/Branded/definition.mjs.map +1 -1
- package/_mjs/data/Cause/api/fold.mjs +8 -7
- package/_mjs/data/Cause/api/fold.mjs.map +1 -1
- package/_mjs/data/Cause/api.mjs +123 -127
- package/_mjs/data/Cause/api.mjs.map +1 -1
- package/_mjs/data/DatumEither/api.mjs +5 -4
- package/_mjs/data/DatumEither/api.mjs.map +1 -1
- package/_mjs/data/Decoder/api.mjs +2 -1
- package/_mjs/data/Decoder/api.mjs.map +1 -1
- package/_mjs/data/Either/api/alignWith.mjs +2 -1
- package/_mjs/data/Either/api/alignWith.mjs.map +1 -1
- package/_mjs/data/Either/api.mjs +22 -15
- package/_mjs/data/Either/api.mjs.map +1 -1
- package/_mjs/data/Either/constructors.mjs +10 -9
- package/_mjs/data/Either/constructors.mjs.map +1 -1
- package/_mjs/data/Either/definition.mjs +30 -4
- package/_mjs/data/Either/definition.mjs.map +1 -1
- package/_mjs/data/Either/instances.mjs +7 -6
- package/_mjs/data/Either/instances.mjs.map +1 -1
- package/_mjs/data/EitherT/api.mjs +4 -3
- package/_mjs/data/EitherT/api.mjs.map +1 -1
- package/_mjs/data/Eq/api.mjs +12 -0
- package/_mjs/data/Eq/api.mjs.map +1 -0
- package/_mjs/data/Eq.mjs +1 -0
- package/_mjs/data/Eq.mjs.map +1 -1
- package/_mjs/data/Equatable/api.mjs +35 -8
- package/_mjs/data/Equatable/api.mjs.map +1 -1
- package/_mjs/data/Equatable/definition.mjs +1 -1
- package/_mjs/data/Equatable/definition.mjs.map +1 -1
- package/_mjs/data/Exit/api.mjs +30 -6
- package/_mjs/data/Exit/api.mjs.map +1 -1
- package/_mjs/data/Exit/constructors.mjs +13 -12
- package/_mjs/data/Exit/constructors.mjs.map +1 -1
- package/_mjs/data/Exit/definition.mjs +11 -6
- package/_mjs/data/Exit/definition.mjs.map +1 -1
- package/_mjs/data/FiberId/api.mjs +16 -15
- package/_mjs/data/FiberId/api.mjs.map +1 -1
- package/_mjs/data/Interval.mjs +2 -1
- package/_mjs/data/Interval.mjs.map +1 -1
- package/_mjs/data/Maybe/api.mjs +8 -7
- package/_mjs/data/Maybe/api.mjs.map +1 -1
- package/_mjs/data/Maybe/constructors.mjs +11 -11
- package/_mjs/data/Maybe/constructors.mjs.map +1 -1
- package/_mjs/data/Maybe/definition.mjs +10 -5
- package/_mjs/data/Maybe/definition.mjs.map +1 -1
- package/_mjs/data/Maybe/instances.mjs +30 -8
- package/_mjs/data/Maybe/instances.mjs.map +1 -1
- package/_mjs/data/Showable/show.mjs +2 -2
- package/_mjs/data/Showable/show.mjs.map +1 -1
- package/_mjs/data/These/destructors.mjs +3 -2
- package/_mjs/data/These/destructors.mjs.map +1 -1
- package/_mjs/data/exceptions/IOError.mjs +14 -0
- package/_mjs/data/exceptions/IOError.mjs.map +1 -0
- package/_mjs/data/exceptions/NoSuchElementError.mjs.map +1 -1
- package/_mjs/data/exceptions.mjs +1 -0
- package/_mjs/data/exceptions.mjs.map +1 -1
- package/_mjs/optics/Lens/definition.mjs +2 -1
- package/_mjs/optics/Lens/definition.mjs.map +1 -1
- package/_mjs/optics/Prism/api/just.mjs +2 -1
- package/_mjs/optics/Prism/api/just.mjs.map +1 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs +2 -1
- package/_mjs/typeclass/ApplicativeExcept.mjs.map +1 -1
- package/_mjs/typeclass/Semialign.mjs +2 -1
- package/_mjs/typeclass/Semialign.mjs.map +1 -1
- package/_mjs/typeclass/Witherable.mjs +2 -1
- package/_mjs/typeclass/Witherable.mjs.map +1 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs +2 -1
- package/_mjs/typeclass/WitherableWithIndex.mjs.map +1 -1
- package/_mjs/typeclass.mjs +1 -1
- package/_mjs/typeclass.mjs.map +1 -1
- package/_mjs/types.mjs +0 -1
- package/_mjs/types.mjs.map +1 -1
- package/_mjs/util/predicates.mjs +3 -0
- package/_mjs/util/predicates.mjs.map +1 -1
- package/_mjs/util/rand/Random.mjs +2 -1
- package/_mjs/util/rand/Random.mjs.map +1 -1
- package/_src/collection/immutable/Conc/api.ts +12 -0
- package/_src/collection/immutable/HashMap/api.ts +11 -0
- package/_src/collection/immutable/HashMap/internal.ts +1 -1
- package/_src/collection/immutable/HashSet/api.ts +4 -4
- package/_src/collection/immutable/List/definition.ts +14 -2
- package/_src/collection/immutable/RoseTree/api.ts +1 -1
- package/_src/collection/immutable/Vector/api.ts +64 -2
- package/_src/collection/immutable/Vector/definition.ts +1 -0
- package/_src/control/CompletablePromise.ts +23 -0
- package/_src/control.ts +1 -0
- package/_src/data/Branded/definition.ts +3 -3
- package/_src/data/Cause/api.ts +33 -40
- package/_src/data/Either/api.ts +10 -0
- package/_src/data/Either/constructors.ts +4 -4
- package/_src/data/Either/definition.ts +29 -2
- package/_src/data/Eq/api.ts +8 -0
- package/_src/data/Eq.ts +1 -0
- package/_src/data/Equatable/api.ts +33 -8
- package/_src/data/Equatable/definition.ts +6 -2
- package/_src/data/Exit/api.ts +26 -0
- package/_src/data/Exit/constructors.ts +7 -7
- package/_src/data/Exit/definition.ts +9 -4
- package/_src/data/FiberId/api.ts +5 -5
- package/_src/data/Maybe/constructors.ts +4 -6
- package/_src/data/Maybe/definition.ts +9 -1
- package/_src/data/Maybe/instances.ts +18 -0
- package/_src/data/Showable/show.ts +2 -2
- package/_src/data/exceptions/IOError.ts +11 -0
- package/_src/data/exceptions/NoSuchElementError.ts +1 -1
- package/_src/data/exceptions.ts +1 -0
- package/_src/data.ts +1 -0
- package/_src/typeclass.ts +1 -1
- package/_src/types.ts +0 -1
- package/_src/util/predicates.ts +4 -0
- package/collection/immutable/Conc/api.d.ts +5 -0
- package/collection/immutable/HashMap/api.d.ts +5 -0
- package/collection/immutable/HashMap/internal.d.ts +1 -2
- package/collection/immutable/List/definition.d.ts +9 -0
- package/collection/immutable/Vector/api.d.ts +30 -3
- package/collection/immutable/Vector/definition.d.ts +1 -0
- package/control/CompletablePromise.d.ts +13 -0
- package/control.d.ts +1 -0
- package/data/Branded/definition.d.ts +3 -2
- package/data/Cause/api.d.ts +1 -1
- package/data/Either/api.d.ts +5 -0
- package/data/Either/constructors.d.ts +2 -2
- package/data/Either/definition.d.ts +15 -2
- package/data/Eq/api.d.ts +6 -0
- package/data/Eq.d.ts +1 -0
- package/data/Equatable/api.d.ts +7 -1
- package/data/Equatable/definition.d.ts +4 -1
- package/data/Exit/api.d.ts +12 -0
- package/data/Exit/constructors.d.ts +5 -5
- package/data/Exit/definition.d.ts +9 -2
- package/data/Maybe/constructors.d.ts +2 -2
- package/data/Maybe/definition.d.ts +9 -1
- package/data/Maybe/instances.d.ts +24 -0
- package/data/exceptions/IOError.d.ts +9 -0
- package/data/exceptions/NoSuchElementError.d.ts +1 -1
- package/data/exceptions.d.ts +1 -0
- package/data.d.ts +1 -0
- package/package.json +1 -1
- package/typeclass.d.ts +1 -1
- package/types.d.ts +0 -1
- package/util/predicates.d.ts +1 -0
- package/_cjs/types/test.cjs +0 -6
- package/_cjs/types/test.cjs.map +0 -1
- package/_mjs/types/test.mjs +0 -2
- package/_mjs/types/test.mjs.map +0 -1
- package/_src/types/test.ts +0 -0
- package/types/test.d.ts +0 -1
@@ -29,11 +29,12 @@ export declare namespace Brand {
|
|
29
29
|
*/
|
30
30
|
export declare class Validation<in out A, in out K extends string> {
|
31
31
|
readonly validate: Refinement<A, A & Brand.Valid<A, K>>;
|
32
|
-
|
32
|
+
readonly name: K;
|
33
|
+
constructor(validate: Refinement<A, A & Brand.Valid<A, K>>, name: K);
|
33
34
|
}
|
34
35
|
/**
|
35
36
|
* @tsplus static fncts.ValidationOps __call
|
36
37
|
* @tsplus location "@fncts/base/data/Branded/definition"
|
37
38
|
*/
|
38
|
-
export declare function makeValidation<A, K extends string>(p: Predicate<A
|
39
|
+
export declare function makeValidation<A, K extends string>(p: Predicate<A>, name: K): Validation<A, K>;
|
39
40
|
export {};
|
package/data/Cause/api.d.ts
CHANGED
@@ -12,7 +12,7 @@ import { Both, Cause, Fail, Halt, Interrupt, Then } from "./definition.js";
|
|
12
12
|
* @tsplus pipeable fncts.Cause as
|
13
13
|
* @tsplus location "@fncts/base/data/Cause/api"
|
14
14
|
*/
|
15
|
-
export declare function
|
15
|
+
export declare function as<B>(b: Lazy<B>): <A>(self: Cause<A>) => Cause<B>;
|
16
16
|
/**
|
17
17
|
* Constructs a `Cause` from two `Cause`s, representing parallel failures.
|
18
18
|
* @note If one of the `Cause`s is `Empty`, the non-empty `Cause` is returned
|
package/data/Either/api.d.ts
CHANGED
@@ -146,5 +146,10 @@ export declare function partitionMap<E, A, B, C>(f: (a: A) => Either<B, C>, /**
|
|
146
146
|
* @tsplus location "@fncts/base/data/Either/api"
|
147
147
|
*/
|
148
148
|
export declare function partition<E, A>(p: Predicate<A>, /** @tsplus auto */ M: P.Monoid<E>): (self: Either<E, A>) => readonly [Either<E, A>, Either<E, A>];
|
149
|
+
/**
|
150
|
+
* @tsplus getter fncts.Either toMaybe
|
151
|
+
* @tsplus location "@fncts/base/data/Either/api"
|
152
|
+
*/
|
153
|
+
export declare function toMaybe<E, A>(self: Either<E, A>): Maybe<A>;
|
149
154
|
export * from "./api/align.js";
|
150
155
|
export * from "./api/alignWith.js";
|
@@ -9,13 +9,13 @@ import { Either } from "./definition.js";
|
|
9
9
|
* @tsplus static fncts.Either.LeftOps __call
|
10
10
|
* @tsplus location "@fncts/base/data/Either/constructors"
|
11
11
|
*/
|
12
|
-
export declare function left<E = never, A = never>(e: E): Either<E, A>;
|
12
|
+
export declare function left<E = never, A = never>(e: E, __tsplusTrace?: string): Either<E, A>;
|
13
13
|
/**
|
14
14
|
* @tsplus static fncts.EitherOps right
|
15
15
|
* @tsplus static fncts.Either.RightOps __call
|
16
16
|
* @tsplus location "@fncts/base/data/Either/constructors"
|
17
17
|
*/
|
18
|
-
export declare function right<E = never, A = never>(a: A): Either<E, A>;
|
18
|
+
export declare function right<E = never, A = never>(a: A, __tsplusTrace?: string): Either<E, A>;
|
19
19
|
/**
|
20
20
|
* @tsplus static fncts.EitherOps fromMaybe
|
21
21
|
* @tsplus pipeable fncts.Maybe toEither
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import { HKT } from "@fncts/typelevel/HKT";
|
2
|
+
import { Hashable } from "@fncts/base/data/Hashable";
|
3
|
+
import type { EqualsContext } from "@fncts/base/data/Equatable";
|
2
4
|
export declare const enum EitherTag {
|
3
5
|
Left = "Left",
|
4
6
|
Right = "Right"
|
@@ -14,12 +16,16 @@ export interface EitherF extends HKT {
|
|
14
16
|
A: "+";
|
15
17
|
};
|
16
18
|
}
|
19
|
+
declare const IOTypeId: unique symbol;
|
20
|
+
type IOTypeId = typeof IOTypeId;
|
17
21
|
/**
|
18
22
|
* @tsplus type fncts.Either
|
19
23
|
* @tsplus companion fncts.EitherOps
|
20
24
|
*/
|
21
25
|
export declare class Either<E, A> {
|
22
26
|
readonly [EitherTypeId]: EitherTypeId;
|
27
|
+
readonly [IOTypeId]: IOTypeId;
|
28
|
+
readonly trace?: string | undefined;
|
23
29
|
[EitherVariance]: {
|
24
30
|
readonly _E: (_: never) => E;
|
25
31
|
readonly _A: (_: never) => A;
|
@@ -31,8 +37,11 @@ export declare class Either<E, A> {
|
|
31
37
|
*/
|
32
38
|
export declare class Left<E> extends Either<E, never> {
|
33
39
|
readonly left: E;
|
40
|
+
readonly trace?: string | undefined;
|
34
41
|
readonly _tag = EitherTag.Left;
|
35
|
-
constructor(left: E);
|
42
|
+
constructor(left: E, trace?: string | undefined);
|
43
|
+
get [Symbol.hash](): number;
|
44
|
+
[Symbol.equals](that: unknown, context: EqualsContext): boolean;
|
36
45
|
}
|
37
46
|
/**
|
38
47
|
* @tsplus type fncts.Either.Right
|
@@ -40,8 +49,11 @@ export declare class Left<E> extends Either<E, never> {
|
|
40
49
|
*/
|
41
50
|
export declare class Right<A> extends Either<never, A> {
|
42
51
|
readonly right: A;
|
52
|
+
readonly trace?: string | undefined;
|
43
53
|
readonly _tag = EitherTag.Right;
|
44
|
-
constructor(right: A);
|
54
|
+
constructor(right: A, trace?: string | undefined);
|
55
|
+
get [Symbol.hash](): number;
|
56
|
+
[Symbol.equals](that: unknown, context: EqualsContext): boolean;
|
45
57
|
}
|
46
58
|
/**
|
47
59
|
* @tsplus unify fncts.Either
|
@@ -54,3 +66,4 @@ export declare function unifyEither<X extends Either<any, any>>(self: X): Either
|
|
54
66
|
* @tsplus location "@fncts/base/data/Either/definition"
|
55
67
|
*/
|
56
68
|
export declare function concrete<E, A>(self: Either<E, A>): asserts self is Left<E> | Right<A>;
|
69
|
+
export {};
|
package/data/Eq/api.d.ts
ADDED
package/data/Eq.d.ts
CHANGED
package/data/Equatable/api.d.ts
CHANGED
@@ -2,10 +2,16 @@
|
|
2
2
|
* @tsplus static fncts.EquatableOps deepEquals
|
3
3
|
* @tsplus location "@fncts/base/data/Equatable/api"
|
4
4
|
*/
|
5
|
-
export declare
|
5
|
+
export declare function deepEquals<A>(a: A, b: unknown): boolean;
|
6
6
|
/**
|
7
7
|
* @tsplus static fncts.EquatableOps strictEquals
|
8
8
|
* @tsplus operator fncts.Equatable ==
|
9
9
|
* @tsplus location "@fncts/base/data/Equatable/api"
|
10
10
|
*/
|
11
11
|
export declare function strictEquals<A>(a: A, b: unknown): boolean;
|
12
|
+
/**
|
13
|
+
* @tsplus static fncts.EquatableOps strictNotEquals
|
14
|
+
* @tsplus operator fncts.Equatable !=
|
15
|
+
* @tsplus location "@fncts/base/data/Equatable/api"
|
16
|
+
*/
|
17
|
+
export declare function strictNotEquals<A>(a: A, b: unknown): boolean;
|
@@ -3,11 +3,14 @@
|
|
3
3
|
* @tsplus location "@fncts/base/data/Equatable/definition"
|
4
4
|
*/
|
5
5
|
export declare const equalsSymbol: unique symbol;
|
6
|
+
export interface EqualsContext {
|
7
|
+
comparator: (a: unknown, b: unknown) => boolean;
|
8
|
+
}
|
6
9
|
/**
|
7
10
|
* @tsplus type fncts.Equatable
|
8
11
|
*/
|
9
12
|
export interface Equatable {
|
10
|
-
[equalsSymbol](that: unknown): boolean;
|
13
|
+
[equalsSymbol](that: unknown, context: EqualsContext): boolean;
|
11
14
|
}
|
12
15
|
export declare function isEquatable(u: unknown): u is Equatable;
|
13
16
|
/**
|
package/data/Exit/api.d.ts
CHANGED
@@ -97,3 +97,15 @@ export declare function zipConcurrent<EB, B>(that: Exit<EB, B>): <EA, A>(self: i
|
|
97
97
|
* @tsplus location "@fncts/base/data/Exit/api"
|
98
98
|
*/
|
99
99
|
export declare function zipWithCause<E, A, G, B, C>(fb: Exit<G, B>, f: (a: A, b: B) => C, g: (ea: Cause<E>, eb: Cause<G>) => Cause<E | G>): (fa: Exit<E, A>) => Exit<E | G, C>;
|
100
|
+
/**
|
101
|
+
* Returns the Exit's Success value if it exists
|
102
|
+
* @tsplus getter fncts.Exit value
|
103
|
+
* @tsplus location "@fncts/base/data/Exit/api"
|
104
|
+
*/
|
105
|
+
export declare function value<E, A>(self: Exit<E, A>): A | undefined;
|
106
|
+
/**
|
107
|
+
* Returns the Exit's Success value if it exists, or throws the pretty-printed Cause if it doesn't
|
108
|
+
* @tsplus getter fncts.Exit valueOrThrow
|
109
|
+
* @tsplus location "@fncts/base/data/Exit/api"
|
110
|
+
*/
|
111
|
+
export declare function valueOrThrow<E, A>(self: Exit<E, A>): A;
|
@@ -7,12 +7,12 @@ import { FiberId } from "@fncts/base/data/FiberId/definition";
|
|
7
7
|
* @tsplus static fncts.ExitOps halt
|
8
8
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
9
9
|
*/
|
10
|
-
export declare function halt(defect: unknown): Exit<never, never>;
|
10
|
+
export declare function halt(defect: unknown, __tsplusTrace?: string): Exit<never, never>;
|
11
11
|
/**
|
12
12
|
* @tsplus static fncts.ExitOps fail
|
13
13
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
14
14
|
*/
|
15
|
-
export declare function fail<E = never, A = never>(e: E): Exit<E, A>;
|
15
|
+
export declare function fail<E = never, A = never>(e: E, __tsplusTrace?: string): Exit<E, A>;
|
16
16
|
/**
|
17
17
|
* @tsplus static fncts.ExitOps fromEither
|
18
18
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
@@ -27,17 +27,17 @@ export declare function fromMaybe<E, A>(fa: Maybe<A>, onNothing: () => E): Exit<
|
|
27
27
|
* @tsplus static fncts.ExitOps failCause
|
28
28
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
29
29
|
*/
|
30
|
-
export declare function failCause<E = never, A = never>(cause: Cause<E
|
30
|
+
export declare function failCause<E = never, A = never>(cause: Cause<E>, __tsplusTrace?: string): Exit<E, A>;
|
31
31
|
/**
|
32
32
|
* @tsplus static fncts.ExitOps interrupt
|
33
33
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
34
34
|
*/
|
35
|
-
export declare function interrupt(id: FiberId): Exit<never, never>;
|
35
|
+
export declare function interrupt(id: FiberId, __tsplusTrace?: string): Exit<never, never>;
|
36
36
|
/**
|
37
37
|
* @tsplus static fncts.ExitOps succeed
|
38
38
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
39
39
|
*/
|
40
|
-
export declare function succeed<E = never, A = never>(value: A): Exit<E, A>;
|
40
|
+
export declare function succeed<E = never, A = never>(value: A, __tsplusTrace?: string): Exit<E, A>;
|
41
41
|
/**
|
42
42
|
* @tsplus static fncts.ExitOps unit
|
43
43
|
* @tsplus location "@fncts/base/data/Exit/constructors"
|
@@ -19,19 +19,23 @@ export declare const enum ExitTag {
|
|
19
19
|
Success = "Success",
|
20
20
|
Failure = "Failure"
|
21
21
|
}
|
22
|
+
declare const IOTypeId: unique symbol;
|
23
|
+
type IOTypeId = typeof IOTypeId;
|
22
24
|
/**
|
23
25
|
* @tsplus type fncts.Exit.Failure
|
24
26
|
* @tsplus companion fncts.Exit.FailureOps
|
25
27
|
*/
|
26
28
|
export declare class Failure<E> {
|
27
29
|
readonly cause: Cause<E>;
|
30
|
+
readonly trace?: string | undefined;
|
28
31
|
readonly [ExitTypeId]: ExitTypeId;
|
29
32
|
[ExitVariance]: {
|
30
33
|
readonly _E: (_: never) => E;
|
31
34
|
readonly _A: (_: never) => never;
|
32
35
|
};
|
36
|
+
readonly [IOTypeId]: IOTypeId;
|
33
37
|
readonly _tag = ExitTag.Failure;
|
34
|
-
constructor(cause: Cause<E
|
38
|
+
constructor(cause: Cause<E>, trace?: string | undefined);
|
35
39
|
get [Symbol.hash](): number;
|
36
40
|
[Symbol.equals](that: unknown): boolean;
|
37
41
|
}
|
@@ -41,13 +45,15 @@ export declare class Failure<E> {
|
|
41
45
|
*/
|
42
46
|
export declare class Success<A> implements P.Hashable, P.Equatable {
|
43
47
|
readonly value: A;
|
48
|
+
readonly trace?: string | undefined;
|
44
49
|
readonly [ExitTypeId]: ExitTypeId;
|
45
50
|
[ExitVariance]: {
|
46
51
|
readonly _E: (_: never) => never;
|
47
52
|
readonly _A: (_: never) => A;
|
48
53
|
};
|
54
|
+
readonly [IOTypeId]: IOTypeId;
|
49
55
|
readonly _tag = ExitTag.Success;
|
50
|
-
constructor(value: A);
|
56
|
+
constructor(value: A, trace?: string | undefined);
|
51
57
|
get [Symbol.hash](): number;
|
52
58
|
[Symbol.equals](that: unknown): boolean;
|
53
59
|
}
|
@@ -75,3 +81,4 @@ export declare function isSuccess<E, A>(exit: Exit<E, A>): exit is Success<A>;
|
|
75
81
|
* @tsplus unify fncts.Exit
|
76
82
|
*/
|
77
83
|
export declare function unifyExit<X extends Exit<any, any>>(_: X): Exit<[X] extends [Exit<infer E, any>] ? E : never, [X] extends [Exit<any, infer A>] ? A : never>;
|
84
|
+
export {};
|
@@ -7,13 +7,13 @@ import type { Nullable } from "@fncts/base/types";
|
|
7
7
|
* @tsplus static fncts.JustOps __call
|
8
8
|
* @tsplus location "@fncts/base/data/Maybe/constructors"
|
9
9
|
*/
|
10
|
-
export declare function just<A>(a: A): Maybe<A>;
|
10
|
+
export declare function just<A>(a: A, __tsplusTrace?: string): Maybe<A>;
|
11
11
|
/**
|
12
12
|
* @tsplus static fncts.MaybeOps nothing
|
13
13
|
* @tsplus static fncts.NothingOps __call
|
14
14
|
* @tsplus location "@fncts/base/data/Maybe/constructors"
|
15
15
|
*/
|
16
|
-
export declare function nothing<A = never>(): Maybe<A>;
|
16
|
+
export declare function nothing<A = never>(__tsplusTrace?: string): Maybe<A>;
|
17
17
|
/**
|
18
18
|
* @tsplus static fncts.MaybeOps fromNullable
|
19
19
|
* @tsplus location "@fncts/base/data/Maybe/constructors"
|
@@ -9,6 +9,8 @@ export declare const MaybeVariance: unique symbol;
|
|
9
9
|
export type MaybeVariance = typeof MaybeVariance;
|
10
10
|
export declare const MaybeTypeId: unique symbol;
|
11
11
|
export type MaybeTypeId = typeof MaybeTypeId;
|
12
|
+
declare const IOTypeId: unique symbol;
|
13
|
+
type IOTypeId = typeof IOTypeId;
|
12
14
|
export interface MaybeF extends HKT {
|
13
15
|
type: Maybe<this["A"]>;
|
14
16
|
variance: {
|
@@ -24,6 +26,8 @@ export declare abstract class Maybe<A> {
|
|
24
26
|
readonly _A: (_: never) => A;
|
25
27
|
};
|
26
28
|
readonly [MaybeTypeId]: MaybeTypeId;
|
29
|
+
readonly [IOTypeId]: IOTypeId;
|
30
|
+
readonly trace?: string | undefined;
|
27
31
|
}
|
28
32
|
/**
|
29
33
|
* @tsplus type fncts.Just
|
@@ -31,8 +35,9 @@ export declare abstract class Maybe<A> {
|
|
31
35
|
*/
|
32
36
|
export declare class Just<A> extends Maybe<A> {
|
33
37
|
readonly value: A;
|
38
|
+
readonly trace?: string | undefined;
|
34
39
|
readonly _tag = MaybeTag.Just;
|
35
|
-
constructor(value: A);
|
40
|
+
constructor(value: A, trace?: string | undefined);
|
36
41
|
[Symbol.equals](that: unknown): boolean;
|
37
42
|
get [Symbol.hash](): number;
|
38
43
|
}
|
@@ -41,7 +46,9 @@ export declare class Just<A> extends Maybe<A> {
|
|
41
46
|
* @tsplus companion fncts.NothingOps
|
42
47
|
*/
|
43
48
|
export declare class Nothing extends Maybe<never> {
|
49
|
+
readonly trace?: string | undefined;
|
44
50
|
readonly _tag = MaybeTag.Nothing;
|
51
|
+
constructor(trace?: string | undefined);
|
45
52
|
[Symbol.equals](that: unknown): boolean;
|
46
53
|
get [Symbol.hash](): number;
|
47
54
|
}
|
@@ -77,3 +84,4 @@ export declare function isNothing<A>(self: Maybe<A>): self is Nothing;
|
|
77
84
|
* @tsplus location "@fncts/base/data/Maybe/definition"
|
78
85
|
*/
|
79
86
|
export declare function concrete<A>(self: Maybe<A>): asserts self is Just<A> | Nothing;
|
87
|
+
export {};
|
@@ -4,11 +4,35 @@ import { Decoder } from "@fncts/base/data/Decoder/definition";
|
|
4
4
|
import { Encoder } from "@fncts/base/data/Encoder/definition";
|
5
5
|
import type * as P from "../../typeclass.js";
|
6
6
|
import type { MaybeF } from "@fncts/base/data/Maybe/definition";
|
7
|
+
/**
|
8
|
+
* @tsplus static fncts.MaybeOps Functor
|
9
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
10
|
+
*/
|
7
11
|
export declare const Functor: P.Functor<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
12
|
+
/**
|
13
|
+
* @tsplus static fncts.MaybeOps Apply
|
14
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
15
|
+
*/
|
8
16
|
export declare const Apply: P.Apply<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
17
|
+
/**
|
18
|
+
* @tsplus static fncts.MaybeOps Applicative
|
19
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
20
|
+
*/
|
9
21
|
export declare const Applicative: P.Applicative<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
22
|
+
/**
|
23
|
+
* @tsplus static fncts.MaybeOps Monad
|
24
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
25
|
+
*/
|
10
26
|
export declare const Monad: P.Monad<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
27
|
+
/**
|
28
|
+
* @tsplus static fncts.MaybeOps Foldable
|
29
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
30
|
+
*/
|
11
31
|
export declare const Foldable: P.Foldable<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
32
|
+
/**
|
33
|
+
* @tsplus static fncts.MaybeOps Filterable
|
34
|
+
* @tsplus location "@fncts/base/data/Maybe/instances"
|
35
|
+
*/
|
12
36
|
export declare const Filterable: P.Filterable<MaybeF, import("@fncts/typelevel/HKT.js").HKT.None>;
|
13
37
|
/**
|
14
38
|
* @tsplus derive fncts.Guard[fncts.Maybe]<_> 10
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Cause } from "@fncts/base/data/Cause/definition";
|
2
|
+
export declare const IOErrorTypeId: unique symbol;
|
3
|
+
export type IOErrorTypeId = typeof IOErrorTypeId;
|
4
|
+
export declare class IOError<E> {
|
5
|
+
readonly cause: Cause<E>;
|
6
|
+
readonly [IOErrorTypeId]: IOErrorTypeId;
|
7
|
+
constructor(cause: Cause<E>);
|
8
|
+
}
|
9
|
+
export declare function isIOError(u: unknown): u is IOError<unknown>;
|
package/data/exceptions.d.ts
CHANGED
@@ -4,5 +4,6 @@ export * from "./exceptions/IllegalStateError.js";
|
|
4
4
|
export * from "./exceptions/IndexOutOfBoundsError.js";
|
5
5
|
export * from "./exceptions/InterruptedException.js";
|
6
6
|
export * from "./exceptions/InvalidCapacityError.js";
|
7
|
+
export * from "./exceptions/IOError.js";
|
7
8
|
export * from "./exceptions/NoSuchElementError.js";
|
8
9
|
export * from "./exceptions/RuntimeError.js";
|
package/data.d.ts
CHANGED
@@ -37,6 +37,7 @@ export type {} from "./data/Predicate.js";
|
|
37
37
|
export type {} from "./data/Refinement.js";
|
38
38
|
export type {} from "./data/Showable.js";
|
39
39
|
export type {} from "./data/string.js";
|
40
|
+
export type {} from "./data/Struct.js";
|
40
41
|
export type {} from "./data/Tag.js";
|
41
42
|
export type {} from "./data/These.js";
|
42
43
|
export type {} from "./data/Trace.js";
|
package/package.json
CHANGED
package/typeclass.d.ts
CHANGED
@@ -29,7 +29,7 @@ export * from "./typeclass/Witherable.js";
|
|
29
29
|
export * from "./typeclass/WitherableWithIndex.js";
|
30
30
|
export { Eq } from "./data/Eq.js";
|
31
31
|
export { Equatable } from "./data/Equatable.js";
|
32
|
-
export { Guard } from "./data/Guard.js";
|
32
|
+
export { Guard } from "./data/Guard/definition.js";
|
33
33
|
export { Hash } from "./data/Hash.js";
|
34
34
|
export { Hashable } from "./data/Hashable.js";
|
35
35
|
export { HashEq } from "./data/HashEq.js";
|
package/types.d.ts
CHANGED
package/util/predicates.d.ts
CHANGED
@@ -11,6 +11,7 @@ export declare function isArray<A>(value: unknown): value is Array<A>;
|
|
11
11
|
export declare function isObject<A extends Function>(value: A): false;
|
12
12
|
export declare function isObject(value: unknown): value is object & Record<PropertyKey, any>;
|
13
13
|
export declare function isObject<A>(value: A | Primitive): value is A & Record<PropertyKey, unknown>;
|
14
|
+
export declare function isRecord(value: unknown): value is object & Record<PropertyKey, unknown>;
|
14
15
|
export declare function hasTypeId<X extends symbol>(value: unknown, typeId: X): value is {
|
15
16
|
readonly [K in X]: X;
|
16
17
|
} & Record<PropertyKey, unknown>;
|
package/_cjs/types/test.cjs
DELETED
package/_cjs/types/test.cjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"test.cjs","mappings":"","names":[],"sourceRoot":"","sources":[],"sourcesContent":[]}
|
package/_mjs/types/test.mjs
DELETED
package/_mjs/types/test.mjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"test.mjs","mappings":"","names":[],"sourceRoot":"","sources":[],"sourcesContent":[]}
|
package/_src/types/test.ts
DELETED
File without changes
|
package/types/test.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|