Commits

Bryan O'Sullivan  committed d108a75

Minor tweaks.

  • Participants
  • Parent commits a1b5828

Comments (0)

Files changed (1)

File Data/Text/Lazy/Builder.hs

 
 -- | Sequence an ST operation on the buffer
 withBuffer :: (forall s. Buffer s -> ST s (Buffer s)) -> Builder
-withBuffer f = Builder $ \k buf -> do
-    buf' <- f buf
-    k buf'
+withBuffer f = Builder $ \k buf -> f buf >>= k
 {-# INLINE withBuffer #-}
 
 -- | Get the size of the buffer
 
 -- | Ensure that there are at least @n@ many elements available.
 ensureFree :: Int -> Builder
-ensureFree n = n `seq` withSize $ \ l ->
+ensureFree !n = withSize $ \ l ->
     if n <= l
     then empty
     else flush `append` withBuffer (const (newBuffer (max n defaultChunkSize)))