@@ -8,12 +8,11 @@ module General.Str(
88 BStr0 , bstr0Join , bstr0Split
99 ) where
1010
11- import qualified Foundation as Fdn
12- import qualified Foundation.Collection as Fdn
1311import qualified Data.ByteString.Char8 as BS
1412import qualified Data.ByteString.UTF8 as US
1513import qualified Data.ByteString.Lazy.Char8 as LBS
1614import qualified Data.ByteString.Lazy.UTF8 as LUS
15+ import qualified Data.Text as T
1716import Control.DeepSeq
1817import Data.Char
1918import Data.Data
@@ -23,8 +22,8 @@ import Data.String
2322import Prelude
2423
2524
26- newtype Str = Str { fromStr :: Fdn. String }
27- deriving (Data ,Typeable ,Eq ,Ord ,Semigroup ,Monoid )
25+ newtype Str = Str { fromStr :: T. Text }
26+ deriving (Data , Typeable , Eq , Ord , Semigroup , Monoid )
2827
2928instance Show Str where show = strUnpack
3029instance NFData Str where rnf x = x `seq` ()
@@ -36,19 +35,19 @@ type LBStr = LBS.ByteString
3635
3736
3837strPack :: String -> Str
39- strPack = Str . fromString
38+ strPack = Str . T. pack
4039
4140strUnpack :: Str -> String
42- strUnpack = Fdn. toList . fromStr
41+ strUnpack = T. unpack . fromStr
4342
4443strCons :: Char -> Str -> Str
45- strCons c = Str . Fdn . cons c . fromStr
44+ strCons c = Str . T . cons c . fromStr
4645
4746strCopy :: Str -> Str
48- strCopy = Str . Fdn . copy . fromStr
47+ strCopy = Str . T . copy . fromStr
4948
5049strNull :: Str -> Bool
51- strNull = Fdn .null . fromStr
50+ strNull = T .null . fromStr
5251
5352bstrPack :: String -> BStr
5453bstrPack = US. fromString
0 commit comments