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

Extra interface functions #24

Closed
vrom911 opened this issue Mar 15, 2020 · 2 comments · Fixed by #45
Closed

Extra interface functions #24

vrom911 opened this issue Mar 15, 2020 · 2 comments · Fixed by #45
Assignees
Labels
enhancement New feature or request

Comments

@vrom911
Copy link
Member

vrom911 commented Mar 15, 2020

  • whenSuccess
  • whenFailure
  • whenSuccess_
  • whenFailure_
  • whenSuccessM
  • whenFailureM
@vrom911 vrom911 added the enhancement New feature or request label Mar 15, 2020
@chshersh
Copy link
Contributor

@vrom911 Good idea! I guess we can even put them in some module like Validation.Combinators

@chshersh
Copy link
Contributor

chshersh commented Mar 16, 2020

One more useful function to add: run multiple validations on a single value. Something like:

validateAll :: Semigroup e => [a -> Validation e b] -> a -> Validation e a

Can be used like:

validatePassword = validateAll
    [ validateEmptyPassword
    , validateShortPassword
    ]

@vrom911 vrom911 self-assigned this May 5, 2020
vrom911 added a commit that referenced this issue May 5, 2020
chshersh pushed a commit that referenced this issue May 5, 2020
* [#24] Extra interface functions

Resolves #24

* Rename vars

* Add hs-boot for Validation to break cyclic deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants