Zulip Chat Archive

Stream: lean4

Topic: Hover and `fun` type information


Damiano Testa (Aug 03 2023 at 10:56):

Dear All,

after seeing the thread about the parentheses, I thought that today might be a good day to ask another similar question.

In this code

import Mathlib.Tactic.RunCmd

open Lean in
run_cmd do  -- prints `fun IamANat ↦ Bool`, hovering on `IamANat` shows `fun IamANat ↦ Bool : ℕ → Type`
  logInfo <| Expr.lam `IamANat (Expr.const ``Nat []) (Expr.const ``Bool []) .default

hovering in the infoview above the IamANat displays fun IamANat ↦ Bool : ℕ → Type. I would have expected to see . Should I change my expectations?

Thanks!

Damiano Testa (Aug 03 2023 at 11:08):

(Maybe I should have mentioned that I am using VSCode.)

Wojciech Nawrocki (Aug 03 2023 at 23:00):

This is a bug in the delaborator (I think), try hovering over the binder in #check (λ (x : Nat) => x).

Damiano Testa (Aug 04 2023 at 01:20):

Wojciech, that's a much more minimal example, thanks!

Indeed, hovering on the x in fun x displays the whole function fun x ↦ x : ℕ → ℕ, while hovering on the second x just shows .


Last updated: Dec 20 2023 at 11:08 UTC