Skip to content

Instantly share code, notes, and snippets.

View symbiont-eric-torreborre's full-sized avatar
🏠
Working from home

Eric Torreborre symbiont-eric-torreborre

🏠
Working from home
View GitHub Profile
@symbiont-eric-torreborre
symbiont-eric-torreborre / concurrent-map.hs
Created December 4, 2020 07:32 — forked from Gabriella439/concurrent-map.hs
Low-tech concurrent hashmap
module ConcurrentMap where
import Control.Concurrent.STM.TVar (TVar)
import Control.Concurrent.STM (STM)
import Data.Hashable (Hashable)
import Data.HashMap.Strict (HashMap)
import Data.Vector (Vector)
import qualified Control.Concurrent.STM.TVar as TVar
import qualified Data.Hashable as Hashable
import qualified System.Console.Concurrent as Concurrent
trace :: [Char] -> a -> a
trace string expr =
unsafePerformIO $ do
traceIO string
return expr
traceIO :: [Char] -> IO ()
traceIO string = do