X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FInteraction.hs;h=8a64dc1b0715a1b3e703de12ed9c7da43c0076e6;hb=2bb7a0b;hp=46e32a139a37d17b88b0dce43e05540dc0cbd79f;hpb=32a6ebbb18856ab1203e8a114414f235c2abe22b;p=Lucu.git diff --git a/Network/HTTP/Lucu/Interaction.hs b/Network/HTTP/Lucu/Interaction.hs index 46e32a1..8a64dc1 100644 --- a/Network/HTTP/Lucu/Interaction.hs +++ b/Network/HTTP/Lucu/Interaction.hs @@ -10,14 +10,14 @@ module Network.HTTP.Lucu.Interaction , newInteractionQueue , newInteraction , defaultPageContentType - +{- , writeItr , readItr , updateItr +-} ) 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 +168,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