Skip to content

Commit

Permalink
if it looks like an Effect, it quacks like an Effect, it probably is …
Browse files Browse the repository at this point in the history
…(an Effect)
  • Loading branch information
patroza committed Oct 26, 2023
1 parent 87ca0d5 commit aaeb80e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/_src/Unify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import type { Chunk, Either, Option } from "./Prelude.js"
/**
* @tsplus unify effect/io/Effect
*/
export function unifyEffect<X extends Effect<any, any, any>>(
export function unifyEffect<X extends { readonly [EffectTypeId]: Effect.VarianceStruct<any, any, any> }>(
self: X
): Effect<
[X] extends [{ readonly [EffectTypeId]: { _R: (_: never) => infer R } }] ? R : never,
[X] extends [{ readonly [EffectTypeId]: { _E: (_: never) => infer E } }] ? E : never,
[X] extends [{ readonly [EffectTypeId]: { _A: (_: never) => infer A } }] ? A : never
> {
return self
return self as any
}

/**
Expand Down
14 changes: 14 additions & 0 deletions packages/core/vendor/effect-data-tsplus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,20 @@
}
],
"effect/Data": [
{
"definitionName": "YieldableError",
"definitionKind": "interface",
"extensions": [
{
"kind": "type",
"typeName": "effect/data/Data/YieldableError"
},
{
"kind": "companion",
"typeName": "effect/data/Data/YieldableError.Ops"
}
]
},
{
"definitionName": "Case",
"definitionKind": "interface",
Expand Down

0 comments on commit aaeb80e

Please sign in to comment.