Skip to content

Provide newtype wrappers for new number types of lsp spec 3.16 #354

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

Closed
jneira opened this issue Sep 9, 2021 · 0 comments · Fixed by #366
Closed

Provide newtype wrappers for new number types of lsp spec 3.16 #354

jneira opened this issue Sep 9, 2021 · 0 comments · Fixed by #366

Comments

@jneira
Copy link
Member

jneira commented Sep 9, 2021

From #134 (comment) by @pranaysashank (thanks!)

Since 3.16, there are new number types https://microsoft.github.io/language-server-protocol/specifications/specification-current/#number . We may want to provide newtype wrappers for them as using Int may lead to subtle bugs like haskell/haskell-language-server#2169

michaelpj added a commit to michaelpj/lsp that referenced this issue Nov 6, 2021
This ensures that we use either:
- `Int32`
- `Word32`
- `Float`

In particular, this gets us:
- Appropriate `Bounded` instances (see the original issue
haskell/haskell-language-server#2169).
- More picky `aeson` instances for the bounded types.

Rather than use newtypes, we just use the existing appropriate Haskell
numeric types for bounded integers.

Fixes haskell#354.
michaelpj added a commit that referenced this issue Nov 7, 2021
This ensures that we use either:
- `Int32`
- `Word32`
- `Float`

In particular, this gets us:
- Appropriate `Bounded` instances (see the original issue
haskell/haskell-language-server#2169).
- More picky `aeson` instances for the bounded types.

Rather than use newtypes, we just use the existing appropriate Haskell
numeric types for bounded integers.

Fixes #354.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant