File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,9 @@ is-true true = ⊤
8181is-true false = ⊥
8282
8383record So (b : Bool) : Type where
84+ constructor evidently
8485 field
85- is-so : is-true b
86+ .{ is-so} : is-true b
8687
8788pattern oh = record { is-so = tt }
8889```
@@ -104,7 +105,7 @@ instance
104105 H-Level-So : ∀ {x n} → H-Level (So x) (suc n)
105106 H-Level-So {false} = prop-instance λ ()
106107 H-Level-So {true} = prop-instance λ where
107- oh oh → refl
108+ _ _ → refl
108109
109110 Dec-So : ∀ {x} → Dec (So x)
110111 Dec-So = oh? _
Original file line number Diff line number Diff line change @@ -348,11 +348,8 @@ _!?_ : List A → Nat → Maybe A
348348
349349-- Make sure that all of the actual computation is guarded behind irrelevance to make this zero cost
350350!?-just : ∀ (xs : List A) (n : Nat) → .(n Nat.< length xs) → is-just (xs !? n)
351- !?-just {A = a} xs n n<xs = erase (worker xs n n<xs)
352- where
353- worker : ∀ (xs : List A) (n : Nat) → n Nat.< length xs → is-true (is-just? (xs !? n))
354- worker (x ∷ xs) zero n<xs = tt
355- worker (x ∷ xs) (suc n) n<xs = worker xs n (Nat.≤-peel n<xs)
351+ !?-just {A = a} (x ∷ xs) zero n<xs = just-because evidently
352+ !?-just {A = a} (x ∷ xs) (suc n) n<xs = !?-just xs n (Nat.≤-peel n<xs)
356353
357354_!_ : (l : List A) → Fin (length l) → A
358355xs ! (fin n ⦃ forget pf ⦄) = from-just! _ $ !?-just xs n pf
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ is-just? nothing = false
8989is-just? (just _) = true
9090
9191record is-just (m : Maybe A) : Type where
92- constructor erase
92+ constructor just-because
9393 field
94- . witness : is-true (is-just? m)
94+ witness : So (is-just? m)
9595
9696
9797from-just! : ∀ x → is-just x → A
You can’t perform that action at this time.
0 commit comments