-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Subclasses of Monoid -- -- This package defines a hierarchy of subclasses of Monoid -- together with their instances for all data structures from base, -- containers, and text packages. @package monoid-subclasses @version 0.3 -- | This module defines the MonoidNull class and some of its instances. module Data.Monoid.Null -- | Extension of Monoid that allows testing a value for equality -- with mempty. The following law must hold: -- --
--   null x == (x == mempty)
--   
-- -- Furthermore, the performance of this method should be constant, -- i.e., independent of the length of its argument. class Monoid m => MonoidNull m null :: MonoidNull m => m -> Bool instance MonoidNull (Vector a) instance Ord a => MonoidNull (Set a) instance MonoidNull (Seq a) instance MonoidNull IntSet instance MonoidNull (IntMap v) instance Ord k => MonoidNull (Map k v) instance MonoidNull Text instance MonoidNull Text instance MonoidNull ByteString instance MonoidNull ByteString instance MonoidNull [x] instance (MonoidNull a, MonoidNull b) => MonoidNull (a, b) instance Monoid a => MonoidNull (Maybe a) instance (Num a, Eq a) => MonoidNull (Product a) instance (Num a, Eq a) => MonoidNull (Sum a) instance MonoidNull a => MonoidNull (Dual a) instance MonoidNull (Last a) instance MonoidNull (First a) instance MonoidNull Any instance MonoidNull All instance MonoidNull Ordering instance MonoidNull () -- | This module defines the FactorialMonoid class and some of its -- instances. module Data.Monoid.Factorial -- | Class of monoids that can be split into irreducible (i.e., -- atomic or prime) factors in a unique way. Factors of a -- Product are literally its prime factors: -- --
--   factors (Product 12) == [Product 2, Product 2, Product 3]
--   
-- -- Factors of a list are not its elements but all its single-item -- sublists: -- --
--   factors "abc" == ["a", "b", "c"]
--   
-- -- The methods of this class satisfy the following laws: -- --
--   mconcat . factors == id
--   null == List.null . factors
--   List.all (\prime-> factors prime == [prime]) . factors
--   factors == unfoldr splitPrimePrefix == List.reverse . unfoldr (fmap swap . splitPrimeSuffix)
--   reverse == mconcat . List.reverse . factors
--   primePrefix == maybe mempty fst . splitPrimePrefix
--   primeSuffix == maybe mempty snd . splitPrimeSuffix
--   foldl f a == List.foldl f a . factors
--   foldl' f a == List.foldl' f a . factors
--   foldr f a == List.foldr f a . factors
--   span p m == (mconcat l, mconcat r) where (l, r) = List.span p (factors m)
--   List.all (List.all (not . pred) . factors) . split pred
--   mconcat . intersperse prime . split (== prime) == id
--   splitAt i m == (mconcat l, mconcat r) where (l, r) = List.splitAt i (factors m)
--   
-- -- It's worth noting that a class instance does not need to -- satisfy this law: -- --
--   factors (a <> b) == factors a <> factors b
--   
-- -- A minimal instance definition must implement factors or -- splitPrimePrefix. Other methods are provided and should be -- implemented only for performance reasons. class MonoidNull m => FactorialMonoid m where factors = unfoldr splitPrimePrefix primePrefix = maybe mempty fst . splitPrimePrefix primeSuffix = maybe mempty snd . splitPrimeSuffix splitPrimePrefix x = case factors x of { [] -> Nothing prefix : rest -> Just (prefix, mconcat rest) } splitPrimeSuffix x = case factors x of { [] -> Nothing fs -> Just (mconcat (init fs), last fs) } foldl f f0 = foldl f f0 . factors foldl' f f0 = foldl' f f0 . factors foldr f f0 = foldr f f0 . factors length = length . factors foldMap f = foldr (mappend . f) mempty span p m = spanAfter id m where spanAfter f m = case splitPrimePrefix m of { Just (prime, rest) | p prime -> spanAfter (f . mappend prime) rest _ -> (f mempty, m) } break = span . (not .) split p m = prefix : splitRest where (prefix, rest) = break p m splitRest = case splitPrimePrefix rest of { Nothing -> [] Just (_, tail) -> split p tail } takeWhile p = fst . span p dropWhile p = snd . span p splitAt n m | n <= 0 = (mempty, m) | otherwise = split n id m where split 0 f m = (f mempty, m) split n f m = case splitPrimePrefix m of { Nothing -> (f mempty, m) Just (prime, rest) -> split (pred n) (f . mappend prime) rest } drop n p = snd (splitAt n p) take n p = fst (splitAt n p) reverse = mconcat . reverse . factors factors :: FactorialMonoid m => m -> [m] primePrefix :: FactorialMonoid m => m -> m primeSuffix :: FactorialMonoid m => m -> m splitPrimePrefix :: FactorialMonoid m => m -> Maybe (m, m) splitPrimeSuffix :: FactorialMonoid m => m -> Maybe (m, m) foldl :: FactorialMonoid m => (a -> m -> a) -> a -> m -> a foldl' :: FactorialMonoid m => (a -> m -> a) -> a -> m -> a foldr :: FactorialMonoid m => (m -> a -> a) -> a -> m -> a length :: FactorialMonoid m => m -> Int foldMap :: (FactorialMonoid m, FactorialMonoid m, Monoid n) => (m -> n) -> m -> n span :: FactorialMonoid m => (m -> Bool) -> m -> (m, m) break :: (FactorialMonoid m, FactorialMonoid m) => (m -> Bool) -> m -> (m, m) split :: FactorialMonoid m => (m -> Bool) -> m -> [m] takeWhile :: (FactorialMonoid m, FactorialMonoid m) => (m -> Bool) -> m -> m dropWhile :: (FactorialMonoid m, FactorialMonoid m) => (m -> Bool) -> m -> m splitAt :: FactorialMonoid m => Int -> m -> (m, m) drop :: (FactorialMonoid m, FactorialMonoid m) => Int -> m -> m take :: (FactorialMonoid m, FactorialMonoid m) => Int -> m -> m reverse :: (FactorialMonoid m, FactorialMonoid m) => m -> m -- | A mapM equivalent. mapM :: (FactorialMonoid a, Monoid b, Monad m) => (a -> m b) -> a -> m b -- | A mapM_ equivalent. mapM_ :: (FactorialMonoid a, Monad m) => (a -> m b) -> a -> m () instance FactorialMonoid (Vector a) instance Ord a => FactorialMonoid (Set a) instance FactorialMonoid (Seq a) instance FactorialMonoid IntSet instance FactorialMonoid (IntMap a) instance Ord k => FactorialMonoid (Map k v) instance FactorialMonoid Text instance FactorialMonoid Text instance FactorialMonoid ByteString instance FactorialMonoid ByteString instance FactorialMonoid [x] instance (FactorialMonoid a, FactorialMonoid b) => FactorialMonoid (a, b) instance FactorialMonoid a => FactorialMonoid (Maybe a) instance Integral a => FactorialMonoid (Product a) instance (Integral a, Eq a) => FactorialMonoid (Sum a) instance FactorialMonoid a => FactorialMonoid (Dual a) instance FactorialMonoid () -- | This module defines the Monoid => ReductiveMonoid -- => (CancellativeMonoid, GCDMonoid) class hierarchy. -- -- The ReductiveMonoid class introduces operation </> -- which is the inverse of <>. For the Sum monoid, -- this operation is subtraction; for Product it is division and -- for Set it's the set difference. A ReductiveMonoid is -- not a full group because </> may return Nothing. -- -- The CancellativeMonoid subclass does not add any operation but -- it provides the additional guarantee that <> can always -- be undone with </>. Thus Sum is a -- CancellativeMonoid but Product is not because -- (0*n)/0 is not defined. -- -- The GCDMonoid subclass adds the gcd operation which -- takes two monoidal arguments and finds their greatest common divisor, -- or (more generally) the greatest monoid that can be extracted with the -- </> operation from both. -- -- All monoid subclasses listed above are for Abelian, i.e., -- commutative or symmetric monoids. Since most practical monoids in -- Haskell are not Abelian, each of the these classes has two symmetric -- superclasses: -- -- module Data.Monoid.Cancellative -- | Class of all Abelian ({i.e.}, commutative) monoids that satisfy the -- commutativity property: -- --
--   a <> b == b <> a
--   
class Monoid m => CommutativeMonoid m -- | Class of Abelian monoids with a partial inverse for the Monoid -- <> operation. The inverse operation </> -- must satisfy the following laws: -- --
--   maybe a (b <>) (a </> b) == a
--   maybe a (<> b) (a </> b) == a
--   
class (CommutativeMonoid m, LeftReductiveMonoid m, RightReductiveMonoid m) => ReductiveMonoid m () :: ReductiveMonoid m => m -> m -> Maybe m -- | Subclass of ReductiveMonoid where </> is a -- complete inverse of the Monoid <> operation. The class -- instances must satisfy the following additional laws: -- --
--   (a <> b) </> a == Just b
--   (a <> b) </> b == Just a
--   
class (LeftCancellativeMonoid m, RightCancellativeMonoid m, ReductiveMonoid m) => CancellativeMonoid m -- | Class of Abelian monoids that allow the greatest common denominator to -- be found for any two given values. The operations must satisfy the -- following laws: -- --
--   gcd a b == commonPrefix a b == commonSuffix a b
--   Just a' = a </> p && Just b' = b </> p
--      where p = gcd a b
--   
-- -- If a GCDMonoid happens to also be a CancellativeMonoid, -- it should additionally satisfy the following laws: -- --
--   gcd (a <> b) (a <> c) == a <> gcd b c
--   gcd (a <> c) (b <> c) == gcd a b <> c
--   
class (ReductiveMonoid m, LeftGCDMonoid m, RightGCDMonoid m) => GCDMonoid m gcd :: GCDMonoid m => m -> m -> m -- | Class of monoids with a left inverse of mappend, satisfying the -- following law: -- --
--   isPrefixOf a b == isJust (stripPrefix a b)
--   maybe b (a <>) (stripPrefix a b) == b
--   a `isPrefixOf` (a <> b)
--   
-- -- | Every instance definition has to implement at least the -- stripPrefix method. Its complexity should be no worse than -- linear in the length of the prefix argument. class Monoid m => LeftReductiveMonoid m where isPrefixOf a b = isJust (stripPrefix a b) isPrefixOf :: LeftReductiveMonoid m => m -> m -> Bool stripPrefix :: LeftReductiveMonoid m => m -> m -> Maybe m -- | Class of monoids with a right inverse of mappend, satisfying -- the following law: -- --
--   isSuffixOf a b == isJust (stripSuffix a b)
--   maybe b (<> a) (stripSuffix a b) == b
--   b `isSuffixOf` (a <> b)
--   
-- -- | Every instance definition has to implement at least the -- stripSuffix method. Its complexity should be no worse than -- linear in the length of the suffix argument. class Monoid m => RightReductiveMonoid m where isSuffixOf a b = isJust (stripSuffix a b) isSuffixOf :: RightReductiveMonoid m => m -> m -> Bool stripSuffix :: RightReductiveMonoid m => m -> m -> Maybe m -- | Subclass of LeftReductiveMonoid where stripPrefix is a -- complete inverse of <>, satisfying the following -- additional law: -- --
--   stripPrefix a (a <> b) == Just b
--   
class LeftReductiveMonoid m => LeftCancellativeMonoid m -- | Subclass of LeftReductiveMonoid where stripPrefix is a -- complete inverse of <>, satisfying the following -- additional law: -- --
--   stripSuffix b (a <> b) == Just a
--   
class RightReductiveMonoid m => RightCancellativeMonoid m -- | Class of monoids capable of finding the equivalent of greatest common -- divisor on the left side of two monoidal values. The methods' -- complexity should be no worse than linear in the length of the common -- prefix. The following laws must be respected: -- --
--   stripCommonPrefix a b == (p, a', b')
--      where p = commonPrefix a b
--            Just a' = stripPrefix p a
--            Just b' = stripPrefix p b
--   p == commonPrefix a b && p <> a' == a && p <> b' == b
--      where (p, a', b') = stripCommonPrefix a b
--   
class LeftReductiveMonoid m => LeftGCDMonoid m where commonPrefix x y = p where (p, _, _) = stripCommonPrefix x y stripCommonPrefix x y = (p, x', y') where p = commonPrefix x y Just x' = stripPrefix p x Just y' = stripPrefix p y commonPrefix :: LeftGCDMonoid m => m -> m -> m stripCommonPrefix :: LeftGCDMonoid m => m -> m -> (m, m, m) -- | Class of monoids capable of finding the equivalent of greatest common -- divisor on the right side of two monoidal values. The methods' -- complexity must be no worse than linear in the length of the common -- suffix. The following laws must be respected: -- --
--   stripCommonSuffix a b == (a', b', s)
--      where s = commonSuffix a b
--            Just a' = stripSuffix p a
--            Just b' = stripSuffix p b
--   s == commonSuffix a b && a' <> s == a && b' <> s == b
--      where (a', b', s) = stripCommonSuffix a b
--   
class RightReductiveMonoid m => RightGCDMonoid m where commonSuffix x y = s where (_, _, s) = stripCommonSuffix x y stripCommonSuffix x y = (x', y', s) where s = commonSuffix x y Just x' = stripSuffix s x Just y' = stripSuffix s y commonSuffix :: RightGCDMonoid m => m -> m -> m stripCommonSuffix :: RightGCDMonoid m => m -> m -> (m, m, m) instance LeftGCDMonoid Text instance RightCancellativeMonoid Text instance LeftCancellativeMonoid Text instance RightReductiveMonoid Text instance LeftReductiveMonoid Text instance LeftGCDMonoid Text instance RightCancellativeMonoid Text instance LeftCancellativeMonoid Text instance RightReductiveMonoid Text instance LeftReductiveMonoid Text instance RightGCDMonoid ByteString instance LeftGCDMonoid ByteString instance RightCancellativeMonoid ByteString instance LeftCancellativeMonoid ByteString instance RightReductiveMonoid ByteString instance LeftReductiveMonoid ByteString instance RightGCDMonoid ByteString instance LeftGCDMonoid ByteString instance RightCancellativeMonoid ByteString instance LeftCancellativeMonoid ByteString instance RightReductiveMonoid ByteString instance LeftReductiveMonoid ByteString instance Eq a => RightGCDMonoid (Vector a) instance Eq a => LeftGCDMonoid (Vector a) instance Eq a => RightCancellativeMonoid (Vector a) instance Eq a => LeftCancellativeMonoid (Vector a) instance Eq a => RightReductiveMonoid (Vector a) instance Eq a => LeftReductiveMonoid (Vector a) instance Eq a => RightGCDMonoid (Seq a) instance Eq a => LeftGCDMonoid (Seq a) instance Eq a => RightCancellativeMonoid (Seq a) instance Eq a => LeftCancellativeMonoid (Seq a) instance Eq a => RightReductiveMonoid (Seq a) instance Eq a => LeftReductiveMonoid (Seq a) instance Eq x => LeftGCDMonoid [x] instance Eq x => LeftCancellativeMonoid [x] instance Eq x => LeftReductiveMonoid [x] instance Eq a => LeftGCDMonoid (IntMap a) instance LeftReductiveMonoid (IntMap a) instance (Ord k, Eq a) => LeftGCDMonoid (Map k a) instance Ord k => LeftReductiveMonoid (Map k a) instance GCDMonoid IntSet instance RightGCDMonoid IntSet instance LeftGCDMonoid IntSet instance ReductiveMonoid IntSet instance RightReductiveMonoid IntSet instance LeftReductiveMonoid IntSet instance CommutativeMonoid IntSet instance Ord a => GCDMonoid (Set a) instance Ord a => RightGCDMonoid (Set a) instance Ord a => LeftGCDMonoid (Set a) instance Ord a => ReductiveMonoid (Set a) instance Ord a => RightReductiveMonoid (Set a) instance Ord a => LeftReductiveMonoid (Set a) instance Ord a => CommutativeMonoid (Set a) instance (RightGCDMonoid a, RightGCDMonoid b) => RightGCDMonoid (a, b) instance (LeftGCDMonoid a, LeftGCDMonoid b) => LeftGCDMonoid (a, b) instance (RightCancellativeMonoid a, RightCancellativeMonoid b) => RightCancellativeMonoid (a, b) instance (LeftCancellativeMonoid a, LeftCancellativeMonoid b) => LeftCancellativeMonoid (a, b) instance (RightReductiveMonoid a, RightReductiveMonoid b) => RightReductiveMonoid (a, b) instance (LeftReductiveMonoid a, LeftReductiveMonoid b) => LeftReductiveMonoid (a, b) instance (GCDMonoid a, GCDMonoid b) => GCDMonoid (a, b) instance (CancellativeMonoid a, CancellativeMonoid b) => CancellativeMonoid (a, b) instance (ReductiveMonoid a, ReductiveMonoid b) => ReductiveMonoid (a, b) instance (CommutativeMonoid a, CommutativeMonoid b) => CommutativeMonoid (a, b) instance Integral a => RightGCDMonoid (Product a) instance Integral a => LeftGCDMonoid (Product a) instance Integral a => RightReductiveMonoid (Product a) instance Integral a => LeftReductiveMonoid (Product a) instance Integral a => GCDMonoid (Product a) instance Integral a => ReductiveMonoid (Product a) instance Num a => CommutativeMonoid (Product a) instance (Integral a, Ord a) => RightGCDMonoid (Sum a) instance (Integral a, Ord a) => LeftGCDMonoid (Sum a) instance Integral a => RightCancellativeMonoid (Sum a) instance Integral a => LeftCancellativeMonoid (Sum a) instance Integral a => RightReductiveMonoid (Sum a) instance Integral a => LeftReductiveMonoid (Sum a) instance (Integral a, Ord a) => GCDMonoid (Sum a) instance Integral a => CancellativeMonoid (Sum a) instance Integral a => ReductiveMonoid (Sum a) instance Num a => CommutativeMonoid (Sum a) instance RightGCDMonoid a => LeftGCDMonoid (Dual a) instance LeftGCDMonoid a => RightGCDMonoid (Dual a) instance RightCancellativeMonoid a => LeftCancellativeMonoid (Dual a) instance LeftCancellativeMonoid a => RightCancellativeMonoid (Dual a) instance RightReductiveMonoid a => LeftReductiveMonoid (Dual a) instance LeftReductiveMonoid a => RightReductiveMonoid (Dual a) instance GCDMonoid a => GCDMonoid (Dual a) instance CancellativeMonoid a => CancellativeMonoid (Dual a) instance ReductiveMonoid a => ReductiveMonoid (Dual a) instance CommutativeMonoid a => CommutativeMonoid (Dual a) instance RightGCDMonoid () instance LeftGCDMonoid () instance RightCancellativeMonoid () instance LeftCancellativeMonoid () instance RightReductiveMonoid () instance LeftReductiveMonoid () instance GCDMonoid () instance CancellativeMonoid () instance ReductiveMonoid () instance CommutativeMonoid () -- | This module defines the TextualMonoid class and its most -- important instances for String and Text. module Data.Monoid.Textual -- | The TextualMonoid class is an extension of -- FactorialMonoid specialized for monoids that can contain -- characters. Its methods are generally equivalent to their namesake -- functions from Data.List and Data.Text, and they satisfy -- the following laws: -- --
--   splitCharacterPrefix (singleton c <> t) == Just (c, t)
--   splitCharacterPrefix . primePrefix == fmap (\(c, t)-> (c, mempty)) . splitCharacterPrefix
--   
--   map f . fromString == fromString . List.map f
--   concatMap (fromString . f) . fromString == fromString . List.concatMap f
--   
--   foldl  ft fc a . fromString == List.foldl  fc a
--   foldr  ft fc a . fromString == List.foldr  fc a
--   foldl' ft fc a . fromString == List.foldl' fc a
--   
--   scanl f c . fromString == fromString . List.scanl f c
--   scanr f c . fromString == fromString . List.scanr f c
--   mapAccumL f a . fromString == fmap fromString . List.mapAccumL f a
--   mapAccumL f a . fromString == fmap fromString . List.mapAccumL f a
--   
--   takeWhile pt pc . fromString == fromString . takeWhile pc
--   dropWhile pt pc . fromString == fromString . dropWhile pc
--   
--   mconcat . intersperse (singleton c) . split (== c) == id
--   find p . fromString == List.find p
--   
-- -- A TextualMonoid may contain non-character data insterspersed -- between its characters. Every class method that returns a modified -- TextualMonoid instance generally preserves this non-character -- data. All of the following expressions are identities: -- --
--   map id
--   concatMap singleton
--   foldl  (<>) (\a c-> a <> singleton c) mempty
--   foldr  (<>) ((<>) . singleton) mempty
--   foldl' (<>) (\a c-> a <> singleton c) mempty
--   scanl1 (const id)
--   scanr1 const
--   uncurry (mapAccumL (,))
--   uncurry (mapAccumR (,))
--   takeWhile (const True) (const True)
--   dropWhile (const False) (const False)
--   
-- -- A minimal instance definition must implement -- splitCharacterPrefix. class (IsString t, LeftReductiveMonoid t, LeftGCDMonoid t, FactorialMonoid t) => TextualMonoid t where fromText = fromString . unpack singleton = fromString . (: []) characterPrefix = fmap fst . splitCharacterPrefix map f = concatMap (singleton . f) concatMap f = foldr mappend (mappend . f) mempty all p = foldr (const id) ((&&) . p) True any p = foldr (const id) ((||) . p) False foldl ft fc = foldl (\ a prime -> maybe (ft a prime) (fc a) (characterPrefix prime)) foldr ft fc = foldr (\ prime -> maybe (ft prime) fc (characterPrefix prime)) foldl' ft fc = foldl' (\ a prime -> maybe (ft a prime) (fc a) (characterPrefix prime)) scanl f c = mappend (singleton c) . fst . foldl foldlOther (foldlChars f) (mempty, c) scanl1 f t = case (splitPrimePrefix t, splitCharacterPrefix t) of { (Nothing, _) -> t (Just (prefix, suffix), Nothing) -> mappend prefix (scanl1 f suffix) (Just _, Just (c, suffix)) -> scanl f c suffix } scanr f c = fst . foldr foldrOther (foldrChars f) (singleton c, c) scanr1 f = fst . foldr foldrOther fc (mempty, Nothing) where fc c (t, Nothing) = (mappend (singleton c) t, Just c) fc c1 (t, Just c2) = (mappend (singleton c') t, Just c') where c' = f c1 c2 mapAccumL f a0 = foldl ft fc (a0, mempty) where ft (a, t1) t2 = (a, mappend t1 t2) fc (a, t) c = (a', mappend t (singleton c')) where (a', c') = f a c mapAccumR f a0 = foldr ft fc (a0, mempty) where ft t1 (a, t2) = (a, mappend t1 t2) fc c (a, t) = (a', mappend (singleton c') t) where (a', c') = f a c takeWhile pt pc = fst . span pt pc dropWhile pt pc = snd . span pt pc span pt pc = span (\ prime -> maybe (pt prime) pc (characterPrefix prime)) break pt pc = break (\ prime -> maybe (pt prime) pc (characterPrefix prime)) split p m = prefix : splitRest where (prefix, rest) = break (const False) p m splitRest = case splitCharacterPrefix rest of { Nothing -> [] Just (_, tail) -> split p tail } find p = foldr (const id) (\ c r -> if p c then Just c else r) Nothing fromText :: TextualMonoid t => Text -> t singleton :: TextualMonoid t => Char -> t splitCharacterPrefix :: TextualMonoid t => t -> Maybe (Char, t) characterPrefix :: TextualMonoid t => t -> Maybe Char map :: TextualMonoid t => (Char -> Char) -> t -> t concatMap :: TextualMonoid t => (Char -> t) -> t -> t any :: TextualMonoid t => (Char -> Bool) -> t -> Bool all :: TextualMonoid t => (Char -> Bool) -> t -> Bool foldl :: TextualMonoid t => (a -> t -> a) -> (a -> Char -> a) -> a -> t -> a foldl' :: TextualMonoid t => (a -> t -> a) -> (a -> Char -> a) -> a -> t -> a foldr :: TextualMonoid t => (t -> a -> a) -> (Char -> a -> a) -> a -> t -> a scanl :: TextualMonoid t => (Char -> Char -> Char) -> Char -> t -> t scanl1 :: TextualMonoid t => (Char -> Char -> Char) -> t -> t scanr :: TextualMonoid t => (Char -> Char -> Char) -> Char -> t -> t scanr1 :: TextualMonoid t => (Char -> Char -> Char) -> t -> t mapAccumL :: TextualMonoid t => (a -> Char -> (a, Char)) -> a -> t -> (a, t) mapAccumR :: TextualMonoid t => (a -> Char -> (a, Char)) -> a -> t -> (a, t) takeWhile :: TextualMonoid t => (t -> Bool) -> (Char -> Bool) -> t -> t dropWhile :: TextualMonoid t => (t -> Bool) -> (Char -> Bool) -> t -> t break :: TextualMonoid t => (t -> Bool) -> (Char -> Bool) -> t -> (t, t) span :: TextualMonoid t => (t -> Bool) -> (Char -> Bool) -> t -> (t, t) split :: TextualMonoid t => (Char -> Bool) -> t -> [t] find :: TextualMonoid t => (Char -> Bool) -> t -> Maybe Char instance TextualMonoid (Vector Char) instance IsString (Vector Char) instance TextualMonoid (Seq Char) instance IsString (Seq Char) instance TextualMonoid Text instance TextualMonoid Text instance TextualMonoid String -- | This module defines the ByteStringUTF8 newtype wrapper around -- ByteString, together with its TextualMonoid instance. module Data.Monoid.Instances.ByteString.UTF8 newtype ByteStringUTF8 ByteStringUTF8 :: ByteString -> ByteStringUTF8 instance Eq ByteStringUTF8 instance Monoid ByteStringUTF8 instance MonoidNull ByteStringUTF8 instance LeftReductiveMonoid ByteStringUTF8 instance LeftCancellativeMonoid ByteStringUTF8 instance LeftGCDMonoid ByteStringUTF8 instance TextualMonoid ByteStringUTF8 instance FactorialMonoid ByteStringUTF8 instance IsString ByteStringUTF8 instance Show ByteStringUTF8