Skip to content

Instantly share code, notes, and snippets.

@rblaze
Created March 29, 2012 09:43
Show Gist options
  • Save rblaze/2235457 to your computer and use it in GitHub Desktop.
Save rblaze/2235457 to your computer and use it in GitHub Desktop.
type JSlice = JudyL Int
type JAll = JudyL JSlice
jinsert :: Word64 -> Int-> JAll -> IO ()
jinsert hv src ht = do
sl <- slice
insert keyl src sl
where
(keyh, keyl) = hilo hv
slice = do
found <- J.member keyh ht
unless found $ do
s <- new
J.insert keyh s ht
s <- J.lookup keyh ht
return (fromJust s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment