-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A text rendering and parsing toolkit for enumerated types -- -- A text rendering and parsing toolkit for enumerated types. Please see -- the README on GitHub at -- https://github.com/cdornan/enum-text#readme @package enum-text @version 0.5.0.0 module Text.Enum.Text -- | Our toolkit for enumerated types which should be defined as follows: -- --
--   import Fmt
--   import Text.Enum.Text
--   
--   data Foo = FOO_bar | FOO_bar_baz
--     deriving (Bounded,Enum,Eq,Ord,Show)
--   
--   instance EnumText     Foo
--   instance Buildable    Foo where build     = buildEnumText
--   instance TextParsable Foo where parseText = parseEnumText
--   
class (Buildable e, Bounded e, Enum e, Eq e, Ord e, Show e, TextParsable e) => EnumText e -- | Configures the textual representation of e generated by -- renderEnumText. configEnumText :: EnumText e => e -> EnumTextConfig -- | Generate the standard textual representation according to -- configEnumText by default. renderEnumText :: EnumText e => e -> Text -- | Sames as renderEnumText, but generating a Builder. buildEnumText :: EnumText e => e -> Builder -- | Parses an e according to the renderEnumText render. parseEnumText :: EnumText e => Text -> Possibly e -- | A cassava field encoder, using 'the renderEnumText' format. toFieldEnumText :: EnumText e => e -> ByteString -- | A cassava field parser using the renderEnumText format. fromFieldEnumText_ :: (EnumText e, Monad m) => ByteString -> m e -- | For hashing e with the renderEnumText representation. hashWithSaltEnumText :: EnumText e => Int -> e -> Int -- | a class for Text parsers. class TextParsable a parseText :: TextParsable a => Text -> Possibly a -- | Configures the default implementation of renderEnumText data EnumTextConfig EnumTextConfig :: (Text -> Text) -> (Char -> Char) -> EnumTextConfig -- | applied to the output of show once converted to Text; by -- default strips each data constructor up to and including the first '_' [_etc_text_prep] :: EnumTextConfig -> Text -> Text -- | applied to each character of the outpout of _etc_text_prep (by -- default flips underscores (_) to dashes (-) [_etc_char_prep] :: EnumTextConfig -> Char -> Char -- | The default configEnumText for EnumText: -- -- defaultEnumTextConfig :: EnumTextConfig instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.Enum.Text.I a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Enum.Text.I a) instance Text.Enum.Text.EnumText e => GHC.Arr.Ix (Text.Enum.Text.I e) instance Text.Enum.Text.TextParsable Data.Text.Internal.Text instance Text.Enum.Text.TextParsable Data.Time.Clock.Internal.UTCTime.UTCTime instance Text.Enum.Text.TextParsable Data.Time.Calendar.Days.Day instance Text.Enum.Text.TextParsable GHC.Types.Int instance (a Data.Type.Equality.~ GHC.Types.Char) => Text.Enum.Text.TextParsable [a] instance Text.Enum.Text.TextParsable a => Text.Enum.Text.TextParsable (GHC.Maybe.Maybe a)