Skip to content

Conversation

@jamesdbrock
Copy link
Member

@jamesdbrock jamesdbrock commented Nov 9, 2022

Add “validation” functions.

#196


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@jamesdbrock jamesdbrock linked an issue Nov 9, 2022 that may be closed by this pull request
@jamesdbrock jamesdbrock marked this pull request as ready for review November 9, 2022 03:45
@jamesdbrock
Copy link
Member Author

Any advice @natefaubion ? Is this a good use of Lazy?

@jamesdbrock jamesdbrock force-pushed the liftmaybe branch 2 times, most recently from 719b6ef to 39e93f4 Compare November 9, 2022 04:25
@natefaubion
Copy link
Contributor

In general, I consider Lazy to be unnecessary unless you need to rely on memoization of work. Since you only want to defer an argument to potentially evaluate once in a conditional branch, I would use Unit -> a rather than Lazy a. Lazy has overhead in comparison to Unit -> a because it needs to allocate both a mutable reference box and a closure for the work.

@jamesdbrock
Copy link
Member Author

I would use Unit -> a rather than Lazy a

Thx I'll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

liftMaybe, liftEither, liftExceptT Implement Compactable and Filterable for ParserT?

3 participants