Skip to content

Cache.make shouldn't return an Effect which has an Environment requirement #6084

@arturaz

Description

@arturaz

What version of Effect is running?

3.19.19

What steps can reproduce the bug?

This should be possible:

  const doToolCall: Effect.Effect<string, never, MyDeps>

        const cache = Effect.runSync(
          Cache.make({
            capacity: 1000,
            timeToLive: '5 minutes',
            lookup: (_key: ToolCallCacheKey) => doToolCall,
          }),
        )

Making the cache doesn't need MyDeps, doing the lookups does.

What is the expected behavior?

Cache.make should look like:

export const make: <Key, Value, Error = never, Environment = never>(
  options: {
    readonly capacity: number
    readonly timeToLive: Duration.DurationInput
    readonly lookup: Lookup<Key, Value, Error, Environment>
  }
) => Effect.Effect<Cache<Key, Value, Error>, never, never> 

What do you see instead?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions