reasonml / reasonml/reason

Support annotations inside function definitions.

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

Nobody has claimed this yet.

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

Description

This is currently supported:

[@genType]
let renameABunch = ~pad =>
  [@genType.as "xRenamed"] (~x) => [@genType.as "yRenamed"] (~y) => pad+x+y;

and gets formatted to:

let renameABunch = ~pad =>
  [@genType.as "xRenamed"]
  ((~x) => [@genType.as "yRenamed"] ((~y) => pad + x + y));

Ideally, it could look like this:

[@genType]
let renameABunch = (~pad, [@genType.as "xRenamed"] ~x, [@genType.as "yRenamed"] ~y) => pad + x + y;

For more background: https://github.com/cristianoc/genType/issues/75.

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 comparing the current and desired formatting examples in this issue, then read the linked genType issue for background on the annotations. Identify the formatter entry point that handles function definitions and verify the change against examples containing annotations on parameters and nested functions; done means the desired form is produced without regressing the currently supported form.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.