Skip to content

docs(Effect.fn): add example for explicit type annotations#6164

Open
aymenhmaidiwastaken wants to merge 1 commit intoEffect-TS:mainfrom
aymenhmaidiwastaken:docs/effect-fn-explicit-types
Open

docs(Effect.fn): add example for explicit type annotations#6164
aymenhmaidiwastaken wants to merge 1 commit intoEffect-TS:mainfrom
aymenhmaidiwastaken:docs/effect-fn-explicit-types

Conversation

@aymenhmaidiwastaken
Copy link
Copy Markdown
Contributor

Summary

  • Add a "before/after" JSDoc example to Effect.fn showing how to migrate from a function with an explicit Effect.Effect<A, E, R> return type to Effect.fn using Effect.fn.Return<A, E, R>
  • Uses Data.TaggedError for the error type to follow current Effect patterns

This addresses the documentation gap where users know how to type regular functions returning effects but don't know the equivalent pattern for Effect.fn.

Closes #5860

Show how to use Effect.fn.Return<A, E, R> when migrating from a
function with an explicit Effect.Effect return type. Includes a
before/after comparison to help users transitioning to Effect.fn.

Closes Effect-TS#5860
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 10, 2026

⚠️ No Changeset found

Latest commit: bc4882f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@tim-smart tim-smart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if the existing example was updated instead of adding a new one.

@github-project-automation github-project-automation Bot moved this from Discussion Ongoing to Waiting on Author in PR Backlog Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

Documentation for how to specify explicit types for Effect.fn

2 participants