Permalink
Browse files

Merge

  • Loading branch information...
2 parents c08b23f + 84cd957 commit a91940c8f5e9dda6d03a9c26dcd9bb51fcbab4ae @bos committed Jun 25, 2011
Showing with 13 additions and 8 deletions.
  1. +1 −0 .hgtags
  2. +9 −6 Data/Text/Format.hs
  3. +3 −2 text-format.cabal
View
@@ -1,2 +1,3 @@
445c2d04e07bf8aa07ddea0281f2af716cb05122 0.1.0.0
1b34f76dde9fb88b2c3d8cf92a9f249dd958206e 0.2.0.0
+45d4878cb327b4f18c7ea39036b458ba1f78ca40 0.2.1.0
View
@@ -37,15 +37,16 @@ module Data.Text.Format
, generic
) 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
@@ -64,13 +65,15 @@ format :: Params ps => Format -> ps -> LT.Text
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@.
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 @@ library
integer-gmp,
old-locale,
text >= 0.11.0.8,
- time
+ time,
+ transformers
if flag(developer)
ghc-options: -Werror

0 comments on commit a91940c

Please sign in to comment.