Skip to content

Commit 6f52560

Browse files
konsumlammBodigrim
authored andcommitted
Use text instead of foundation
1 parent ba4be4f commit 6f52560

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

hoogle.cabal

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ library
5959
directory,
6060
extra >= 1.6.6,
6161
filepath,
62-
foundation >= 0.0.13,
6362
ghc-lib-parser >= 9.6,
6463
old-locale,
6564
hashable,
@@ -75,7 +74,7 @@ library
7574
storable-tuple,
7675
tar,
7776
template-haskell,
78-
text,
77+
text >= 2,
7978
time >= 1.5,
8079
transformers,
8180
uniplate,

src/General/Str.hs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1311
import qualified Data.ByteString.Char8 as BS
1412
import qualified Data.ByteString.UTF8 as US
1513
import qualified Data.ByteString.Lazy.Char8 as LBS
1614
import qualified Data.ByteString.Lazy.UTF8 as LUS
15+
import qualified Data.Text as T
1716
import Control.DeepSeq
1817
import Data.Char
1918
import Data.Data
@@ -23,8 +22,8 @@ import Data.String
2322
import 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

2928
instance Show Str where show = strUnpack
3029
instance NFData Str where rnf x = x `seq` ()
@@ -36,19 +35,19 @@ type LBStr = LBS.ByteString
3635

3736

3837
strPack :: String -> Str
39-
strPack = Str . fromString
38+
strPack = Str . T.pack
4039

4140
strUnpack :: Str -> String
42-
strUnpack = Fdn.toList . fromStr
41+
strUnpack = T.unpack . fromStr
4342

4443
strCons :: Char -> Str -> Str
45-
strCons c = Str . Fdn.cons c . fromStr
44+
strCons c = Str . T.cons c . fromStr
4645

4746
strCopy :: Str -> Str
48-
strCopy = Str . Fdn.copy . fromStr
47+
strCopy = Str . T.copy . fromStr
4948

5049
strNull :: Str -> Bool
51-
strNull = Fdn.null . fromStr
50+
strNull = T.null . fromStr
5251

5352
bstrPack :: String -> BStr
5453
bstrPack = US.fromString

0 commit comments

Comments
 (0)