Files
newt/tests/TestMap.newt
Steve Dunham e3ae301c9c performance and code size improvements
- Use default case for constructors with no explicit match.
- self-compile is 15s now
- code size is 60% smaller

code size and self compile time on par with the idris-built version
2025-01-18 21:33:49 -08:00

23 lines
623 B
Agda

module TestMap
import Prelude
import SortedMap
main : IO Unit
main = do
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
debugLog $ toList m
debugLog $ leftMost m
debugLog $ rightMost m
_ <- for x $ \ n => do
putStrLn $ "ohne " ++ show n
-- debugLog $ m
debugLog $ map fst $ toList $ deleteMap n m
putStrLn ""