Bryan O'Sullivan avatar Bryan O'Sullivan committed 271a74a Merge

Merge

Comments (0)

Files changed (3)

 445c2d04e07bf8aa07ddea0281f2af716cb05122 0.1.0.0
 1b34f76dde9fb88b2c3d8cf92a9f249dd958206e 0.2.0.0
+45d4878cb327b4f18c7ea39036b458ba1f78ca40 0.2.1.0

Data/Text/Format.hs

     , generic
     ) where
 
-import qualified Data.Text.Buildable as B
+import Control.Monad.IO.Class (MonadIO(liftIO))
+import Data.Text.Format.Functions ((<>))
 import Data.Text.Format.Params (Params(..))
-import Data.Text.Format.Functions ((<>))
 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
 
 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

 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
     integer-gmp,
     old-locale,
     text >= 0.11.0.8,
-    time
+    time,
+    transformers
 
   if flag(developer)
     ghc-options: -Werror
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.