Copyright | (c) Christian Gram Kalhauge 2019 |
---|---|
License | MIT |
Maintainer | kalhuage@cs.ucla.edu |
Safe Haskell | None |
Language | Haskell2010 |
This module can parse and serialize text to structures
Synopsis
- class TextSerializable a where
- deserializeWith :: Parser a -> Text -> Either String a
- serializeWith :: (a -> Builder) -> a -> Text
- showViaTextSerializable :: TextSerializable a => a -> String
- fromStringViaTextSerializable :: TextSerializable a => String -> a
- deriveFromTextSerializable :: Name -> Q [Dec]
Documentation
class TextSerializable a where Source #
A class that indicates that something can be turned from and to text.
parseText :: Parser a Source #
A TypeParse
should be parsable
toBuilder :: a -> Builder Source #
A TypeParse
should be printable
deserialize :: Text -> Either String a Source #
Parse a type from text
serialize :: a -> Text Source #
Print a type from text
Instances
serializeWith :: (a -> Builder) -> a -> Text Source #
Print a type from text
showViaTextSerializable :: TextSerializable a => a -> String Source #
fromStringViaTextSerializable :: TextSerializable a => String -> a Source #