haskell / haskell/haskell-language-server

Kinds of type variables, inferred kinds of all types

Open
#3,099 1 comment 0 reactions 0 assignees View on GitHub
GHC status: blocked type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

When hovering over types haskell-language-server gives you its kind, but this doesn't work for type variables
```Haskell
import Data.Kind (Type)
data X a = X
f :: forall a b . a -> X b
f v = X
```
For the term variable ``v`` I get ``v :: a``, for the type level ``X`` I get ``forall {k} . k -> Type``, but I only get the "defined at ..." for the type variables ``a`` and ``b``. Similarly but maybe a separate issue - for uses of polymorphic types I also get the applied, more specific type at the use site, but this doesn't happen for types with polymorphic kinds.
```Haskell
import Data.Kind (Type)
type X :: forall k . k -> Type
data X a = X
f :: (forall (x :: Type) . X x -> b) -> X {- @Type -} () -> b
f h = h {- @() -}
```
If I hover the use of h (not the pattern binding it) it tells me both ``h :: forall x. X x -> b`` and ``_ :: X () -> b``, but if I hover X in X () I only get ``X :: forall k. k -> Type``, no ``_ :: Type -> Type``.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.