Remove the Unique library, which is no longer in use
This commit is contained in:
parent
42fb11eabd
commit
545e51c611
1 changed files with 0 additions and 19 deletions
|
@ -1,19 +0,0 @@
|
|||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
module Unique (guid, set, run, runAt, Unique) where
|
||||
|
||||
import Control.Monad.State (evalState, State, get, put)
|
||||
|
||||
-- Wrapper around State monad.
|
||||
newtype Unique a = U { runU :: State Int a }
|
||||
deriving (Monad)
|
||||
|
||||
-- Get the next GUID, incrementing the counter.
|
||||
guid :: Unique Int
|
||||
guid = U $ do n <- get
|
||||
put (n + 1)
|
||||
return n
|
||||
|
||||
set n = U (put n)
|
||||
|
||||
run = runAt 0
|
||||
runAt n x = evalState (runU x) n
|
Loading…
Reference in a new issue