text-binary 0.1.0 → 0.2.1.1
raw patch · 3 files changed
Files
- Data/Text/Binary.hs +13/−3
- changelog +4/−0
- text-binary.cabal +8/−4
Data/Text/Binary.hs view
@@ -1,8 +1,9 @@+{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Text.Binary where -import Control.Applicative ((<$>))+#if !(MIN_VERSION_text(1,2,1)) import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.Lazy as L@@ -11,8 +12,17 @@ instance Binary T.Text where put = put . T.encodeUtf8- get = T.decodeUtf8 <$> get+ get = do+ bs <- get+ case T.decodeUtf8' bs of+ Left exn -> fail (show exn)+ Right a -> return a instance Binary L.Text where put = put . L.encodeUtf8- get = L.decodeUtf8 <$> get+ get = do+ bs <- get+ case L.decodeUtf8' bs of+ Left exn -> fail (show exn)+ Right a -> return a+#endif
+ changelog view
@@ -0,0 +1,4 @@+-*-change-log-*-++0.2.1+ * Propagate decoding failure in the Get monad
text-binary.cabal view
@@ -1,9 +1,11 @@ name: text-binary-version: 0.1.0+version: 0.2.1.1 synopsis: Binary instances for text types-description: - The library provides binary instances for strict and lazy text types.-license: BSD3+description:+ A compatibility layer providing Binary instances for strict+ and lazy text types for versions older than 1.2.1 of+ <https://hackage.haskell.org/package/text>.+license: BSD2 license-file: LICENSE cabal-version: >= 1.6 author: Jakub Waszczuk@@ -12,6 +14,8 @@ category: Data homepage: https://github.com/kawu/text-binary build-type: Simple++extra-source-files: changelog library build-depends: