diff options
Diffstat (limited to 'src/Erebos/State.hs')
-rw-r--r-- | src/Erebos/State.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Erebos/State.hs b/src/Erebos/State.hs index 1f0bf7d..324127a 100644 --- a/src/Erebos/State.hs +++ b/src/Erebos/State.hs @@ -86,6 +86,8 @@ instance SharedType (Maybe ComposedIdentity) where class (MonadIO m, MonadStorage m) => MonadHead a m where updateLocalHead :: (Stored a -> m (Stored a, b)) -> m b + getLocalHead :: m (Stored a) + getLocalHead = updateLocalHead $ \x -> return (x, x) updateLocalHead_ :: MonadHead a m => (Stored a -> m (Stored a)) -> m () updateLocalHead_ f = updateLocalHead (fmap (,()) . f) |