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

Add Option.thenAlso #157

Open
Dean177 opened this issue Jun 18, 2020 · 0 comments
Open

Add Option.thenAlso #157

Dean177 opened this issue Jun 18, 2020 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed in-dark-repo There's an implementation which can be copied from https://github.com/darklang/dark

Comments

@Dean177
Copy link
Collaborator

Dean177 commented Jun 18, 2020

Sample implemenetation

  (* If a is some, then apply fn to a, return both a and the result.
    if either a or b is none, then return none
  *)
  let thenAlso (a : 'a option) ~(f : 'a -> 'b option) : ('a * 'b) option =
    let b = andThen ~f a in
    pair a b
@Dean177 Dean177 added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 18, 2020
@pbiggar pbiggar added the in-dark-repo There's an implementation which can be copied from https://github.com/darklang/dark label Aug 2, 2021
@pbiggar pbiggar added this to the 0.2.0 milestone Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed in-dark-repo There's an implementation which can be copied from https://github.com/darklang/dark
Projects
None yet
Development

No branches or pull requests

2 participants