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 {let+,and+} applicative syntax #776

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

craigfe
Copy link
Contributor

@craigfe craigfe commented Apr 22, 2020

A follow up to #775 proposing Syntax.(( let+ ), ( and+ )) operators for the Lwt and Lwt_result modules.

When working with Lwt, I find myself using >|= often enough that a switch to open Lwt.Syntax would be frustrating without an equivalent syntactic form. As a sample from the mirage/irmin codebase:

ᐅ git grep ">>=" | wc -l
1480

ᐅ git grep ">|=" | wc -l
347

The proposed ( and+ ) operations behave the same as ( and* ): I find it convenient / aesthetic to use the corresponding and<op> for whichever let<op> I'm using. We've been using similar aliases in OCurrent syntax.

src/core/lwt.mli Outdated Show resolved Hide resolved
@aantron
Copy link
Collaborator

aantron commented Apr 22, 2020

Thanks! I'll merge this tomorrow and release 5.3.0 with it.

@aantron aantron merged commit d7fabaa into ocsigen:master Apr 23, 2020
aantron added a commit that referenced this pull request Apr 23, 2020
@aantron
Copy link
Collaborator

aantron commented Apr 24, 2020

This is now out in Lwt 5.3.0.

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

Successfully merging this pull request may close these issues.

2 participants