modern-compiler-ml/tiger/chap4/table.sml
jmug 33d8bac511 Add the tiger source code bundle from the book site
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2024-12-18 15:18:45 -08:00

9 lines
271 B
Standard ML

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