Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /smlnj-lib/trunk/HashCons/hash-cons-map.sml
ViewVC logotype

Diff of /smlnj-lib/trunk/HashCons/hash-cons-map.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6165, Sun Apr 12 16:54:38 2020 UTC revision 6166, Sun Apr 12 16:54:57 2020 UTC
# Line 22  Line 22 
22      fun lift2i f (_, (k, a), (_, b)) = f(k, a, b)      fun lift2i f (_, (k, a), (_, b)) = f(k, a, b)
23    
24      val empty = Map.empty      val empty = Map.empty
     val isEmpty = Map.isEmpty  
25      fun singleton (obj, v) = Map.singleton (HC.tag obj, (obj, v))      fun singleton (obj, v) = Map.singleton (HC.tag obj, (obj, v))
26      fun insert (m, obj, v) = Map.insert(m, HC.tag obj, (obj, v))      fun insert (m, obj, v) = Map.insert(m, HC.tag obj, (obj, v))
27      fun insert' (p as (obj, v), m) = Map.insert(m, HC.tag obj, p)      fun insert' (p as (obj, v), m) = Map.insert(m, HC.tag obj, p)
# Line 52  Line 51 
51            in            in
52              (map, v)              (map, v)
53            end            end
54      fun first (map : ('a, 'b) map) = Option.map #2 (Map.first map)      val isEmpty = Map.isEmpty
     val firsti = Map.first  
55      val numItems = Map.numItems      val numItems = Map.numItems
56      fun listItems map = Map.foldr (fn ((_, v), vs) => v::vs) [] map      fun listItems map = Map.foldr (fn ((_, v), vs) => v::vs) [] map
57      val listItemsi = Map.listItems      val listItemsi = Map.listItems

Legend:
Removed from v.6165  
changed lines
  Added in v.6166

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0