From f639060d7c438a3c7e3988b4446c60ab05e42fc1 Mon Sep 17 00:00:00 2001 From: wadler Date: Tue, 20 Jun 2017 19:57:05 +0100 Subject: [PATCH] restored MapsOld for purposes of comparison --- src/Maps.lagda | 15 +- src/MapsOld.lagda | 340 ++++++++++++++++++++++++++++++++++++++++++++++ src/Stlc.lagda | 6 +- 3 files changed, 350 insertions(+), 11 deletions(-) create mode 100644 src/MapsOld.lagda diff --git a/src/Maps.lagda b/src/Maps.lagda index 1cefbdc5..b0f1afd9 100644 --- a/src/Maps.lagda +++ b/src/Maps.lagda @@ -36,7 +36,7 @@ standard library, wherever they overlap. open import Data.Nat using (ℕ) open import Data.Empty using (⊥; ⊥-elim) open import Data.Maybe using (Maybe; just; nothing) -open import Data.String using (String) +-- open import Data.String using (String) open import Relation.Nullary using (¬_; Dec; yes; no) open import Relation.Binary.PropositionalEquality using (_≡_; refl; _≢_; trans; sym) @@ -54,7 +54,8 @@ we repeat its definition here. \begin{code} data Id : Set where - id : String → Id + -- id : String → Id + id : ℕ → Id \end{code} We recall a standard fact of logic. @@ -69,7 +70,7 @@ by deciding equality on the underlying strings. \begin{code} _≟_ : (x y : Id) → Dec (x ≡ y) -id x ≟ id y with x Data.String.≟ y +id x ≟ id y with x Data.Nat.≟ y -- x Data.String.≟ y id x ≟ id y | yes refl = yes refl id x ≟ id y | no x≢y = no (contrapositive id-inj x≢y) where @@ -81,9 +82,9 @@ We define some identifiers for future use. \begin{code} x y z : Id -x = id "x" -y = id "y" -z = id "z" +x = id 0 -- "x" +y = id 1 -- "y" +z = id 2 -- "z" \end{code} ## Total Maps @@ -288,7 +289,6 @@ updates.