Skip to content

Enhancement: Kind of type parameter on hover #19

Description

@langston-barrett

Could the code viewer perhaps show the inferred kind of a type parameter on hover, perhaps with a similar UI to type-on-hover? e.g. it might show Type or * when hovering over a in the following declaration (on either the LHS or RHS):

newtype Foo a = MkFoo a

Activity

  1. self-assigned this
    on Jan 23, 2019
  2. alexwl commented on Jan 23, 2019

    @alexwl
    Owner

    HCE does show kinds of type variables, but unfortunately, not always.

    For example, here https://haskell-code-explorer.mfix.io/package/base-4.11.1.0/show/Data/Functor/Sum.hs#L33 kinds of type variables are shown:

    data Sum f g a = InL (f a) | InR (g a)
    f :: k -> *
    g :: k -> *
    a :: k

    haskell-code-indexer gets kinds of type constructors and type variables from the type environment (a map from Name to TyThing created by the GHC) of a module. Type constructors are always in the type environment, type variables, however, sometimes are omitted from the type environment. As far as I understand, it depends on whether the value constructor, e.g., MkFoo, is used (not just declared) somewhere in the current module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions