@@ -149,8 +149,8 @@ simplifies proofs that use maps.
149
149
We build partial maps in two steps. First, we define a type of _total maps_ that
150
150
return a default value when we look up a key that is not present in the map.
151
151
152
- > total_map : Type -> Type
153
- > total_map a = Id -> a
152
+ > TotalMap : Type -> Type
153
+ > TotalMap a = Id -> a
154
154
>
155
155
156
156
Intuitively , a total map over an element type \ idr{a} is just a function that
@@ -159,7 +159,7 @@ can be used to look up \idr{Id}s, yielding \idr{a}s.
159
159
The function \ idr{t_empty} yields an empty total map , given a default element;
160
160
this map always returns the default element when applied to any id .
161
161
162
- > t_empty : (v : a) -> total_map a
162
+ > t_empty : (v : a) -> TotalMap a
163
163
> t_empty v = \ _ => v
164
164
>
165
165
@@ -173,7 +173,7 @@ More interesting is the \idr{update} function, which (as before) takes a map
173
173
\ idr{m}, a key \ idr{x}, and a value \ idr{v} and returns a new map that takes
174
174
\ idr{x} to \ idr{v} and takes every other key to whatever \ idr{m} does.
175
175
176
- > t_update : (x : Id) -> (v : a) -> (m : total_map a) -> total_map a
176
+ > t_update : (x : Id) -> (v : a) -> (m : TotalMap a) -> TotalMap a
177
177
> t_update x v m = \ x' => if beq_id x x' then v else m x'
178
178
>
179
179
@@ -187,7 +187,7 @@ this:
187
187
188
188
\ todo[inline]{Seems like a wrong description in the book here}
189
189
190
- > examplemap : total_map Bool
190
+ > examplemap : TotalMap Bool
191
191
> examplemap = t_update (MkId " foo" ) False $
192
192
> t_update (MkId " bar" ) True $
193
193
> t_empty False
@@ -329,7 +329,7 @@ elements of type \idr{a} is simply a total map with elements of type \idr{Maybe
329
329
a} and default element \ idr{Nothing }.
330
330
331
331
> partial_map : Type -> Type
332
- > partial_map a = total_map (Maybe a)
332
+ > partial_map a = TotalMap (Maybe a)
333
333
>
334
334
> empty : partial_map a
335
335
> empty = t_empty Nothing
0 commit comments