Skip to content

Commit

Permalink
rangelab: Replaced int table table with unit table.
Browse files Browse the repository at this point in the history
Use unit table as ordered set.
  • Loading branch information
EAirPeter committed Feb 15, 2017
1 parent 111465f commit 59c099d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw8-rangelab/MkRangeCount.sml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ struct
val compareKey : (Key.t * Key.t) -> order = Key.compare

(* Define this yourself *)
type countTable = int table table
type countTable = unit table table

fun makeCountTable (S : point seq) : countTable = let
val sqSorted = Seq.sort (fn (p1, p2) => compareKey (#1 p1, #1 p2)) S
val (sqMapsTmp, mLast) = Seq.iterh
(fn (m, p) => OrdTable.insert #1 (#2 p, 1) m)
(fn (m, p) => OrdTable.insert #1 (#2 p, ()) m)
(OrdTable.empty ())
sqSorted
val sqMaps =
Expand Down

0 comments on commit 59c099d

Please sign in to comment.