-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Tools for working with isomorphisms of strings -- -- Haskell has 5 common string types, Text, Lazy Text, ByteString, Lazy -- ByteString, and String ([Char]). Assuming utf8 encoding, we can make -- the pain of these conflicts much less via polymorphism. @package string-isos @version 0.1.0.1 -- | Assuming UTF8 encoding the following types are isomorphic -- --
-- f :: ByteString -> ByteString -- a :: Text -- as f a :: Text --as :: forall a b. (Iso a b, Iso b a) => (a -> a) -> b -> b -- | Like liftA2 as2 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a) -> b -> b -> b -- | Like liftA3 as3 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a) -> b -> b -> b -> b -- | Like liftA4 as4 :: forall a b. (Iso a b, Iso b a) => (a -> a -> a -> a -> a) -> b -> b -> b -> b -> b instance Data.String.IsString s => Data.Types.Injective.Injective GHC.Base.String s instance Data.Types.Injective.Injective Data.ByteString.Internal.ByteString GHC.Base.String instance Data.Types.Injective.Injective GHC.Base.String Data.ByteString.Internal.ByteString instance Data.Types.Isomorphic.Iso GHC.Base.String Data.ByteString.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Internal.ByteString GHC.Base.String instance Data.Types.Injective.Injective Data.ByteString.Lazy.Internal.ByteString GHC.Base.String instance Data.Types.Injective.Injective GHC.Base.String Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Isomorphic.Iso GHC.Base.String Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Lazy.Internal.ByteString GHC.Base.String instance Data.Types.Injective.Injective Data.Text.Internal.Text Data.ByteString.Internal.ByteString instance Data.Types.Injective.Injective Data.ByteString.Internal.ByteString Data.Text.Internal.Text instance Data.Types.Isomorphic.Iso Data.Text.Internal.Text Data.ByteString.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Internal.ByteString Data.Text.Internal.Text instance Data.Types.Injective.Injective Data.Text.Internal.Text Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Injective.Injective Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Text instance Data.Types.Isomorphic.Iso Data.Text.Internal.Text Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Text instance Data.Types.Injective.Injective Data.Text.Internal.Lazy.Text Data.ByteString.Internal.ByteString instance Data.Types.Injective.Injective Data.ByteString.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.Types.Isomorphic.Iso Data.Text.Internal.Lazy.Text Data.ByteString.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.Types.Injective.Injective Data.Text.Internal.Lazy.Text Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Injective.Injective Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.Types.Isomorphic.Iso Data.Text.Internal.Lazy.Text Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.Types.Injective.Injective Data.ByteString.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Injective.Injective Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString instance Data.Types.Isomorphic.Iso Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Internal.ByteString -- | Many of the common things we want to do with String like structures -- are just properties of MonoFoldable. This module provides a classes -- for MonoFoldables that contain Char as Stringlike structures. -- -- The motivation here is to have re-usable functions abstracted over -- common things we get from Foldable. The reason we can't just use the -- mono-traversable package, is that it's ByteString instances are -- MonoFoldables containing Word8, an the goal here is to -- normalize the API around Char. -- -- For example: -- --
-- isFiveChars :: FoldableString s => s -> Bool -- isFiveChars s = length s == 5 ---- -- Which will work with all 5 string types -- -- The motivation here is to have re-usable functions abstracted over -- common things we get from Foldable. -- -- For example: -- --
-- isFiveChars :: FoldableString s => s -> Bool -- isFiveChars s = length s == 5 ---- -- Which will work with all 5 string types. . module Text.Foldable -- | MonoFunctor containing Char class FunctorString s map :: FunctorString s => (Char -> Char) -> s -> s map :: (FunctorString s, MonoFunctor s, Element s ~ Char) => (Char -> Char) -> s -> s -- | MonoFoldable containing Char class FoldableString s foldMap :: FoldableString s => (Char -> s) -> s -> s foldMap :: (FoldableString s, MonoFoldable s, Element s ~ Char, Monoid s) => (Char -> s) -> s -> s foldr :: FoldableString s => (Char -> a -> a) -> a -> s -> a foldr :: (FoldableString s, MonoFoldable s, Element s ~ Char) => (Char -> a -> a) -> a -> s -> a foldl' :: FoldableString s => (a -> Char -> a) -> a -> s -> a foldl' :: (FoldableString s, MonoFoldable s, Element s ~ Char) => (a -> Char -> a) -> a -> s -> a all :: FoldableString s => (Char -> Bool) -> s -> Bool all :: (FoldableString s, MonoFoldable s, Element s ~ Char) => (Char -> Bool) -> s -> Bool any :: FoldableString s => (Char -> Bool) -> s -> Bool any :: (FoldableString s, MonoFoldable s, Element s ~ Char) => (Char -> Bool) -> s -> Bool null :: FoldableString s => s -> Bool null :: (FoldableString s, (MonoFoldable s)) => s -> Bool length :: FoldableString s => s -> Int length :: (FoldableString s, (MonoFoldable s)) => s -> Int elem :: FoldableString s => Char -> s -> Bool elem :: (FoldableString s, MonoFoldable s, Element s ~ Char) => Char -> s -> Bool maximum :: FoldableString s => s -> Char maximum :: (FoldableString s, MonoFoldable s, Element s ~ Char) => s -> Char minimum :: FoldableString s => s -> Char minimum :: (FoldableString s, MonoFoldable s, Element s ~ Char) => s -> Char -- | MonoTraversable containing Char class (FunctorString s, FoldableString s) => TraverseString s traverse :: (TraverseString s, Applicative f) => (Char -> f Char) -> s -> f s traverse :: (TraverseString s, MonoTraversable s, Element s ~ Char, Applicative f) => (Char -> f Char) -> s -> f s instance Text.Foldable.TraverseString GHC.Base.String instance Text.Foldable.TraverseString Data.Text.Internal.Text instance Text.Foldable.TraverseString Data.Text.Internal.Lazy.Text instance Text.Foldable.TraverseString Data.ByteString.Internal.ByteString instance Text.Foldable.TraverseString Data.ByteString.Lazy.Internal.ByteString instance Text.Foldable.FoldableString GHC.Base.String instance Text.Foldable.FoldableString Data.Text.Internal.Text instance Text.Foldable.FoldableString Data.Text.Internal.Lazy.Text instance Text.Foldable.FoldableString Data.ByteString.Internal.ByteString instance Text.Foldable.FoldableString Data.ByteString.Lazy.Internal.ByteString instance Text.Foldable.FunctorString GHC.Base.String instance Text.Foldable.FunctorString Data.Text.Internal.Text instance Text.Foldable.FunctorString Data.Text.Internal.Lazy.Text instance Text.Foldable.FunctorString Data.ByteString.Internal.ByteString instance Text.Foldable.FunctorString Data.ByteString.Lazy.Internal.ByteString