lean4-htt/tests/lean/derive.lean
2017-09-14 18:48:18 +02:00

18 lines
440 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@[derive [decidable_eq, inhabited, has_reflect, has_sizeof]]
inductive foo (α β : Type*)
| bar : → foo
| baz : foo → α → foo
#check foo.decidable_eq
#check foo.inhabited
#check foo.has_reflect
#check foo.has_sizeof
-- indexed families
@[derive decidable_eq]
inductive {u} foo' (α β : Type u) (n : nat) : nat → Type u
| bar : → foo' 0
| baz (n : nat) : foo' n → α → foo' (nat.succ n)
#check foo'.decidable_eq