Zulip Chat Archive

Stream: new members

Topic: Whats the difference between _root_.Nat and Nat?


Felipe GS (Jun 15 2022 at 12:31):

-- type mismatch
--   x
-- has type
--   Nat : Type
-- but is expected to have type
--   _root_.Nat : Type

abbrev Dyn := ((α: Type) × α)

def matcher : Dyn  Nat
  | Nat, x => x
  | _        => 0

Yakov Pechersky (Jun 15 2022 at 12:42):

Your second nat is a variable name, not the constant Nat. In vscode, syntax highlighting would color them different. You can't match on Types like this AFAIK. Type equality is undecidable in general.


Last updated: Dec 20 2023 at 11:08 UTC