text-format 0.2.0.0 → 0.2.1.0
raw patch · 2 files changed
+12/−8 lines, 2 filesdep +transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: transformers
API changes (from Hackage documentation)
- Data.Text.Format: hprint :: Params ps => Handle -> Format -> ps -> IO ()
+ Data.Text.Format: hprint :: (MonadIO m, Params ps) => Handle -> Format -> ps -> m ()
- Data.Text.Format: print :: Params ps => Format -> ps -> IO ()
+ Data.Text.Format: print :: (MonadIO m, Params ps) => Format -> ps -> m ()
Files
- Data/Text/Format.hs +9/−6
- text-format.cabal +3/−2
Data/Text/Format.hs view
@@ -36,15 +36,16 @@ , fixed_ ) where -import qualified Data.Text.Buildable as B-import Data.Text.Format.Params (Params(..))+import Control.Monad.IO.Class (MonadIO(liftIO)) import Data.Text.Format.Functions ((<>))+import Data.Text.Format.Params (Params(..)) import Data.Text.Format.Types.Internal (FPControl(..), FPFormat(..), Fast(..)) import Data.Text.Format.Types.Internal (Format(..), Hex(..), Only(..), Shown(..)) import Data.Text.Lazy.Builder import Prelude hiding (exp, print) import System.IO (Handle) import qualified Data.Text as ST+import qualified Data.Text.Buildable as B import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.IO as LT @@ -63,13 +64,15 @@ format fmt ps = toLazyText $ build fmt ps -- | Render a format string and arguments, then print the result.-print :: Params ps => Format -> ps -> IO ()-print fmt ps = LT.putStr . toLazyText $ build fmt ps+print :: (MonadIO m, Params ps) => Format -> ps -> m ()+{-# SPECIALIZE print :: (Params ps) => Format -> ps -> IO () #-}+print fmt ps = liftIO . LT.putStr . toLazyText $ build fmt ps -- | Render a format string and arguments, then print the result to -- the given file handle.-hprint :: Params ps => Handle -> Format -> ps -> IO ()-hprint h fmt ps = LT.hPutStr h . toLazyText $ build fmt ps+hprint :: (MonadIO m, Params ps) => Handle -> Format -> ps -> m ()+{-# SPECIALIZE hprint :: (Params ps) => Handle -> Format -> ps -> IO () #-}+hprint h fmt ps = liftIO . LT.hPutStr h . toLazyText $ build fmt ps -- | Pad the left hand side of a string until it reaches @k@ -- characters wide, if necessary filling with character @c@.
text-format.cabal view
@@ -1,5 +1,5 @@ name: text-format-version: 0.2.0.0+version: 0.2.1.0 license: BSD3 license-file: LICENSE homepage: https://github.com/mailrank/text-format@@ -47,7 +47,8 @@ integer-gmp, old-locale, text >= 0.11.0.8,- time+ time,+ transformers if flag(developer) ghc-options: -Werror