@@ -1,19 +0,0 @@
1−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2−module Unique (guid, set, run, runAt, Unique) where
4−import Control.Monad.State (evalState, State, get, put)
6−-- Wrapper around State monad.
7−newtype Unique a = U { runU :: State Int a }
10−-- Get the next GUID, incrementing the counter.
12−guid = U $ do n <- get
19−runAt n x = evalState (runU x) n