Use instances to simplify printing code
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -45,11 +45,17 @@ open import Function using (_∘_)
|
||||
open import Relation.Nullary using (¬_; Dec; yes; no)
|
||||
open import Utils using (Pairwise; _∷_; [])
|
||||
open import Data.Empty using (⊥-elim)
|
||||
open import Showable using (Showable; show)
|
||||
|
||||
module WithKeys (ks : List A) where
|
||||
FiniteMap : Set (a ⊔ℓ b)
|
||||
FiniteMap = Σ Map (λ m → Map.keys m ≡ ks)
|
||||
|
||||
instance
|
||||
showable : {{ showableA : Showable A }} {{ showableB : Showable B }} →
|
||||
Showable FiniteMap
|
||||
showable = record { show = λ (m₁ , _) → show m₁ }
|
||||
|
||||
_≈_ : FiniteMap → FiniteMap → Set (a ⊔ℓ b)
|
||||
_≈_ (m₁ , _) (m₂ , _) = m₁ ≈ᵐ m₂
|
||||
|
||||
|
||||
Reference in New Issue
Block a user