diff --git a/packages/effect-fc/src/Lens.ts b/packages/effect-fc/src/Lens.ts index e5e754e..5a8596f 100644 --- a/packages/effect-fc/src/Lens.ts +++ b/packages/effect-fc/src/Lens.ts @@ -1,4 +1,4 @@ -import { Array, Chunk, Effect, Function, Pipeable, Predicate, Readable, Stream, Subscribable, SubscriptionRef } from "effect" +import { Array, Chunk, Effect, Function, Pipeable, Predicate, Readable, Stream, Subscribable, type SubscriptionRef } from "effect" import type { NoSuchElementException } from "effect/Cause" @@ -139,7 +139,7 @@ export const mapEffect: { )), })) -export const mapStructField: { +export const mapField: { ( self: Lens, key: K, @@ -287,24 +287,3 @@ export const updateAndGetEffect: { next => Effect.succeed([next, next] as const), )), ) - - -Effect.gen(function*() { - const ref = yield* SubscriptionRef.make({ - values: [13, 69, 1488] as readonly number[] - } as const) - - const myValueLens = ref.pipe( - fromSubscriptionRef, - mapStructField("values"), - mapArrayAt(1), - ) - - const myValueLens2 = mapArrayAt(mapStructField(fromSubscriptionRef(ref), "values"), 1) - - console.log(yield* ref.get, yield* myValueLens.get) - yield* set(myValueLens, 22) - console.log(yield* ref.get, yield* myValueLens.get) -}).pipe( - Effect.runSync -)