enum-utf8-0.1.0.0: An experimental Utf8 parsing toolkit for enumerated types

Safe HaskellNone
LanguageHaskell2010

Text.Enum.Utf8

Synopsis

Documentation

class (Renderable e, Bounded e, Enum e, Eq e, Ord e, Show e, Utf8Parsable e) => EnumUtf8 e where Source #

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]

Minimal complete definition

Nothing

Methods

configEnumUtf8 :: e -> EnumUtf8Config Source #

Configures the textual representation of e generated by renderEnumUtf8.

renderEnumUtf8 :: e -> Utf8 Source #

Generate the standard textual representation according to configEnumUtf8 by default.

parseEnumUtf8 :: Utf8 -> Possibly e Source #

Parses an e according to the renderEnumUtf8 render.

toFieldEnumUtf8 :: e -> ByteString Source #

A cassava field encoder, using 'the renderEnumUtf8' format.

fromFieldEnumUtf8_ :: Monad m => ByteString -> m e Source #

A cassava field parser using the renderEnumUtf8 format.

hashWithSaltEnumUtf8 :: Int -> e -> Int Source #

For hashing e with the renderEnumUtf8 representation.

class Utf8Parsable a where Source #

a class for Text parsers.

Methods

parseUtf8 :: Utf8 -> Possibly a Source #

data EnumUtf8Config Source #

configures the default implementation of renderEnumUtf8

Constructors

EnumUtf8Config 

Fields