X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FInteraction.hs;h=1c2679cd9eee65d14c5bf70d0a0b623e3abbe616;hp=46e32a139a37d17b88b0dce43e05540dc0cbd79f;hb=cc55fb9;hpb=32a6ebbb18856ab1203e8a114414f235c2abe22b diff --git a/Network/HTTP/Lucu/Interaction.hs b/Network/HTTP/Lucu/Interaction.hs index 46e32a1..1c2679c 100644 --- a/Network/HTTP/Lucu/Interaction.hs +++ b/Network/HTTP/Lucu/Interaction.hs @@ -17,7 +17,6 @@ module Network.HTTP.Lucu.Interaction ) where import Blaze.ByteString.Builder (Builder) -import Control.Applicative import Control.Concurrent.STM import Data.Ascii (Ascii) import qualified Data.ByteString as BS @@ -168,13 +167,13 @@ writeItr ∷ (Interaction → TVar a) → a → Interaction → STM () writeItr accessor a itr = writeTVar (accessor itr) a -readItr ∷ (Interaction → TVar a) → (a → b) → Interaction → STM b +readItr ∷ (Interaction → TVar a) → Interaction → STM a {-# INLINE readItr #-} -readItr accessor reader itr - = reader <$> readTVar (accessor itr) +readItr accessor itr + = readTVar (accessor itr) updateItr ∷ (Interaction → TVar a) → (a → a) → Interaction → STM () {-# INLINE updateItr #-} updateItr accessor updator itr - = do old ← readItr accessor id itr + = do old ← readItr accessor itr writeItr accessor (updator old) itr