string-transform 0.1.0 → 0.1.1
raw patch · 3 files changed
+17/−30 lines, 3 files
Files
- src/Data/String/Transform.hs +2/−20
- string-transform.cabal +12/−6
- test/Main.hs +3/−4
src/Data/String/Transform.hs view
@@ -1,8 +1,5 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE IncoherentInstances #-}-{-# LANGUAGE Safe #-}-{-# LANGUAGE TypeSynonymInstances #-}-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE Safe #-} module Data.String.Transform where import qualified Data.ByteString as B@@ -32,9 +29,6 @@ instance ToString TL.Text where toString = TL.unpack -instance Show a => ToString a where- toString = show- class ToByteStringStrict a where toByteStringStrict :: a -> B.ByteString @@ -53,9 +47,6 @@ instance ToByteStringStrict TL.Text where toByteStringStrict = T.encodeUtf8 . TL.toStrict -instance Show a => ToByteStringStrict a where- toByteStringStrict = toByteStringStrict . show- class ToByteStringLazy a where toByteStringLazy :: a -> BL.ByteString @@ -74,9 +65,6 @@ instance ToByteStringLazy TL.Text where toByteStringLazy = TL.encodeUtf8 -instance Show a => ToByteStringLazy a where- toByteStringLazy = toByteStringLazy . show- class ToTextStrict a where toTextStrict :: a -> T.Text @@ -95,9 +83,6 @@ instance ToTextStrict TL.Text where toTextStrict = TL.toStrict -instance Show a => ToTextStrict a where- toTextStrict = toTextStrict . show- class ToTextLazy a where toTextLazy :: a -> TL.Text @@ -115,6 +100,3 @@ instance ToTextLazy TL.Text where toTextLazy = id--instance Show a => ToTextLazy a where- toTextLazy = toTextLazy . show
string-transform.cabal view
@@ -1,9 +1,11 @@--- This file has been generated from package.yaml by hpack version 0.17.1.+-- This file has been generated from package.yaml by hpack version 0.20.0. -- -- see: https://github.com/sol/hpack+--+-- hash: 29bfa4a42fbd19c8676a3a49f89a49041935aec7c3adff0fcb0197bf80d1179a name: string-transform-version: 0.1.0+version: 0.1.1 synopsis: simple and easy haskell string transform wrapper category: Text homepage: https://github.com/ncaq/string-transform#readme@@ -28,12 +30,14 @@ src ghc-options: -Wall build-depends:- base >= 4.7 && < 5+ base >=4.7 && <5 , bytestring , text , utf8-string exposed-modules: Data.String.Transform+ other-modules:+ Paths_string_transform default-language: Haskell2010 test-suite tasty@@ -43,12 +47,14 @@ test ghc-options: -Wall build-depends:- base >= 4.7 && < 5+ base >=4.7 && <5 , bytestring- , text- , utf8-string , string-transform , tasty , tasty-hunit , tasty-smallcheck+ , text+ , utf8-string+ other-modules:+ Paths_string_transform default-language: Haskell2010
test/Main.hs view
@@ -2,6 +2,7 @@ module Main (main) where import Data.String.Transform+import qualified Data.Text as T import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.SmallCheck@@ -34,8 +35,6 @@ hunitTest :: [TestTree] hunitTest =- [ testCase "toString 1" (toString 1 @?= "1")- , testCase "toByteStringStrict 1" (toByteStringStrict 1 @?= toByteStringStrict "1")- , testCase "toTextStrict 1" (toTextStrict 1 @?= toTextStrict "1")- , testCase "toByteStringStrict 日本語" (toString (toByteStringStrict "日本語") @?= "日本語")+ [ testCase "toByteStringStrict 日本語" (toString (toByteStringStrict "日本語") @?= "日本語")+ , testCase "toString Text" (toString (T.pack "foo") @?= "foo") ]