-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEqType.agda
41 lines (32 loc) · 919 Bytes
/
EqType.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
open import Relation.Binary.PropositionalEquality
open import Data.Unit.Base
open import Data.Bool.Base
open import Data.Nat.Base
open import Data.List.Base
infix 5 _==ᵗ_ _==ᵀ_
data Type : Set where
unit : Type
bool : Type
nat : Type
list : Type -> Type
⟦_⟧ : Type -> Set
⟦ unit ⟧ = ⊤
⟦ bool ⟧ = Bool
⟦ nat ⟧ = ℕ
⟦ list a ⟧ = List ⟦ a ⟧
_==ᵗ_ : Type -> Type -> Bool
unit ==ᵗ unit = true
bool ==ᵗ bool = true
nat ==ᵗ nat = true
list a ==ᵗ list b = a ==ᵗ b
_ ==ᵗ _ = false
data Code : Set -> Set where
instance code : ∀ a -> Code ⟦ a ⟧
_==ᵀ_ : ∀ A B {{_ : Code A}} {{_ : Code B}} -> Bool
_==ᵀ_ _ _ {{code a}} {{code b}} = a ==ᵗ b
test-bool : Bool ==ᵀ Bool ≡ true
test-bool = refl
test-list : List ℕ ==ᵀ List ℕ ≡ true
test-list = refl
test-unit-bool : ⊤ ==ᵀ Bool ≡ false
test-unit-bool = refl