reasonml / reasonml/reason

Processing of `;%lwt`

Open
#2,355 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

I've stumbled across Lwt documentation which states the following:

With OCaml 4.04.0 and on a convenient syntax is available for sequencing Lwt operations using ;%lwt. This allows free mixing of standard ; sequencing and ;%lwt sequencing without extra parentheses

I've tired it, it did not work with Lwt as I expected, I've started an issue on that in Lwt repo and got the following input (by @hcarty):

Reason doesn't have proper ;%lwt support in its parser, so it ends up mis-applied to the surrounding code. So while ;%lwt works properly in OCaml code, it doesn't do what you'd expect in Reason.

Looks like this was not reported previously, hence this feature request issue. Is it possible to introduce proper support for monadic semicolons? Current behaviour when it seemingly works but does the wrong thing is quite counter-intuitive :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported ;%lwt behavior in the Reason parser and compare it with the documented OCaml behavior and the linked Lwt issue. No source file or test is named in the report, so the work is to determine the parser entry point, define correct monadic-semicolon behavior, and verify that surrounding sequencing is no longer mis-applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.