effect icon indicating copy to clipboard operation
effect copied to clipboard

Documentation for how to specify explicit types for Effect.fn

Open tmcw opened this issue 4 weeks ago • 0 comments

What is the type of issue?

Documentation is missing

What is the issue?

The Effect.Effect type is pretty well-documented and there are plenty of examples of explicit types for a returned Effect from a function. For example: https://effect.website/docs/getting-started/control-flow/#if-expression

The Effect.fn type though seems to be totally different and there isn't an obvious migration path from 'function that returns an effect' to 'effect.fn with explicit types'

It would be great if there was an example, because the Effect.fn method does seem like a nice improvement in dx but since it's relatively new people will be upgrading, and might not want to switch from explicit to inferred types.

Where did you find it?

https://effect.website/docs/error-management/expected-errors/#effectfn

tmcw avatar Dec 03 '25 14:12 tmcw