Changeset 761 for src/common/Identifiers.ma
- Timestamp:
- Apr 19, 2011, 12:22:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/common/Identifiers.ma
r757 r761 70 70 (match m with [ an_id_map m' ⇒ m' ]). 71 71 72 (* Always adds the identifier to the map. *) 72 73 definition add : ∀tag,A. identifier_map tag A → identifier tag → A → identifier_map tag A ≝ 73 74 λtag,A,m,l,a. an_id_map tag A (insert A 16 (match l with [ an_identifier l' ⇒ l' ]) a 74 75 (match m with [ an_id_map m' ⇒ m' ])). 75 76 77 (* Only updates an existing entry; fails with an error otherwise. *) 78 definition update : ∀tag,A. identifier_map tag A → identifier tag → A → res (identifier_map tag A) ≝ 79 λtag,A,m,l,a. 80 match update A 16 (match l with [ an_identifier l' ⇒ l' ]) a 81 (match m with [ an_id_map m' ⇒ m' ]) with 82 [ None ⇒ Error ? (* missing identifier *) 83 | Some m' ⇒ OK ? (an_id_map tag A m') 84 ]. 76 85
Note: See TracChangeset
for help on using the changeset viewer.