modern-compiler-ml/tiger/chap4/table.sml

10 lines
271 B
Standard ML
Raw Normal View History

functor IntMapTable (type key
val getInt: key -> int) : TABLE =
struct
type key=key
type 'a table = 'a IntBinaryMap.map
val empty = IntBinaryMap.empty
fun enter(t,k,a) = IntBinaryMap.insert(t,getInt k,a)
fun look(t,k) = IntBinaryMap.find(t,getInt k)
end