diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-26 15:11:48 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-26 15:11:48 +0100 |
commit | a00234388d1b4e14481067d030bf90031258b756 (patch) | |
tree | 501b6778fc5779ce220aba1e22f56ae60f68d970 /src/Util | |
parent | 7971f6dff12bc7b66a5d4ae91a6791ac08872c31 (diff) |
D2[Array] now has a Maybe instead of zero-size for zero
Remaining problem: 'add' in Compile doesn't use the D2 stuff
Diffstat (limited to 'src/Util')
-rw-r--r-- | src/Util/IdGen.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Util/IdGen.hs b/src/Util/IdGen.hs index fcfb6e7..3f6611d 100644 --- a/src/Util/IdGen.hs +++ b/src/Util/IdGen.hs @@ -2,11 +2,12 @@ {-# 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) + deriving newtype (Functor, Applicative, Monad, MonadFix) genId :: IdGen Int genId = IdGen (state (\i -> (i, i + 1))) |