local @tag (const r') (throw MyException) `catch` \MyException -> ask @tagreturns r' instead of the previous value. Note, that no MonadIO instance is provided, as this would allow catching exceptions. See ReadState.
get @t >>= \s1 -> get @t >>= \s2 -> pure (s1, s2) = get @t >>= \s -> pure (s, s)
get @t >>= \_ -> put @t s = put @t s
put @t s1 >> put @t s2 = put @t s2
put @t s >> get @t = put @t s >> pure s
state @t f = get @t >>= \s -> let (a, s') = f s in put @t s' >> pure a