SortedMap uses any comparator

This commit is contained in:
2025-09-01 15:39:35 -07:00
parent 27d9250d34
commit 1432316fac
13 changed files with 139 additions and 123 deletions

1
tests/Data/SortedMap.newt Symbolic link
View File

@@ -0,0 +1 @@
../../src/Data/SortedMap.newt

View File

@@ -1 +0,0 @@
../newt/SortedMap.newt

View File

@@ -1,17 +1,17 @@
module TestMap
import Prelude
import SortedMap
import Data.SortedMap
main : IO Unit
main = do
let m = updateMap 2 0 EmptyMap
let m = updateMap 2 0 emptyMap
debugLog $ toList m
debugLog $ toList $ deleteMap 2 m
debugLog $ toList $ updateMap 2 3 m
debugLog $ toList $ updateMap 1 3 m
let x = 4 :: 1 :: 5 :: 7 :: 2 :: 9 :: 3 :: 10 :: 6 :: 0 :: 11 :: 12 :: 13 :: 20 :: 14 :: 16 :: 17 :: 8 :: Nil
let m = foldl (\ m x => updateMap x MkUnit m) EmptyMap x
let m = foldl (\ m x => updateMap x MkUnit m) emptyMap x
debugLog $ toList m
debugLog $ leftMost m
debugLog $ rightMost m