blob: 727f488eb37143fb69010ba8f11f1665e2d6286c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import Data.HashTable
import qualified Data.HashTable as HT
test :: Int -> IO ()
test n = do ht <- new (==) hashInt
sequence_ [ insert ht key 0 | key <- [0..n]]
sequence_ [ insert ht key 1 | key <- [0..n]]
let check key = do (Just val) <- HT.lookup ht key
if val==1 then return () else putStrLn $ show key
sequence_ [ check key | key <- [0..n]]
main = test 2048
|