Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Ron.Deserialize
Contents
Description
Ron routines for deserialization. Also exposes the underlying attoparsec parsers if you want to build more complicated consumers of ron, like conduits or pipes
Synopsis
- decode :: FromRon a => ByteString -> Either String a
- decodeLazy :: FromRon a => ByteString -> Either String a
- decodeFile :: FromRon a => FilePath -> IO a
- loads :: ByteString -> Either String Value
- loadsLazy :: ByteString -> Either String Value
- loadFile :: FilePath -> IO Value
- loadFile' :: FilePath -> IO (Either String Value)
- data ParseError
- data DecodeError
- document :: Parser Value
- toplevel :: Parser Value
- value :: Parser Value
- ronWhitespace :: Parser ()
Documentation
decode :: FromRon a => ByteString -> Either String a Source #
Parse a ByteString
to your type. The error is produced by attoparsec and is
not very useful.
decodeLazy :: FromRon a => ByteString -> Either String a Source #
Parse a lazy ByteString
to your type. The error is produced by
attoparsec and is not very useful.
decodeFile :: FromRon a => FilePath -> IO a Source #
Parse file content to your type. Throws ParseError
or DecodeError
on
errors.
loads :: ByteString -> Either String Value Source #
Parse a ByteString
to a Value
. You probably want decode
instead
loadsLazy :: ByteString -> Either String Value Source #
Parse a lazy ByteString
to a Value
. You probably want
decodeLazy
instead
Exceptions
data ParseError Source #
Error parsing ByteString
to Value
Instances
Exception ParseError Source # | |
Defined in Data.Ron.Deserialize Methods toException :: ParseError -> SomeException # fromException :: SomeException -> Maybe ParseError # displayException :: ParseError -> String # | |
Show ParseError Source # | |
Defined in Data.Ron.Deserialize Methods showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # |
data DecodeError Source #
Error parsing Value
to custom type
Instances
Exception DecodeError Source # | |
Defined in Data.Ron.Deserialize Methods toException :: DecodeError -> SomeException # fromException :: SomeException -> Maybe DecodeError # displayException :: DecodeError -> String # | |
Show DecodeError Source # | |
Defined in Data.Ron.Deserialize Methods showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # |
Parsers
document :: Parser Value Source #
A parser for a complete Ron document, consisting of a single value. Expects EOF at the end. Will parse Ron notation, or a toplevel record with no braces, or a toplevel list with no braces; the latter two are ron-hs extensions.