lean4-htt/tests/lean/run/PProd_syntax.lean
Joachim Breitner 95b8095fa6
feat: PProd syntax (part 3) (#4756)
reworks #4730 based on feedback from @kmill:

 * Uses `×'` for PProd
 * No syntax for MProd for now
 * Angle brackets (without nesting) for the values
2024-07-16 21:06:04 +00:00

46 lines
1.2 KiB
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.

/-- info: Bool ×' Nat ×' List Unit : Type -/
#guard_msgs in
#check Bool ×' Nat ×' List Unit
/-- info: Bool ×' Nat ×' List Unit : Type -/
#guard_msgs in
#check PProd Bool (PProd Nat (List Unit))
/-- info: (Bool ×' Nat) ×' List Unit : Type -/
#guard_msgs in
#check PProd (PProd Bool Nat) (List Unit)
/-- info: PUnit.{u} : Sort u -/
#guard_msgs in
#check PUnit
/-- info: ⟨true, 5, [()]⟩ : Bool ×' Nat ×' List Unit -/
#guard_msgs in
#check (⟨true, 5, [()]⟩ : Bool ×' Nat ×' List Unit)
/-- info: ⟨true, 5, [()]⟩ : MProd Bool (MProd Nat (List Unit)) -/
#guard_msgs in
#check (⟨true, 5, [()]⟩ : MProd Bool (MProd Nat (List Unit)))
/-- info: ⟨true, 5, [()]⟩ : Bool ×' Nat ×' List Unit -/
#guard_msgs in
#check PProd.mk true (PProd.mk 5 [()])
/-- info: ⟨true, 5, [()]⟩ : MProd Bool (MProd Nat (List Unit)) -/
#guard_msgs in
#check MProd.mk true (MProd.mk 5 [()])
/-- info: PUnit.unit.{u} : PUnit -/
#guard_msgs in
#check PUnit.unit
-- check that only `PProd` is flattened, not other structure
@[pp_using_anonymous_constructor]
structure TwoNats where
firstNat : Nat
secondNat : Nat
/-- info: ⟨true, 5, ⟨23, 42⟩⟩ : Bool ×' Nat ×' TwoNats -/
#guard_msgs in
#check PProd.mk true (PProd.mk 5 (TwoNats.mk 23 42))