diff options
author | Helmut Grohne <grohne@cs.uni-bonn.de> | 2014-02-07 18:32:54 +0100 |
---|---|---|
committer | Helmut Grohne <grohne@cs.uni-bonn.de> | 2014-02-07 18:32:54 +0100 |
commit | c9ddcf0abbb2e82eafc6dc24872244374c4f43c2 (patch) | |
tree | 5b43684abd33d60586a5e2827684d51026b9611b | |
parent | 95609983219f14e8f4c0758cd0688b984d8b1455 (diff) | |
download | bidiragda-c9ddcf0abbb2e82eafc6dc24872244374c4f43c2.tar.gz |
replace rewrite with cong where feasible
-rw-r--r-- | Bidir.agda | 4 | ||||
-rw-r--r-- | Generic.agda | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -176,8 +176,8 @@ lemma->>=-just (just a) p = a , refl lemma->>=-just nothing () lemma-just-sequence : {A : Set} {n : ℕ} → (v : Vec A n) → sequenceV (map just v) ≡ just v -lemma-just-sequence [] = refl -lemma-just-sequence (x ∷ xs) rewrite lemma-just-sequence xs = refl +lemma-just-sequence [] = refl +lemma-just-sequence (x ∷ xs) = cong (_<$>_ (_∷_ x)) (lemma-just-sequence xs) lemma-mapM-successful : {A B : Set} {f : A → Maybe B} {n : ℕ} → (v : Vec A n) → {r : Vec B n} → mapMV f v ≡ just r → ∃ λ w → map f v ≡ map just w lemma-mapM-successful [] p = [] , refl diff --git a/Generic.agda b/Generic.agda index 748a49a..b1ab8dd 100644 --- a/Generic.agda +++ b/Generic.agda @@ -37,8 +37,8 @@ mapMV-cong f≗g (x ∷V xs) | just y | .(just y) | refl = cong (_<$>_ (_∷V_ y mapMV-cong f≗g (x ∷V xs) | nothing | .nothing | refl = refl mapMV-purity : {A B : Set} {n : ℕ} → (f : A → B) → (v : Vec A n) → mapMV (Maybe.just ∘ f) v ≡ just (map f v) -mapMV-purity f []V = refl -mapMV-purity f (x ∷V xs) rewrite mapMV-purity f xs = refl +mapMV-purity f []V = refl +mapMV-purity f (x ∷V xs) = cong (_<$>_ (_∷V_ (f x))) (mapMV-purity f xs) maybeEq-from-≡ : {A : Set} {a b : Maybe A} → a ≡ b → MaybeEq (PropEq A) ∋ a ≈ b maybeEq-from-≡ {a = just x} {b = .(just x)} refl = just refl |