Skip to content

Commit

Permalink
Use text instead of foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm committed Jan 4, 2025
1 parent 8149c93 commit 5a80fcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
3 changes: 1 addition & 2 deletions hoogle.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ library
directory,
extra >= 1.6.6,
filepath,
foundation >= 0.0.13,
old-locale,
hashable,
haskell-src-exts >= 1.22 && < 1.24,
Expand All @@ -74,7 +73,7 @@ library
storable-tuple,
tar,
template-haskell,
text,
text >= 2,
time >= 1.5,
transformers,
uniplate,
Expand Down
17 changes: 8 additions & 9 deletions src/General/Str.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ module General.Str(
BStr0, bstr0Join, bstr0Split
) where

import qualified Foundation as Fdn
import qualified Foundation.Collection as Fdn
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.UTF8 as US
import qualified Data.ByteString.Lazy.Char8 as LBS
import qualified Data.ByteString.Lazy.UTF8 as LUS
import qualified Data.Text as T
import Control.DeepSeq
import Data.Char
import Data.Data
Expand All @@ -23,8 +22,8 @@ import Data.String
import Prelude


newtype Str = Str {fromStr :: Fdn.String}
deriving (Data,Typeable,Eq,Ord,Semigroup,Monoid)
newtype Str = Str { fromStr :: T.Text }
deriving (Data, Typeable, Eq, Ord, Semigroup, Monoid)

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


strPack :: String -> Str
strPack = Str . fromString
strPack = Str . T.pack

strUnpack :: Str -> String
strUnpack = Fdn.toList . fromStr
strUnpack = T.unpack . fromStr

strCons :: Char -> Str -> Str
strCons c = Str . Fdn.cons c . fromStr
strCons c = Str . T.cons c . fromStr

strCopy :: Str -> Str
strCopy = Str . Fdn.copy . fromStr
strCopy = Str . T.copy . fromStr

strNull :: Str -> Bool
strNull = Fdn.null . fromStr
strNull = T.null . fromStr

bstrPack :: String -> BStr
bstrPack = US.fromString
Expand Down

0 comments on commit 5a80fcc

Please sign in to comment.