blob: f5df01fd5e43949f22d8ea6795cfeea07c4c32dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import Control.Monad
import GHC.Compact
import qualified Data.Map as Map
main = do
let m = Map.fromList [(x,show x) | x <- [1..(10000::Int)]]
c <- compactWithSharing m
print =<< compactSize c
c <- foldM (\c _ -> do c <- compactWithSharing (getCompact c)
print =<< compactSize c
return c) c [1..10]
print (length (show (getCompact c)))
print =<< compactSize c
|