-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An experimental Utf8 parsing toolkit for enumerated types -- -- An experimental Utf8 rendering and parsing toolkit for enumerated -- types based on enum-text and render-utf8. Please see the README on -- GitHub at https://github.com/cdornan/enum-text#readme @package enum-utf8 @version 0.1.0.0 module Text.Enum.Utf8 -- | our toolkit for enumerated types which should be defined as follows: -- --
--   import Text.Enum.Utf8
--   import Text.Utf8
--   
--   data Foo = FOO_bar | FOO_bar_baz
--     deriving (Bounded,Enum,Eq,Ord,Show)
--   
--   instance EnumUtf8     Foo
--   instance Renderable   Foo where render    = renderEnumUtf8
--   instance Utf8Parsable Foo where parseUtf8 = parseEnumUtf8
--   
--   main :: IO ()
--   main = mapM_ (cvtLn . render) [minBound..maxBound::Foo]
--   
class (Renderable e, Bounded e, Enum e, Eq e, Ord e, Show e, Utf8Parsable e) => EnumUtf8 e -- | Configures the textual representation of e generated by -- renderEnumUtf8. configEnumUtf8 :: EnumUtf8 e => e -> EnumUtf8Config -- | Generate the standard textual representation according to -- configEnumUtf8 by default. renderEnumUtf8 :: EnumUtf8 e => e -> Utf8 -- | Parses an e according to the renderEnumUtf8 render. parseEnumUtf8 :: EnumUtf8 e => Utf8 -> Possibly e -- | A cassava field encoder, using 'the renderEnumUtf8' format. toFieldEnumUtf8 :: EnumUtf8 e => e -> ByteString -- | A cassava field parser using the renderEnumUtf8 format. fromFieldEnumUtf8_ :: (EnumUtf8 e, Monad m) => ByteString -> m e -- | For hashing e with the renderEnumUtf8 representation. hashWithSaltEnumUtf8 :: EnumUtf8 e => Int -> e -> Int -- | a class for Text parsers. class Utf8Parsable a parseUtf8 :: Utf8Parsable a => Utf8 -> Possibly a -- | configures the default implementation of renderEnumUtf8 data EnumUtf8Config EnumUtf8Config :: (String -> String) -> (Char -> Char) -> EnumUtf8Config -- | applied to the output of show; by default strips each data -- constructor up to and including the first '_' [_etc_text_prep] :: EnumUtf8Config -> String -> String -- | applied to each character of the outpout of _etc_text_prep [_etc_char_prep] :: EnumUtf8Config -> Char -> Char defaultEnumUtf8Config :: EnumUtf8Config instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.Enum.Utf8.I a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Enum.Utf8.I a) instance Text.Enum.Utf8.EnumUtf8 e => GHC.Arr.Ix (Text.Enum.Utf8.I e)