Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
move Serializable generics right
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored and gcanti committed Dec 3, 2023
1 parent 27272b1 commit b590a5e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 40 deletions.
16 changes: 8 additions & 8 deletions docs/modules/Serializable.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Added in v1.0.0
```ts
export declare const deserializeExit: {
<IE, E, IA, A>(
(
value: unknown
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, Exit.Exit<E, A>>
): <IE, E, IA, A>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, Exit.Exit<E, A>>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
Expand All @@ -122,7 +122,7 @@ Added in v1.0.0
```ts
export declare const deserializeFailure: {
<IE, E, IA, A>(value: unknown): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, E>
(value: unknown): <IE, E, IA, A>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, E>
<IE, E, IA, A>(self: WithResult<IE, E, IA, A>, value: unknown): Effect.Effect<never, ParseResult.ParseError, E>
}
```
Expand All @@ -135,7 +135,7 @@ Added in v1.0.0
```ts
export declare const deserializeSuccess: {
<IE, E, IA, A>(value: unknown): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, A>
(value: unknown): <IE, E, IA, A>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, A>
<IE, E, IA, A>(self: WithResult<IE, E, IA, A>, value: unknown): Effect.Effect<never, ParseResult.ParseError, A>
}
```
Expand All @@ -160,9 +160,9 @@ Added in v1.0.0
```ts
export declare const serializeExit: {
<IE, E, IA, A>(
<E, A>(
value: Exit.Exit<E, A>
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, Schema.ExitFrom<IE, IA>>
): <IE, IA>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, Schema.ExitFrom<IE, IA>>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: Exit.Exit<E, A>
Expand All @@ -178,7 +178,7 @@ Added in v1.0.0
```ts
export declare const serializeFailure: {
<IE, E, IA, A>(value: E): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IE>
<E>(value: E): <IE, IA, A>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IE>
<IE, E, IA, A>(self: WithResult<IE, E, IA, A>, value: E): Effect.Effect<never, ParseResult.ParseError, IE>
}
```
Expand All @@ -191,7 +191,7 @@ Added in v1.0.0
```ts
export declare const serializeSuccess: {
<IE, E, IA, A>(value: A): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IA>
<A>(value: A): <IE, E, IA>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IA>
<IE, E, IA, A>(self: WithResult<IE, E, IA, A>, value: A): Effect.Effect<never, ParseResult.ParseError, IA>
}
```
Expand Down
60 changes: 28 additions & 32 deletions src/Serializable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ export const deserialize: {
* @category encoding
*/
export const serializeFailure: {
<IE, E, IA, A>(
<E>(
value: E
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IE>
): <IE, IA, A>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IE>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: E
): Effect.Effect<never, ParseResult.ParseError, IE>
} = dual<
<IE, E, IA, A>(
value: E
) => (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IE>,
<E>(value: E) => <IE, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, IE>,
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: E
Expand All @@ -151,17 +151,17 @@ export const serializeFailure: {
* @category decoding
*/
export const deserializeFailure: {
<IE, E, IA, A>(
value: unknown
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, E>
(value: unknown): <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, E>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
): Effect.Effect<never, ParseResult.ParseError, E>
} = dual<
<IE, E, IA, A>(
value: unknown
) => (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, E>,
(value: unknown) => <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, E>,
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
Expand All @@ -173,17 +173,17 @@ export const deserializeFailure: {
* @category encoding
*/
export const serializeSuccess: {
<IE, E, IA, A>(
<A>(
value: A
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IA>
): <IE, E, IA>(self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IA>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: A
): Effect.Effect<never, ParseResult.ParseError, IA>
} = dual<
<IE, E, IA, A>(
value: A
) => (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, IA>,
<A>(value: A) => <IE, E, IA>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, IA>,
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: A
Expand All @@ -195,17 +195,19 @@ export const serializeSuccess: {
* @category decoding
*/
export const deserializeSuccess: {
<IE, E, IA, A>(
(
value: unknown
): (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, A>
): <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, A>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
): Effect.Effect<never, ParseResult.ParseError, A>
} = dual<
<IE, E, IA, A>(
value: unknown
) => (self: WithResult<IE, E, IA, A>) => Effect.Effect<never, ParseResult.ParseError, A>,
(value: unknown) => <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, A>,
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
Expand All @@ -217,19 +219,17 @@ export const deserializeSuccess: {
* @category encoding
*/
export const serializeExit: {
<IE, E, IA, A>(
<E, A>(
value: Exit.Exit<E, A>
): (
): <IE, IA>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, Schema.ExitFrom<IE, IA>>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: Exit.Exit<E, A>
): Effect.Effect<never, ParseResult.ParseError, Schema.ExitFrom<IE, IA>>
} = dual<
<IE, E, IA, A>(
value: Exit.Exit<E, A>
) => (
<E, A>(value: Exit.Exit<E, A>) => <IE, IA>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, Schema.ExitFrom<IE, IA>>,
<IE, E, IA, A>(
Expand All @@ -243,19 +243,15 @@ export const serializeExit: {
* @category decoding
*/
export const deserializeExit: {
<IE, E, IA, A>(
value: unknown
): (
(value: unknown): <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, Exit.Exit<E, A>>
<IE, E, IA, A>(
self: WithResult<IE, E, IA, A>,
value: unknown
): Effect.Effect<never, ParseResult.ParseError, Exit.Exit<E, A>>
} = dual<
<IE, E, IA, A>(
value: unknown
) => (
(value: unknown) => <IE, E, IA, A>(
self: WithResult<IE, E, IA, A>
) => Effect.Effect<never, ParseResult.ParseError, Exit.Exit<E, A>>,
<IE, E, IA, A>(
Expand Down

0 comments on commit b590a5e

Please sign in to comment.