{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Text.Lazy.NonEmpty
(
NonEmptyText,
NonEmptyLazyText,
pack,
unpack,
singleton,
fromChunks,
toChunks,
toStrict,
fromStrict,
cons,
snoc,
uncons,
unsnoc,
head,
last,
tail,
init,
length,
compareLength,
map,
intercalate,
intersperse,
transpose,
reverse,
replace,
toCaseFold,
toLower,
toUpper,
toTitle,
justifyLeft,
justifyRight,
center,
foldl,
foldl',
foldl1,
foldl1',
foldr,
foldr1,
concat,
concatMap,
any,
all,
maximum,
minimum,
scanl,
scanl1,
scanr,
scanr1,
mapAccumL,
mapAccumR,
replicate,
cycle,
iterate,
take,
takeEnd,
drop,
dropEnd,
takeWhile,
takeWhileEnd,
dropWhile,
dropWhileEnd,
dropAround,
strip,
stripStart,
stripEnd,
splitAt,
breakOn,
breakOnEnd,
break,
span,
group,
groupBy,
inits,
tails,
splitOn,
split,
chunksOf,
lines,
words,
unlines,
unwords,
isPrefixOf,
isSuffixOf,
isInfixOf,
stripPrefix,
stripSuffix,
commonPrefixes,
filter,
breakOnAll,
find,
#if MIN_VERSION_text(1,2,5)
elem,
#endif
partition,
index,
count,
zip,
zipWith,
)
where
import Data.Function (on)
import Data.Int (Int64)
import Data.NonEmpty
import qualified Data.Text.Lazy as T
import Data.Text.NonEmpty (NonEmptyStrictText)
import GHC.Stack
import Prelude (Bool (..), Char, Maybe (..), Ord (..), Ordering, String, error, fmap, fst, not, snd, uncurry, ($), (.))
type NonEmptyLazyText = NonEmpty T.Text
type NonEmptyText = NonEmptyLazyText
instance NonEmptySingleton T.Text where
type NonEmptySingletonElement T.Text = Char
nonEmptySingleton :: Proxy Text -> NonEmptySingletonElement Text -> Text
nonEmptySingleton Proxy Text
_ = Char -> Text
NonEmptySingletonElement Text -> Text
T.singleton
instance NonEmptyFromContainer T.Text where
isNonEmpty :: Text -> Bool
isNonEmpty = Bool -> Bool
not (Bool -> Bool) -> (Text -> Bool) -> Text -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Bool
T.null
pack :: NonEmpty String -> NonEmptyLazyText
pack :: NonEmpty String -> NonEmptyLazyText
pack = (String -> Text) -> NonEmpty String -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty String -> Text
T.pack
{-# INLINE pack #-}
unpack :: HasCallStack => NonEmptyLazyText -> NonEmpty String
unpack :: NonEmptyLazyText -> NonEmpty String
unpack = (Text -> String) -> NonEmptyLazyText -> NonEmpty String
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> String
T.unpack
{-# INLINE unpack #-}
fromChunks :: NonEmpty [NonEmptyStrictText] -> NonEmptyLazyText
fromChunks :: NonEmpty [NonEmptyStrictText] -> NonEmptyLazyText
fromChunks = ([NonEmptyStrictText] -> Text)
-> NonEmpty [NonEmptyStrictText] -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (([NonEmptyStrictText] -> Text)
-> NonEmpty [NonEmptyStrictText] -> NonEmptyLazyText)
-> ([NonEmptyStrictText] -> Text)
-> NonEmpty [NonEmptyStrictText]
-> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
T.fromChunks ([Text] -> Text)
-> ([NonEmptyStrictText] -> [Text]) -> [NonEmptyStrictText] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyStrictText -> Text) -> [NonEmptyStrictText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyStrictText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE fromChunks #-}
toChunks :: NonEmptyLazyText -> NonEmpty [NonEmptyStrictText]
toChunks :: NonEmptyLazyText -> NonEmpty [NonEmptyStrictText]
toChunks = (Text -> [NonEmptyStrictText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyStrictText]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [NonEmptyStrictText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyStrictText])
-> (Text -> [NonEmptyStrictText])
-> NonEmptyLazyText
-> NonEmpty [NonEmptyStrictText]
forall a b. (a -> b) -> a -> b
$ (Text -> NonEmptyStrictText) -> [Text] -> [NonEmptyStrictText]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyStrictText
forall a. a -> NonEmpty a
trustedNonEmpty ([Text] -> [NonEmptyStrictText])
-> (Text -> [Text]) -> Text -> [NonEmptyStrictText]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text]
T.toChunks
{-# INLINE toChunks #-}
toStrict :: NonEmptyLazyText -> NonEmptyStrictText
toStrict :: NonEmptyLazyText -> NonEmptyStrictText
toStrict = (Text -> Text) -> NonEmptyLazyText -> NonEmptyStrictText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.toStrict
{-# INLINE toStrict #-}
fromStrict :: NonEmptyStrictText -> NonEmptyLazyText
fromStrict :: NonEmptyStrictText -> NonEmptyLazyText
fromStrict = (Text -> Text) -> NonEmptyStrictText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.fromStrict
{-# INLINE fromStrict #-}
cons :: Char -> NonEmptyLazyText -> NonEmptyLazyText
cons :: Char -> NonEmptyLazyText -> NonEmptyLazyText
cons Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ Char -> Text -> Text
T.cons Char
c
{-# INLINE cons #-}
infixr 5 `cons`
snoc :: NonEmptyLazyText -> Char -> NonEmptyLazyText
snoc :: NonEmptyLazyText -> Char -> NonEmptyLazyText
snoc NonEmptyLazyText
t Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (Text -> Char -> Text
`T.snoc` Char
c) NonEmptyLazyText
t
{-# INLINE snoc #-}
head :: NonEmptyLazyText -> Char
head :: NonEmptyLazyText -> Char
head = (Char, Text) -> Char
forall a b. (a, b) -> a
fst ((Char, Text) -> Char)
-> (NonEmptyLazyText -> (Char, Text)) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Char, Text)
uncons
{-# INLINE head #-}
uncons :: NonEmptyLazyText -> (Char, T.Text)
uncons :: NonEmptyLazyText -> (Char, Text)
uncons = (Text -> Maybe (Char, Text)) -> NonEmptyLazyText -> (Char, Text)
forall a b. (a -> Maybe b) -> NonEmpty a -> b
withNonEmpty Text -> Maybe (Char, Text)
T.uncons
{-# INLINE uncons #-}
last :: NonEmptyLazyText -> Char
last :: NonEmptyLazyText -> Char
last = (Text, Char) -> Char
forall a b. (a, b) -> b
snd ((Text, Char) -> Char)
-> (NonEmptyLazyText -> (Text, Char)) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Text, Char)
unsnoc
{-# INLINE last #-}
tail :: NonEmptyLazyText -> T.Text
tail :: NonEmptyLazyText -> Text
tail = (Char, Text) -> Text
forall a b. (a, b) -> b
snd ((Char, Text) -> Text)
-> (NonEmptyLazyText -> (Char, Text)) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Char, Text)
uncons
{-# INLINE tail #-}
init :: NonEmptyLazyText -> T.Text
init :: NonEmptyLazyText -> Text
init = (Text, Char) -> Text
forall a b. (a, b) -> a
fst ((Text, Char) -> Text)
-> (NonEmptyLazyText -> (Text, Char)) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Text, Char)
unsnoc
{-# INLINE init #-}
unsnoc :: NonEmptyLazyText -> (T.Text, Char)
unsnoc :: NonEmptyLazyText -> (Text, Char)
unsnoc = (Text -> Maybe (Text, Char)) -> NonEmptyLazyText -> (Text, Char)
forall a b. (a -> Maybe b) -> NonEmpty a -> b
withNonEmpty Text -> Maybe (Text, Char)
T.unsnoc
{-# INLINE unsnoc #-}
length :: NonEmptyLazyText -> Int64
length :: NonEmptyLazyText -> Int64
length = Text -> Int64
T.length (Text -> Int64)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Int64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE length #-}
compareLength :: NonEmptyLazyText -> Int64 -> Ordering
compareLength :: NonEmptyLazyText -> Int64 -> Ordering
compareLength NonEmptyLazyText
x = Text -> Int64 -> Ordering
T.compareLength (NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty NonEmptyLazyText
x)
{-# INLINE compareLength #-}
map :: (Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
map :: (Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
map Char -> Char
f = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char) -> Text -> Text
T.map Char -> Char
f
{-# INLINE map #-}
intercalate :: T.Text -> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
intercalate :: Text -> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
intercalate Text
e = Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty (Text -> NonEmptyLazyText)
-> (NonEmpty [NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText]
-> NonEmptyLazyText
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text] -> Text
T.intercalate Text
e ([Text] -> Text)
-> (NonEmpty [NonEmptyLazyText] -> [Text])
-> NonEmpty [NonEmptyLazyText]
-> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyLazyText -> Text) -> [NonEmptyLazyText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty ([NonEmptyLazyText] -> [Text])
-> (NonEmpty [NonEmptyLazyText] -> [NonEmptyLazyText])
-> NonEmpty [NonEmptyLazyText]
-> [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty [NonEmptyLazyText] -> [NonEmptyLazyText]
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE intercalate #-}
intersperse :: Char -> NonEmptyLazyText -> NonEmptyLazyText
intersperse :: Char -> NonEmptyLazyText -> NonEmptyLazyText
intersperse Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ Char -> Text -> Text
T.intersperse Char
c
{-# INLINE intersperse #-}
reverse :: HasCallStack => NonEmptyLazyText -> NonEmptyLazyText
reverse :: NonEmptyLazyText -> NonEmptyLazyText
reverse = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.reverse
{-# INLINE reverse #-}
replace ::
NonEmptyLazyText ->
NonEmptyLazyText ->
NonEmptyLazyText ->
NonEmptyLazyText
replace :: NonEmptyLazyText
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmptyLazyText
replace = (Text -> Text -> Text -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> NonEmptyLazyText
-> NonEmptyLazyText
forall a b c d.
(a -> b -> c -> d)
-> NonEmpty a -> NonEmpty b -> NonEmpty c -> NonEmpty d
overNonEmpty3 Text -> Text -> Text -> Text
T.replace
toCaseFold :: NonEmptyLazyText -> NonEmptyLazyText
toCaseFold :: NonEmptyLazyText -> NonEmptyLazyText
toCaseFold = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.toCaseFold
{-# INLINE toCaseFold #-}
toLower :: NonEmptyLazyText -> NonEmptyLazyText
toLower :: NonEmptyLazyText -> NonEmptyLazyText
toLower = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.toLower
{-# INLINE toLower #-}
toUpper :: NonEmptyLazyText -> NonEmptyLazyText
toUpper :: NonEmptyLazyText -> NonEmptyLazyText
toUpper = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.toUpper
{-# INLINE toUpper #-}
toTitle :: NonEmptyLazyText -> NonEmptyLazyText
toTitle :: NonEmptyLazyText -> NonEmptyLazyText
toTitle = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.toTitle
{-# INLINE toTitle #-}
justifyLeft :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
justifyLeft :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
justifyLeft Int64
p Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ Int64 -> Char -> Text -> Text
T.justifyLeft Int64
p Char
c
{-# INLINE justifyLeft #-}
justifyRight :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
justifyRight :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
justifyRight Int64
p Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ Int64 -> Char -> Text -> Text
T.justifyRight Int64
p Char
c
{-# INLINE justifyRight #-}
center :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
center :: Int64 -> Char -> NonEmptyLazyText -> NonEmptyLazyText
center Int64
p Char
c = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ Int64 -> Char -> Text -> Text
T.center Int64
p Char
c
{-# INLINE center #-}
transpose :: NonEmpty [NonEmptyLazyText] -> NonEmpty [NonEmptyLazyText]
transpose :: NonEmpty [NonEmptyLazyText] -> NonEmpty [NonEmptyLazyText]
transpose = ([NonEmptyLazyText] -> [NonEmptyLazyText])
-> NonEmpty [NonEmptyLazyText] -> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (([NonEmptyLazyText] -> [NonEmptyLazyText])
-> NonEmpty [NonEmptyLazyText] -> NonEmpty [NonEmptyLazyText])
-> ([NonEmptyLazyText] -> [NonEmptyLazyText])
-> NonEmpty [NonEmptyLazyText]
-> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> a -> b
$ (Text -> NonEmptyLazyText) -> [Text] -> [NonEmptyLazyText]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ([Text] -> [NonEmptyLazyText])
-> ([NonEmptyLazyText] -> [Text])
-> [NonEmptyLazyText]
-> [NonEmptyLazyText]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Text] -> [Text]
T.transpose ([Text] -> [Text])
-> ([NonEmptyLazyText] -> [Text]) -> [NonEmptyLazyText] -> [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyLazyText -> Text) -> [NonEmptyLazyText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
foldl :: (a -> Char -> a) -> a -> NonEmptyLazyText -> a
foldl :: (a -> Char -> a) -> a -> NonEmptyLazyText -> a
foldl a -> Char -> a
f a
a = (a -> Char -> a) -> a -> Text -> a
forall a. (a -> Char -> a) -> a -> Text -> a
T.foldl a -> Char -> a
f a
a (Text -> a) -> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE foldl #-}
foldl' :: (a -> Char -> a) -> a -> NonEmptyLazyText -> a
foldl' :: (a -> Char -> a) -> a -> NonEmptyLazyText -> a
foldl' a -> Char -> a
f a
a = (a -> Char -> a) -> a -> Text -> a
forall a. (a -> Char -> a) -> a -> Text -> a
T.foldl' a -> Char -> a
f a
a (Text -> a) -> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE foldl' #-}
foldl1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldl1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldl1 Char -> Char -> Char
f = (Char -> Text -> Char) -> (Char, Text) -> Char
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry ((Char -> Char -> Char) -> Char -> Text -> Char
forall a. (a -> Char -> a) -> a -> Text -> a
T.foldl Char -> Char -> Char
f) ((Char, Text) -> Char)
-> (NonEmptyLazyText -> (Char, Text)) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Char, Text)
uncons
{-# INLINE foldl1 #-}
foldl1' :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldl1' :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldl1' Char -> Char -> Char
f = (Char -> Text -> Char) -> (Char, Text) -> Char
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry ((Char -> Char -> Char) -> Char -> Text -> Char
forall a. (a -> Char -> a) -> a -> Text -> a
T.foldl' Char -> Char -> Char
f) ((Char, Text) -> Char)
-> (NonEmptyLazyText -> (Char, Text)) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Char, Text)
uncons
{-# INLINE foldl1' #-}
foldr :: (Char -> a -> a) -> a -> NonEmptyLazyText -> a
foldr :: (Char -> a -> a) -> a -> NonEmptyLazyText -> a
foldr Char -> a -> a
f a
a = (Char -> a -> a) -> a -> Text -> a
forall a. (Char -> a -> a) -> a -> Text -> a
T.foldr Char -> a -> a
f a
a (Text -> a) -> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE foldr #-}
foldr1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldr1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> Char
foldr1 Char -> Char -> Char
f = (Char -> Text -> Char) -> (Char, Text) -> Char
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry ((Char -> Char -> Char) -> Char -> Text -> Char
forall a. (Char -> a -> a) -> a -> Text -> a
T.foldr Char -> Char -> Char
f) ((Char, Text) -> Char)
-> (NonEmptyLazyText -> (Char, Text)) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> (Char, Text)
uncons
{-# INLINE foldr1 #-}
concat :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
concat :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
concat = ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText)
-> ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText]
-> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
T.concat ([Text] -> Text)
-> ([NonEmptyLazyText] -> [Text]) -> [NonEmptyLazyText] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyLazyText -> Text) -> [NonEmptyLazyText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
concatMap :: (Char -> NonEmptyLazyText) -> NonEmptyLazyText -> NonEmptyLazyText
concatMap :: (Char -> NonEmptyLazyText) -> NonEmptyLazyText -> NonEmptyLazyText
concatMap Char -> NonEmptyLazyText
f = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Text) -> Text -> Text
T.concatMap ((Char -> Text) -> Text -> Text) -> (Char -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty (NonEmptyLazyText -> Text)
-> (Char -> NonEmptyLazyText) -> Char -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> NonEmptyLazyText
f
{-# INLINE concatMap #-}
any :: (Char -> Bool) -> NonEmptyLazyText -> Bool
any :: (Char -> Bool) -> NonEmptyLazyText -> Bool
any Char -> Bool
p = (Char -> Bool) -> Text -> Bool
T.any Char -> Bool
p (Text -> Bool)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE any #-}
all :: (Char -> Bool) -> NonEmptyLazyText -> Bool
all :: (Char -> Bool) -> NonEmptyLazyText -> Bool
all Char -> Bool
p = (Char -> Bool) -> Text -> Bool
T.all Char -> Bool
p (Text -> Bool)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE all #-}
maximum :: NonEmptyLazyText -> Char
maximum :: NonEmptyLazyText -> Char
maximum = Text -> Char
T.maximum (Text -> Char)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE maximum #-}
minimum :: NonEmptyLazyText -> Char
minimum :: NonEmptyLazyText -> Char
minimum = Text -> Char
T.minimum (Text -> Char)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE minimum #-}
scanl :: (Char -> Char -> Char) -> Char -> NonEmptyLazyText -> NonEmptyLazyText
scanl :: (Char -> Char -> Char)
-> Char -> NonEmptyLazyText -> NonEmptyLazyText
scanl Char -> Char -> Char
f Char
s = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Char) -> Char -> Text -> Text
T.scanl Char -> Char -> Char
f Char
s
{-# INLINE scanl #-}
scanl1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
scanl1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
scanl1 Char -> Char -> Char
f = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Char) -> Text -> Text
T.scanl1 Char -> Char -> Char
f
{-# INLINE scanl1 #-}
scanr :: (Char -> Char -> Char) -> Char -> NonEmptyLazyText -> NonEmptyLazyText
scanr :: (Char -> Char -> Char)
-> Char -> NonEmptyLazyText -> NonEmptyLazyText
scanr Char -> Char -> Char
f Char
s = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Char) -> Char -> Text -> Text
T.scanr Char -> Char -> Char
f Char
s
{-# INLINE scanr #-}
scanr1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
scanr1 :: (Char -> Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText
scanr1 Char -> Char -> Char
f = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Char) -> Text -> Text
T.scanr1 Char -> Char -> Char
f
{-# INLINE scanr1 #-}
mapAccumL :: forall a. (a -> Char -> (a, Char)) -> a -> NonEmptyLazyText -> (a, NonEmptyLazyText)
mapAccumL :: (a -> Char -> (a, Char))
-> a -> NonEmptyLazyText -> (a, NonEmptyLazyText)
mapAccumL a -> Char -> (a, Char)
f a
s = (Text -> NonEmptyLazyText) -> (a, Text) -> (a, NonEmptyLazyText)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ((a, Text) -> (a, NonEmptyLazyText))
-> (NonEmptyLazyText -> (a, Text))
-> NonEmptyLazyText
-> (a, NonEmptyLazyText)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
forall a. (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
T.mapAccumL a -> Char -> (a, Char)
f a
s (Text -> (a, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (a, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE mapAccumL #-}
mapAccumR :: forall a. (a -> Char -> (a, Char)) -> a -> NonEmptyLazyText -> (a, NonEmptyLazyText)
mapAccumR :: (a -> Char -> (a, Char))
-> a -> NonEmptyLazyText -> (a, NonEmptyLazyText)
mapAccumR a -> Char -> (a, Char)
f a
s = (Text -> NonEmptyLazyText) -> (a, Text) -> (a, NonEmptyLazyText)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ((a, Text) -> (a, NonEmptyLazyText))
-> (NonEmptyLazyText -> (a, Text))
-> NonEmptyLazyText
-> (a, NonEmptyLazyText)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
forall a. (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
T.mapAccumR a -> Char -> (a, Char)
f a
s (Text -> (a, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (a, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE mapAccumR #-}
replicate :: Int64 -> NonEmptyLazyText -> NonEmptyLazyText
replicate :: Int64 -> NonEmptyLazyText -> NonEmptyLazyText
replicate Int64
n NonEmptyLazyText
x =
if Int64
n Int64 -> Int64 -> Bool
forall a. Ord a => a -> a -> Bool
> Int64
0
then (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (Int64 -> Text -> Text
T.replicate Int64
n) NonEmptyLazyText
x
else String -> NonEmptyLazyText
forall a. HasCallStack => String -> a
error String
"replicate.n should be strictly positive"
{-# INLINE replicate #-}
cycle :: NonEmptyLazyText -> NonEmptyLazyText
cycle :: NonEmptyLazyText -> NonEmptyLazyText
cycle = (Text -> Text) -> NonEmptyLazyText -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> Text
T.cycle
{-# INLINE cycle #-}
iterate :: (Char -> Char) -> Char -> NonEmptyLazyText
iterate :: (Char -> Char) -> Char -> NonEmptyLazyText
iterate Char -> Char
f = Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty (Text -> NonEmptyLazyText)
-> (Char -> Text) -> Char -> NonEmptyLazyText
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> Char -> Text
T.iterate Char -> Char
f
{-# INLINE iterate #-}
take :: Int64 -> NonEmptyLazyText -> T.Text
take :: Int64 -> NonEmptyLazyText -> Text
take Int64
n = Int64 -> Text -> Text
T.take Int64
n (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE take #-}
takeEnd :: Int64 -> NonEmptyLazyText -> T.Text
takeEnd :: Int64 -> NonEmptyLazyText -> Text
takeEnd Int64
n = Int64 -> Text -> Text
T.takeEnd Int64
n (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE takeEnd #-}
drop :: Int64 -> NonEmptyLazyText -> T.Text
drop :: Int64 -> NonEmptyLazyText -> Text
drop Int64
n = Int64 -> Text -> Text
T.drop Int64
n (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE drop #-}
dropEnd :: Int64 -> NonEmptyLazyText -> T.Text
dropEnd :: Int64 -> NonEmptyLazyText -> Text
dropEnd Int64
n = Int64 -> Text -> Text
T.dropEnd Int64
n (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE dropEnd #-}
takeWhile :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
takeWhile :: (Char -> Bool) -> NonEmptyLazyText -> Text
takeWhile Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.takeWhile Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE takeWhile #-}
takeWhileEnd :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
takeWhileEnd :: (Char -> Bool) -> NonEmptyLazyText -> Text
takeWhileEnd Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.takeWhileEnd Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE takeWhileEnd #-}
dropWhile :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
dropWhile :: (Char -> Bool) -> NonEmptyLazyText -> Text
dropWhile Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.dropWhile Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE dropWhile #-}
dropWhileEnd :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
dropWhileEnd :: (Char -> Bool) -> NonEmptyLazyText -> Text
dropWhileEnd Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.dropWhileEnd Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE dropWhileEnd #-}
dropAround :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
dropAround :: (Char -> Bool) -> NonEmptyLazyText -> Text
dropAround Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.dropAround Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE dropAround #-}
stripStart :: NonEmptyLazyText -> T.Text
stripStart :: NonEmptyLazyText -> Text
stripStart = Text -> Text
T.stripStart (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE stripStart #-}
stripEnd :: NonEmptyLazyText -> T.Text
stripEnd :: NonEmptyLazyText -> Text
stripEnd = Text -> Text
T.stripEnd (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE stripEnd #-}
strip :: NonEmptyLazyText -> T.Text
strip :: NonEmptyLazyText -> Text
strip = Text -> Text
T.strip (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE strip #-}
splitAt :: Int64 -> NonEmptyLazyText -> (T.Text, T.Text)
splitAt :: Int64 -> NonEmptyLazyText -> (Text, Text)
splitAt Int64
n = Int64 -> Text -> (Text, Text)
T.splitAt Int64
n (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE splitAt #-}
span :: (Char -> Bool) -> NonEmptyLazyText -> (T.Text, T.Text)
span :: (Char -> Bool) -> NonEmptyLazyText -> (Text, Text)
span Char -> Bool
p = (Char -> Bool) -> Text -> (Text, Text)
T.span Char -> Bool
p (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE span #-}
break :: (Char -> Bool) -> NonEmptyLazyText -> (T.Text, T.Text)
break :: (Char -> Bool) -> NonEmptyLazyText -> (Text, Text)
break Char -> Bool
p = (Char -> Bool) -> Text -> (Text, Text)
T.break Char -> Bool
p (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE break #-}
groupBy :: (Char -> Char -> Bool) -> NonEmptyLazyText -> NonEmpty [T.Text]
groupBy :: (Char -> Char -> Bool) -> NonEmptyLazyText -> NonEmpty [Text]
groupBy Char -> Char -> Bool
p = (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text])
-> (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Bool) -> Text -> [Text]
T.groupBy Char -> Char -> Bool
p
{-# INLINE groupBy #-}
group :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
group :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
group = (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText])
-> (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText
-> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> a -> b
$ (Text -> NonEmptyLazyText) -> [Text] -> [NonEmptyLazyText]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ([Text] -> [NonEmptyLazyText])
-> (Text -> [Text]) -> Text -> [NonEmptyLazyText]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text]
T.group
{-# INLINE group #-}
inits :: NonEmptyLazyText -> NonEmpty [T.Text]
inits :: NonEmptyLazyText -> NonEmpty [Text]
inits = (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> [Text]
T.inits
{-# INLINE inits #-}
tails :: NonEmptyLazyText -> NonEmpty [T.Text]
tails :: NonEmptyLazyText -> NonEmpty [Text]
tails = (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty Text -> [Text]
T.tails
{-# INLINE tails #-}
splitOn ::
NonEmptyLazyText ->
NonEmptyLazyText ->
NonEmpty [T.Text]
splitOn :: NonEmptyLazyText -> NonEmptyLazyText -> NonEmpty [Text]
splitOn = (Text -> Text -> [Text])
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmpty [Text]
forall a b c.
(a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
overNonEmpty2 Text -> Text -> [Text]
T.splitOn
{-# INLINE splitOn #-}
split :: (Char -> Bool) -> NonEmptyLazyText -> NonEmpty [T.Text]
split :: (Char -> Bool) -> NonEmptyLazyText -> NonEmpty [Text]
split Char -> Bool
p = (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text])
-> (Text -> [Text]) -> NonEmptyLazyText -> NonEmpty [Text]
forall a b. (a -> b) -> a -> b
$ (Char -> Bool) -> Text -> [Text]
T.split Char -> Bool
p
{-# INLINE split #-}
chunksOf :: Int64 -> NonEmptyLazyText -> [T.Text]
chunksOf :: Int64 -> NonEmptyLazyText -> [Text]
chunksOf Int64
p = Int64 -> Text -> [Text]
T.chunksOf Int64
p (Text -> [Text])
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE chunksOf #-}
#if MIN_VERSION_text(1,2,5)
elem :: Char -> NonEmptyLazyText -> Bool
elem p = T.elem p . getNonEmpty
{-# INLINE elem #-}
#endif
find :: (Char -> Bool) -> NonEmptyLazyText -> Maybe Char
find :: (Char -> Bool) -> NonEmptyLazyText -> Maybe Char
find Char -> Bool
p = (Char -> Bool) -> Text -> Maybe Char
T.find Char -> Bool
p (Text -> Maybe Char)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Maybe Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE find #-}
partition :: (Char -> Bool) -> NonEmptyLazyText -> (T.Text, T.Text)
partition :: (Char -> Bool) -> NonEmptyLazyText -> (Text, Text)
partition Char -> Bool
p = (Char -> Bool) -> Text -> (Text, Text)
T.partition Char -> Bool
p (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE partition #-}
filter :: (Char -> Bool) -> NonEmptyLazyText -> T.Text
filter :: (Char -> Bool) -> NonEmptyLazyText -> Text
filter Char -> Bool
p = (Char -> Bool) -> Text -> Text
T.filter Char -> Bool
p (Text -> Text)
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE filter #-}
breakOn :: NonEmptyLazyText -> NonEmptyLazyText -> (T.Text, T.Text)
breakOn :: NonEmptyLazyText -> NonEmptyLazyText -> (Text, Text)
breakOn NonEmptyLazyText
t = Text -> Text -> (Text, Text)
T.breakOn (NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty NonEmptyLazyText
t) (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE breakOn #-}
breakOnEnd :: NonEmptyLazyText -> NonEmptyLazyText -> (T.Text, T.Text)
breakOnEnd :: NonEmptyLazyText -> NonEmptyLazyText -> (Text, Text)
breakOnEnd NonEmptyLazyText
t = Text -> Text -> (Text, Text)
T.breakOnEnd (NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty NonEmptyLazyText
t) (Text -> (Text, Text))
-> (NonEmptyLazyText -> Text) -> NonEmptyLazyText -> (Text, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE breakOnEnd #-}
breakOnAll ::
NonEmptyLazyText ->
NonEmptyLazyText ->
[(T.Text, T.Text)]
breakOnAll :: NonEmptyLazyText -> NonEmptyLazyText -> [(Text, Text)]
breakOnAll = Text -> Text -> [(Text, Text)]
T.breakOnAll (Text -> Text -> [(Text, Text)])
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> [(Text, Text)]
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE breakOnAll #-}
index :: HasCallStack => NonEmptyLazyText -> Int64 -> Char
index :: NonEmptyLazyText -> Int64 -> Char
index NonEmptyLazyText
x = Text -> Int64 -> Char
T.index (NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty NonEmptyLazyText
x)
{-# INLINE index #-}
count :: NonEmptyLazyText -> NonEmptyLazyText -> Int64
count :: NonEmptyLazyText -> NonEmptyLazyText -> Int64
count = Text -> Text -> Int64
T.count (Text -> Text -> Int64)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Int64
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE count #-}
zip :: NonEmptyLazyText -> NonEmptyLazyText -> NonEmpty [(Char, Char)]
zip :: NonEmptyLazyText -> NonEmptyLazyText -> NonEmpty [(Char, Char)]
zip = (Text -> Text -> [(Char, Char)])
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmpty [(Char, Char)]
forall a b c.
(a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
overNonEmpty2 Text -> Text -> [(Char, Char)]
T.zip
{-# INLINE zip #-}
zipWith :: (Char -> Char -> Char) -> NonEmptyLazyText -> NonEmptyLazyText -> NonEmptyLazyText
zipWith :: (Char -> Char -> Char)
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmptyLazyText
zipWith Char -> Char -> Char
p = (Text -> Text -> Text)
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmptyLazyText
forall a b c.
(a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
overNonEmpty2 ((Text -> Text -> Text)
-> NonEmptyLazyText -> NonEmptyLazyText -> NonEmptyLazyText)
-> (Text -> Text -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ (Char -> Char -> Char) -> Text -> Text -> Text
T.zipWith Char -> Char -> Char
p
{-# INLINE zipWith #-}
words :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
words :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
words = (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText])
-> (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText
-> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> a -> b
$ (Text -> NonEmptyLazyText) -> [Text] -> [NonEmptyLazyText]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ([Text] -> [NonEmptyLazyText])
-> (Text -> [Text]) -> Text -> [NonEmptyLazyText]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text]
T.words
{-# INLINE words #-}
lines :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
lines :: NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
lines = (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty ((Text -> [NonEmptyLazyText])
-> NonEmptyLazyText -> NonEmpty [NonEmptyLazyText])
-> (Text -> [NonEmptyLazyText])
-> NonEmptyLazyText
-> NonEmpty [NonEmptyLazyText]
forall a b. (a -> b) -> a -> b
$ (Text -> NonEmptyLazyText) -> [Text] -> [NonEmptyLazyText]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> NonEmptyLazyText
forall a. a -> NonEmpty a
trustedNonEmpty ([Text] -> [NonEmptyLazyText])
-> (Text -> [Text]) -> Text -> [NonEmptyLazyText]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> [Text]
T.lines
{-# INLINE lines #-}
unlines :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
unlines :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
unlines = ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText)
-> ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText]
-> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
T.unlines ([Text] -> Text)
-> ([NonEmptyLazyText] -> [Text]) -> [NonEmptyLazyText] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyLazyText -> Text) -> [NonEmptyLazyText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE unlines #-}
unwords :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
unwords :: NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
unwords = ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText
forall a b. (a -> b) -> NonEmpty a -> NonEmpty b
overNonEmpty (([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText] -> NonEmptyLazyText)
-> ([NonEmptyLazyText] -> Text)
-> NonEmpty [NonEmptyLazyText]
-> NonEmptyLazyText
forall a b. (a -> b) -> a -> b
$ [Text] -> Text
T.unwords ([Text] -> Text)
-> ([NonEmptyLazyText] -> [Text]) -> [NonEmptyLazyText] -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonEmptyLazyText -> Text) -> [NonEmptyLazyText] -> [Text]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE unwords #-}
isPrefixOf :: NonEmptyLazyText -> NonEmptyLazyText -> Bool
isPrefixOf :: NonEmptyLazyText -> NonEmptyLazyText -> Bool
isPrefixOf = Text -> Text -> Bool
T.isPrefixOf (Text -> Text -> Bool)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE isPrefixOf #-}
isSuffixOf :: NonEmptyLazyText -> NonEmptyLazyText -> Bool
isSuffixOf :: NonEmptyLazyText -> NonEmptyLazyText -> Bool
isSuffixOf = Text -> Text -> Bool
T.isSuffixOf (Text -> Text -> Bool)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE isSuffixOf #-}
isInfixOf :: HasCallStack => NonEmptyLazyText -> NonEmptyLazyText -> Bool
isInfixOf :: NonEmptyLazyText -> NonEmptyLazyText -> Bool
isInfixOf = Text -> Text -> Bool
T.isInfixOf (Text -> Text -> Bool)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE isInfixOf #-}
stripPrefix :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe T.Text
stripPrefix :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe Text
stripPrefix = Text -> Text -> Maybe Text
T.stripPrefix (Text -> Text -> Maybe Text)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Maybe Text
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE stripPrefix #-}
commonPrefixes :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe (T.Text, T.Text, T.Text)
commonPrefixes :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe (Text, Text, Text)
commonPrefixes = Text -> Text -> Maybe (Text, Text, Text)
T.commonPrefixes (Text -> Text -> Maybe (Text, Text, Text))
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Maybe (Text, Text, Text)
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE commonPrefixes #-}
stripSuffix :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe T.Text
stripSuffix :: NonEmptyLazyText -> NonEmptyLazyText -> Maybe Text
stripSuffix = Text -> Text -> Maybe Text
T.stripSuffix (Text -> Text -> Maybe Text)
-> (NonEmptyLazyText -> Text)
-> NonEmptyLazyText
-> NonEmptyLazyText
-> Maybe Text
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` NonEmptyLazyText -> Text
forall a. NonEmpty a -> a
getNonEmpty
{-# INLINE stripSuffix #-}