packages feed

th-printf 0.2.0.1 → 0.3.0.0

raw patch · 3 files changed

+6/−38 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

src/Text/Printf/TH.hs view
@@ -6,11 +6,6 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE QuasiQuotes #-} --- | A module with behavior as close to realistically possible to--- C printf, including variadic width and precision specifiers.------ The only thing you don't get with this package is printing pointers--- (although if you really want this behavior, send a pull request). module Text.Printf.TH (s, st, lt, sb, lb, sP, stP, ltP, sbP, lbP) where  import Control.Applicative@@ -73,43 +68,15 @@  s, st, lt, sb, lb, sP, stP, ltP, sbP, lbP :: QuasiQuoter --- | A formatter that produces a 'String'.------ >>> [s|%s %d %.3f|] "foobar" 10 1.23456--- "foobar 10 1.235" s = quoterOfType ''String False---- | A formatter that produces 'T.Text'. See 's'. st = quoterOfType ''T.Text False---- | A formatter that produces lazy 'LT.Text'. See 's'. lt = quoterOfType ''LT.Text False---- | A formatter that produces 'B.ByteString'. See 's'. sb = quoterOfType ''B.ByteString False---- | A formatter that produces lazy 'LB.ByteString'. See 's'. lb = quoterOfType ''LB.ByteString False---- | A formatter that produces and prints a 'String'.------ >>> [s|%s %d %.3f|] "foobar" 10 1.23456--- <IO ()>------ This formatter WILL output a newline after the expanded string. If you--- don't want this behavior, use 's' and 'putStr' the result. sP = quoterOfType ''String True---- | A formatter that produces and prints 'T.Text'. See 'sP'. stP = quoterOfType ''T.Text True---- | A formatter that produces and prints lazy 'LT.Text'. See 'sP'. ltP = quoterOfType ''LT.Text True---- | A formatter that produces and prints 'B.ByteString'. See 'sP'. sbP = quoterOfType ''B.ByteString True---- | A formatter that produces and prints lazy 'LB.ByteString'. See 'sP'. lbP = quoterOfType ''LB.ByteString True  formatP :: Parser [Chunk]
tests/format.hs view
@@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-}  module Main where@@ -15,8 +16,10 @@ import Test.QuickCheck import Text.Printf.TH +#if __GLASGOW_HASKELL__ <= 706 instance Eq ErrorCall where     ErrorCall m == ErrorCall n = m == n+#endif  main :: IO () main = hspec $ do
th-printf.cabal view
@@ -1,8 +1,5 @@--- Initial th-printf.cabal generated by cabal init.  For further --- documentation, see http://haskell.org/cabal/users-guide/- name:                th-printf-version:             0.2.0.1+version:             0.3.0.0 synopsis:            Compile-time printf description:         Quasiquoters for printf: string, bytestring, text. homepage:            https://github.com/joelteon/th-printf@@ -17,7 +14,7 @@ library   hs-source-dirs:      src   exposed-modules:     Text.Printf.TH-  build-depends:       base <4.7+  build-depends:       base <4.8                      , attoparsec                      , bytestring                      , template-haskell@@ -34,3 +31,4 @@   main-is: format.hs   hs-source-dirs: tests   build-depends: base, bytestring, hspec, HUnit, QuickCheck, template-haskell, text, th-printf+  default-language:    Haskell2010