Use instances to simplify printing code
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ open import Data.Empty using (⊥-elim)
|
||||
open import Data.Product using (_,_)
|
||||
open import Data.Nat using (_≤_; ℕ; z≤n; s≤s; suc)
|
||||
open import Function using (_∘_)
|
||||
open import Showable using (Showable; show)
|
||||
open import Relation.Binary.PropositionalEquality as Eq
|
||||
using (_≡_; sym; subst; refl)
|
||||
|
||||
@@ -24,6 +25,16 @@ data AboveBelow : Set a where
|
||||
⊤ : AboveBelow
|
||||
[_] : A → AboveBelow
|
||||
|
||||
instance
|
||||
showable : {{ showableA : Showable A }} → Showable AboveBelow
|
||||
showable = record
|
||||
{ show = (λ
|
||||
{ ⊥ → "⊥"
|
||||
; ⊤ → "⊤"
|
||||
; [ a ] → show a
|
||||
})
|
||||
}
|
||||
|
||||
data _≈_ : AboveBelow → AboveBelow → Set a where
|
||||
≈-⊥-⊥ : ⊥ ≈ ⊥
|
||||
≈-⊤-⊤ : ⊤ ≈ ⊤
|
||||
|
||||
Reference in New Issue
Block a user