dhall-1.32.0: A configuration language guaranteed to terminate

Safe Haskell | None
Language | Haskell2010

Dhall.Binary

Contents

- Standard versions
- 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

- data StandardVersion
  - = NoVersion
  - | V_5_0_0
  - | V_4_0_0
  - | V_3_0_0
  - | V_2_0_0
  - | V_1_0_0
- renderStandardVersion :: StandardVersion -> Text
- encodeExpression :: Expr Void Import -> ByteString
- decodeExpression :: Serialise (Expr s a) => ByteString -> Either DecodingFailure (Expr s a)
- newtype DecodingFailure = CBORIsNotDhall ByteString

# Standard versions

data StandardVersion Source #

Supported version strings

This exists primarily for backwards compatibility for expressions encoded before Dhall removed version tags from the binary encoding

Constructors

NoVersion | No version string
V_5_0_0 | Version "5.0.0"
V_4_0_0 | Version "4.0.0"
V_3_0_0 | Version "3.0.0"
V_2_0_0 | Version "2.0.0"
V_1_0_0 | Version "1.0.0"

#### Instances

Instances details

Bounded StandardVersion Source # |
Instance details Defined in Dhall.Binary Methods minBound :: StandardVersion Source # maxBound :: StandardVersion Source #
Enum StandardVersion Source # |

Instance details

Defined in Dhall.Binary

Methods

succ :: StandardVersion -> StandardVersion Source #

pred :: StandardVersion -> StandardVersion Source #

toEnum :: Int -> StandardVersion Source #

fromEnum :: StandardVersion -> Int Source #

enumFrom :: StandardVersion -> [StandardVersion] Source #

enumFromThen :: StandardVersion -> StandardVersion -> [StandardVersion] Source #

enumFromTo :: StandardVersion -> StandardVersion -> [StandardVersion] Source #

enumFromThenTo :: StandardVersion -> StandardVersion -> StandardVersion -> [StandardVersion] Source #

renderStandardVersion :: StandardVersion -> Text Source #

Render a `StandardVersion` as `Text`

# Encoding and decoding

encodeExpression :: Expr Void Import -> 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

Eq DecodingFailure Source # |
Instance details Defined in Dhall.Binary Methods (==) :: DecodingFailure -> DecodingFailure -> Bool Source # (/=) :: DecodingFailure -> 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 #
Exception DecodingFailure Source # |
Instance details Defined in Dhall.Binary Methods toException :: DecodingFailure -> SomeException Source # fromException :: SomeException -> Maybe DecodingFailure Source # displayException :: DecodingFailure -> String Source #

# Orphan instances

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 #
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 #