Description
Is your enhancement request related to a problem? Please describe.
Regularly, I'm using the hover command to look at the type of an identifier, class, ...
For function, I do get a lot of useful information, such as the type of the function, the resolved type, as well as precedence (if defined), for example, with the following code:
data Test a = A | B a | C
fiz :: Test a -> Test a
fiz x = x
infixr 7 `fiz`
g = fiz (B True)
I get this informations in hover on fiz
call:
fiz :: forall a. Test a -> Test a
───────────────────────────────────────
*Defined at /home/guillaume/Foo.hs:5:1*
* * *
_ :: Test Bool -> Test Bool
───────────────────────────────────────
* * *
infixr 7 `fiz`
However, for type and class, I have not much information, except the documentation and kind, e.g:
For hover on the type Test
:
Test :: * -> *
───────────────────────────────────────
*Defined at /home/guillaume/Foo.hs:2:1*
For hover on the constructor B
:
B :: forall a. a %1 -> Test a
────────────────────────────────────────
*Defined at /home/guillaume/Foo.hs:2:19*
* * *
_ :: Bool -> Test Bool
And for hover on the Functor
class:
Functor :: (* -> *) -> Constraint
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
*Defined in ‘GHC.Base’* *(base-4.15.1.0)*
A type `f` is a Functor if it provides a function `fmap` which, given any types `a` and `b`
lets you apply any function from `(a -> b)` to turn an `f a` into an `f b` , preserving the
structure of `f` . Furthermore `f` needs to adhere to the following:
+ **Identity**: `fmap id == id`
+ **Composition**: `fmap (f . g) == fmap f . fmap g`
Note, that the second law follows from the free theorem of the type `fmap` and
the first law, so you need only check that the former condition holds.
[Documentation](file:///nix/store/5qyjmd1c52bzhbyxcy3kll5hi4zlwbnm-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/GHC-Base.html#t:Functor)
[Source](file:///nix/store/5qyjmd1c52bzhbyxcy3kll5hi4zlwbnm-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src/GHC.Base.html#Functor)
I would like more information.
Describe the solution you'd like
For type: having the listing of the different constructors.
For constructor: the listing of the other constructors may be interesting.
For class: the listing of the different method,s with the minimal required implementation.
Describe alternatives you've considered
Right now my alternative is to open the documentation manually and look for the informations I care about.