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

Should not use labelled functions #4

Open
pbiggar opened this issue Oct 11, 2022 · 2 comments
Open

Should not use labelled functions #4

pbiggar opened this issue Oct 11, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@pbiggar
Copy link
Member

pbiggar commented Oct 11, 2022

As that is not idiomatic. It should instead by t-first (eg the List goes in the first position in functions in the List module)

@pbiggar pbiggar added the help wanted Extra attention is needed label Oct 11, 2022
@pbiggar
Copy link
Member Author

pbiggar commented Oct 13, 2022

Or maybe it should have a parallel set of modules that you can import that use labels. Simplest thing for now is no labels; we can always rescue the labels from the git history in the future

@pbiggar pbiggar transferred this issue from darklang/tablecloth Oct 13, 2022
@pbiggar pbiggar changed the title Rescript should not use labelled functions Should not use labelled functions Oct 18, 2022
@pbiggar pbiggar added good first issue Good for newcomers and removed help wanted Extra attention is needed labels Oct 18, 2022
@pbiggar
Copy link
Member Author

pbiggar commented Nov 2, 2022

So this involves changing all the functions and tests so that the t goes in first place, removing labels

Eg:

let myFunc = (~count: int, ~sep:string, v: t)

would become

let myFunc = (v: t, count: int, sep:string)

The one exception is where there are multiple values of the same type:

let add = (a : int, b : int)

should become:

let add (a : int, ~addend:int)

to ensure they can't be accidentally misused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant