Skip to content

Commit 306d2ea

Browse files
committed
Make _⟨⟩ the constructor of ∃ so it can be used in patterns
1 parent 13db471 commit 306d2ea

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/base/Haskell/Extra/Refinement.agda

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ private variable
77
ℓ ℓ′ : Level
88

99
record (a : Type ℓ) (@0 P : a Type ℓ′) : Type (ℓ ⊔ ℓ′) where
10-
constructor _⟨_
10+
constructor _⟨⟩
1111
field
1212
value : a
13-
@0 proof : P value
13+
@0 {{proof}} : P value
1414
open public
1515
{-# COMPILE AGDA2HS ∃ unboxed #-}
1616

17-
_⟨⟩ : {@0 P : a Type ℓ} (x : a) @0 {{P x}} ∃ a P
18-
(x ⟨⟩) {{p}} = x ⟨ p ⟩
19-
20-
{-# COMPILE AGDA2HS _⟨⟩ inline #-}
17+
pattern _⟨_⟩ x p = (x ⟨⟩) {{p}}
2118

2219
mapRefine : {@0 P Q : a Type ℓ} (@0 f : {x} P x Q x) ∃ a P ∃ a Q
2320
mapRefine f (x ⟨ p ⟩) = x ⟨ f p ⟩

0 commit comments

Comments
 (0)