text-binary-0.2.1.1/Data/0000755000000000000000000000000012773161326013166 5ustar0000000000000000text-binary-0.2.1.1/Data/Text/0000755000000000000000000000000012773161326014112 5ustar0000000000000000text-binary-0.2.1.1/Data/Text/Binary.hs0000644000000000000000000000124212773161326015671 0ustar0000000000000000{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Text.Binary where #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 import qualified Data.Text.Lazy.Encoding as L import Data.Binary instance Binary T.Text where put = put . T.encodeUtf8 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 = do bs <- get case L.decodeUtf8' bs of Left exn -> fail (show exn) Right a -> return a #endif text-binary-0.2.1.1/LICENSE0000644000000000000000000000245212773161326013325 0ustar0000000000000000Copyright (c) 2012, Jakub Waszczuk All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. text-binary-0.2.1.1/Setup.lhs0000755000000000000000000000011612773161326014126 0ustar0000000000000000#! /usr/bin/env runhaskell > import Distribution.Simple > main = defaultMain text-binary-0.2.1.1/text-binary.cabal0000644000000000000000000000154212773162250015546 0ustar0000000000000000name: text-binary version: 0.2.1.1 synopsis: Binary instances for text types description: A compatibility layer providing Binary instances for strict and lazy text types for versions older than 1.2.1 of . license: BSD2 license-file: LICENSE cabal-version: >= 1.6 author: Jakub Waszczuk maintainer: waszczuk.kuba@gmail.com stability: provisional category: Data homepage: https://github.com/kawu/text-binary build-type: Simple extra-source-files: changelog library build-depends: base >= 4 && < 5 , text , binary exposed-modules: Data.Text.Binary ghc-options: -Wall source-repository head type: git location: git://github.com/kawu/text-binary.git text-binary-0.2.1.1/changelog0000644000000000000000000000010712773161326014165 0ustar0000000000000000-*-change-log-*- 0.2.1 * Propagate decoding failure in the Get monad