Skip to content

Documentation for how to specify explicit types for Effect.fn #5860

@tmcw

Description

@tmcw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions