module UUID where
import Control.Monad.State
type UUID = Int
next :: State UUID ()
next :: State UUID ()
next = do
UUID
num <- StateT UUID Identity UUID
forall s (m :: * -> *). MonadState s m => m s
get
UUID -> State UUID ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put (UUID
num UUID -> UUID -> UUID
forall a. Num a => a -> a -> a
+ 1)
() -> State UUID ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
toInt :: UUID -> Int
toInt :: UUID -> UUID
toInt = UUID -> UUID
forall a. a -> a
id