Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Issues with outcome printer and arity0 #512

Merged
merged 2 commits into from
May 31, 2022
Merged

Issues with outcome printer and arity0 #512

merged 2 commits into from
May 31, 2022

Conversation

cristianoc
Copy link
Contributor

Added a couple of examples.

Added a couple of examples.
@@ -179,6 +179,8 @@ module Js: {
}
type arity0 = (.) => unit
type arity0b = (.) => int
type arity0c = Js.Fn.arity0<Js.Fn.arity0<array<int>>>
type arity0d = (. unit) => unit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be something like (. unit) => unit => unit
which btw is not currently possible anyway as it would currently format to (. unit, unit) => unit which is arity 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure currently there's even a syntax that can express the intended type: uncurried function that returns a curried function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly related rescript-lang/rescript#5395
so there might be something wrong already in the compiler when dealing with this case.
That, or there's something wrong just in error reporting (still in the compiler).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the patch this is now (.) => unit => unit which is still not quite rights as it currently means (. unit, unit) => unit after formatting.
But that's a bigger change for another PR.

@cristianoc cristianoc merged commit b42a8ed into master May 31, 2022
@cristianoc cristianoc deleted the arity0 branch June 1, 2022 23:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant