diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2025-11-10 21:49:45 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2025-11-10 21:50:25 +0100 |
| commit | 174af2ba568de66e0d890825b8bda930b8e7bb96 (patch) | |
| tree | 5a20f52662e87ff7cf6a6bef5db0713aa6c7884e /src/Util | |
| parent | 92bca235e3aaa287286b6af082d3fce585825a35 (diff) | |
Move module hierarchy under CHAD.
Diffstat (limited to 'src/Util')
| -rw-r--r-- | src/Util/IdGen.hs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/Util/IdGen.hs b/src/Util/IdGen.hs deleted file mode 100644 index 3f6611d..0000000 --- a/src/Util/IdGen.hs +++ /dev/null @@ -1,19 +0,0 @@ -{-# LANGUAGE DerivingStrategies #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -module Util.IdGen where - -import Control.Monad.Fix -import Control.Monad.Trans.State.Strict - - -newtype IdGen a = IdGen (State Int a) - deriving newtype (Functor, Applicative, Monad, MonadFix) - -genId :: IdGen Int -genId = IdGen (state (\i -> (i, i + 1))) - -runIdGen :: Int -> IdGen a -> a -runIdGen start (IdGen m) = evalState m start - -runIdGen' :: Int -> IdGen a -> (a, Int) -runIdGen' start (IdGen m) = runState m start |
