packages feed

text-format-heavy 0.1.1.0 → 0.1.2.0

raw patch · 2 files changed

+20/−1 lines, 2 filesdep +bytestringPVP ok

version bump matches the API change (PVP)

Dependencies added: bytestring

API changes (from Hackage documentation)

+ Data.Text.Format.Heavy.Instances: instance Data.Text.Format.Heavy.Types.Formatable Data.ByteString.Internal.ByteString
+ Data.Text.Format.Heavy.Instances: instance Data.Text.Format.Heavy.Types.Formatable Data.ByteString.Lazy.Internal.ByteString

Files

Data/Text/Format/Heavy/Instances.hs view
@@ -12,7 +12,11 @@ import Data.Default import qualified Data.Map as M import qualified Data.Text as T+import qualified Data.Text.Encoding as TE import qualified Data.Text.Lazy as TL+import qualified Data.Text.Lazy.Encoding as TLE+import qualified Data.ByteString as BS+import qualified Data.ByteString.Lazy as BSL import qualified Data.Text.Lazy.Builder as B import Data.Text.Lazy.Builder.Int (decimal, hexadecimal) @@ -88,6 +92,20 @@     case parseGenericFormat fmtStr of       Left err -> Left $ show err       Right fmt -> Right $ formatStr fmt text++instance Formatable BS.ByteString where+  formatVar Nothing text = Right $ formatStr def $ TL.fromStrict $ TE.decodeUtf8 text+  formatVar (Just fmtStr) text =+    case parseGenericFormat fmtStr of+      Left err -> Left $ show err+      Right fmt -> Right $ formatStr fmt $ TL.fromStrict $ TE.decodeUtf8 text++instance Formatable BSL.ByteString where+  formatVar Nothing text = Right $ formatStr def $ TLE.decodeUtf8 text+  formatVar (Just fmtStr) text =+    case parseGenericFormat fmtStr of+      Left err -> Left $ show err+      Right fmt -> Right $ formatStr fmt $ TLE.decodeUtf8 text  instance Formatable Bool where   formatVar Nothing x = Right $ formatBool def x
text-format-heavy.cabal view
@@ -1,5 +1,5 @@ name:                text-format-heavy-version:             0.1.1.0+version:             0.1.2.0 synopsis:            Full-weight string formatting library, analog of Python's string.format description:         This package contains full-featured string formatting function, similar to                      Python's string.format. Features include:@@ -46,6 +46,7 @@   other-extensions:    ExistentialQuantification   build-depends:       base >=4.8 && <5,                        text >=1.2 && <1.3,+                       bytestring >= 0.10,                        parsec >=3.1 && <3.2,                        containers >= 0.5,                        data-default >= 0.7,