dhall-1.42.3: A configuration language guaranteed to terminate

Safe Haskell | None
Language | Haskell2010

Dhall.Binary

Contents

- Encoding and decoding
- Exceptions
- Orphan instances

Description

This module contains logic for converting Dhall expressions to and from CBOR expressions which can in turn be converted to and from a binary representation

Synopsis

- encodeExpression :: Serialise (Expr Void a) => Expr Void a -> ByteString
- decodeExpression :: Serialise (Expr s a) => ByteString -> Either DecodingFailure (Expr s a)
- newtype DecodingFailure = CBORIsNotDhall ByteString

# Encoding and decoding

encodeExpression :: Serialise (Expr Void a) => Expr Void a -> ByteString Source #

Encode a Dhall expression as a CBOR-encoded `ByteString`

decodeExpression :: Serialise (Expr s a) => ByteString -> Either DecodingFailure (Expr s a) Source #

Decode a Dhall expression from a CBOR `Term`

# Exceptions

newtype DecodingFailure Source #

This indicates that a given CBOR-encoded `ByteString` did not correspond to a valid Dhall expression

Constructors

CBORIsNotDhall ByteString |

#### Instances

Instances details

Exception DecodingFailure Source # |
Instance details Defined in Dhall.Binary Methods toException :: DecodingFailure -> SomeException Source # fromException :: SomeException -> Maybe DecodingFailure Source # displayException :: DecodingFailure -> String Source # backtraceDesired :: DecodingFailure -> Bool Source #
Show DecodingFailure Source # |
Instance details Defined in Dhall.Binary Methods showsPrec :: Int -> DecodingFailure -> ShowS Source # show :: DecodingFailure -> String Source # showList :: [DecodingFailure] -> ShowS Source #
Eq DecodingFailure Source # |
Instance details Defined in Dhall.Binary Methods (==) :: DecodingFailure -> DecodingFailure -> Bool Source # (/=) :: DecodingFailure -> DecodingFailure -> Bool Source #

# Orphan instances

Serialise (Expr Void Import) Source # |
Instance details Methods encode :: Expr Void Import -> Encoding Source # decode :: Decoder s (Expr Void Import) Source # encodeList :: [Expr Void Import] -> Encoding Source # decodeList :: Decoder s [Expr Void Import] Source #
Serialise (Expr Void Void) Source # |
Instance details Methods encode :: Expr Void Void -> Encoding Source # decode :: Decoder s (Expr Void Void) Source # encodeList :: [Expr Void Void] -> Encoding Source # decodeList :: Decoder s [Expr Void Void] Source #