Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No IOE.fromIOOption() #1836

Open
QimatLuo opened this issue Feb 23, 2023 · 0 comments
Open

No IOE.fromIOOption() #1836

QimatLuo opened this issue Feb 23, 2023 · 0 comments

Comments

@QimatLuo
Copy link

🚀 Feature request

Current Behavior

No this function.

Desired Behavior

export declare const fromIOOption: <E>(onNone: Lazy<E>) => <A>(fa: Option<A>) => IOEither<E, A>

Suggested Solution

Add this function for sugar.

Who does this impact? Who is this for?

People who want to do IOO -> IOE to give an error message if it's O.none.

Describe alternatives you've considered

flow(
  getParamNonEmpty,
  IO.map(E.fromOption(() => 'error message when env no value'))
)

Additional context

fp-ts-std: getParamNonEmpty

Your environment

Software Version(s)
fp-ts 2.13.1
TypeScript 4.9.5
@gcanti gcanti added this to the 2.14 milestone Feb 23, 2023
@gcanti gcanti modified the milestones: 2.14, 2.15 Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants