From 0efd90e5f01996ceb01f5a2889f9e2986322c371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 2 Aug 2026 22:22:15 +0200 Subject: Fix state consistency in MonadHead instaces --- src/Erebos/State.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Erebos/State.hs') diff --git a/src/Erebos/State.hs b/src/Erebos/State.hs index fa58118..0f0adbe 100644 --- a/src/Erebos/State.hs +++ b/src/Erebos/State.hs @@ -120,7 +120,7 @@ updateLocalHead_ f = updateLocalHead (fmap (,()) . f) instance (HeadType a, MonadIO m) => MonadHead a (ReaderT (Head a) m) where updateLocalHead f = do h <- ask - snd <$> updateHead h f + snd <$> updateHead' h (\h' -> local (const h') (f $ headStoredObject h')) newtype LocalHeadT h m a = LocalHeadT { runLocalHeadT :: Storage -> Stored h -> m ( a, Stored h ) } -- cgit v1.2.3