From f08cc59fef605b4e1fdb27467076c946de8cf98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Tue, 24 Mar 2026 10:20:54 +0100 Subject: [PATCH] Cleanup --- packages/effect-fc/src/Lens.ts | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) 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 -)