Skip to content

Commit dfafabe

Browse files
committed
Maps: total_map -> TotalMap
1 parent 9ddc11f commit dfafabe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Maps.lidr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ simplifies proofs that use maps.
149149
We build partial maps in two steps. First, we define a type of _total maps_ that
150150
return a default value when we look up a key that is not present in the map.
151151

152-
> total_map : Type -> Type
153-
> total_map a = Id -> a
152+
> TotalMap : Type -> Type
153+
> TotalMap a = Id -> a
154154
>
155155

156156
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.
159159
The function \idr{t_empty} yields an empty total map, given a default element;
160160
this map always returns the default element when applied to any id.
161161

162-
> t_empty : (v : a) -> total_map a
162+
> t_empty : (v : a) -> TotalMap a
163163
> t_empty v = \_ => v
164164
>
165165

@@ -173,7 +173,7 @@ More interesting is the \idr{update} function, which (as before) takes a map
173173
\idr{m}, a key \idr{x}, and a value \idr{v} and returns a new map that takes
174174
\idr{x} to \idr{v} and takes every other key to whatever \idr{m} does.
175175

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
177177
> t_update x v m = \x' => if beq_id x x' then v else m x'
178178
>
179179

@@ -187,7 +187,7 @@ this:
187187

188188
\todo[inline]{Seems like a wrong description in the book here}
189189

190-
> examplemap : total_map Bool
190+
> examplemap : TotalMap Bool
191191
> examplemap = t_update (MkId "foo") False $
192192
> t_update (MkId "bar") True $
193193
> t_empty False
@@ -329,7 +329,7 @@ elements of type \idr{a} is simply a total map with elements of type \idr{Maybe
329329
a} and default element \idr{Nothing}.
330330

331331
> partial_map : Type -> Type
332-
> partial_map a = total_map (Maybe a)
332+
> partial_map a = TotalMap (Maybe a)
333333
>
334334
> empty : partial_map a
335335
> empty = t_empty Nothing

0 commit comments

Comments
 (0)