Kind evaluation in HLS

I am curious if there’s a way to see the evaluation of a type family in the Haskell Language Server. For example, I have some type (details not important, just included for the sake of a concrete example)

type ThreeHalfLeft =
  Tensor SU2 (Tensor SU2 SpinHalf SpinHalf) SpinHalf

which I can evaluate in ghci by doing:

ghci> :k! ThreeHalfLeft
ThreeHalfLeft :: [(Natural, Natural)]
= ['(1, 2), '(3, 1)]

This is great, but it would be really helpful if I could mouse-over the type in VSCode and directly see ['(1, 2), '(3, 1)]. Is that possible?

Btw, this is what I actually see when I mouse over.

I was thinking the eval plugin might be able to do it, but this does not work:

type Not :: Bool -> Bool
type family Not x where
  Not True = False
  Not False = True

-- >>> :k! Not True
-- unknown command 'k!'

I think extending the eval plugin to support this would be the easiest way to implement this feature.

Edit: as Andre notes below, it does work if you spell it out:

-- >>> :kind! Not True
-- Not True :: Bool
-- = 'False

The long form :kind! should work

Thanks both! This does indeed work, which is really cool!

That said, I think the mouse-over would be a really nice feature - instead of having to type out a comment and click evaluate, I could just hover over my type and just see what it reduces to. In general I find that mouse-over makes for a much more impressive demo of Haskell’s type inference than having to enter ghci.

At any rate, case closed.