Skip to content

Commit

Permalink
remove extra never's
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Oct 9, 2024
1 parent cc9b27b commit 0a30192
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/effect/src/TSubscriptionRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const changesScoped: <A>(self: TSubscriptionRef<A>) => Effect.Effect<TQue
* @since 3.10.0
* @category mutations
*/
export const changesStream: <A>(self: TSubscriptionRef<A>) => Stream.Stream<A, never, never> = internal.changesStream
export const changesStream: <A>(self: TSubscriptionRef<A>) => Stream.Stream<A> = internal.changesStream

/**
* @since 3.10.0
Expand Down
22 changes: 11 additions & 11 deletions packages/effect/src/internal/stm/tSubscriptionRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class TDequeueMerge<A> implements TQueue.TDequeue<A> {
readonly second: TQueue.TDequeue<A>
) {}

peek: STM.STM<A, never, never> = STM.gen(this, function*() {
peek: STM.STM<A> = STM.gen(this, function*() {
const first = yield* this.peekOption
if (first._tag === "Some") {
return first.value
}
return yield* STM.retry
})

peekOption: STM.STM<Option.Option<A>, never, never> = STM.gen(this, function*() {
peekOption: STM.STM<Option.Option<A>> = STM.gen(this, function*() {
const first = yield* this.first.peekOption
if (first._tag === "Some") {
return first
Expand All @@ -52,7 +52,7 @@ class TDequeueMerge<A> implements TQueue.TDequeue<A> {
return Option.none()
})

take: STM.STM<A, never, never> = STM.gen(this, function*() {
take: STM.STM<A> = STM.gen(this, function*() {
if (!(yield* this.first.isEmpty)) {
return yield* this.first.take
}
Expand All @@ -62,11 +62,11 @@ class TDequeueMerge<A> implements TQueue.TDequeue<A> {
return yield* STM.retry
})

takeAll: STM.STM<Array<A>, never, never> = STM.gen(this, function*() {
takeAll: STM.STM<Array<A>> = STM.gen(this, function*() {
return [...yield* this.first.takeAll, ...yield* this.second.takeAll]
})

takeUpTo(max: number): STM.STM<Array<A>, never, never> {
takeUpTo(max: number): STM.STM<Array<A>> {
return STM.gen(this, function*() {
const first = yield* this.first.takeUpTo(max)
if (first.length >= max) {
Expand All @@ -80,28 +80,28 @@ class TDequeueMerge<A> implements TQueue.TDequeue<A> {
return this.first.capacity() + this.second.capacity()
}

size: STM.STM<number, never, never> = STM.gen(this, function*() {
size: STM.STM<number> = STM.gen(this, function*() {
return (yield* this.first.size) + (yield* this.second.size)
})

isFull: STM.STM<boolean, never, never> = STM.gen(this, function*() {
isFull: STM.STM<boolean> = STM.gen(this, function*() {
return (yield* this.first.isFull) && (yield* this.second.isFull)
})

isEmpty: STM.STM<boolean, never, never> = STM.gen(this, function*() {
isEmpty: STM.STM<boolean> = STM.gen(this, function*() {
return (yield* this.first.isEmpty) && (yield* this.second.isEmpty)
})

shutdown: STM.STM<void, never, never> = STM.gen(this, function*() {
shutdown: STM.STM<void> = STM.gen(this, function*() {
yield* this.first.shutdown
yield* this.second.shutdown
})

isShutdown: STM.STM<boolean, never, never> = STM.gen(this, function*() {
isShutdown: STM.STM<boolean> = STM.gen(this, function*() {
return (yield* this.first.isShutdown) && (yield* this.second.isShutdown)
})

awaitShutdown: STM.STM<void, never, never> = STM.gen(this, function*() {
awaitShutdown: STM.STM<void> = STM.gen(this, function*() {
yield* this.first.awaitShutdown
yield* this.second.awaitShutdown
})
Expand Down

0 comments on commit 0a30192

Please sign in to comment.