dhall-1.19.1: A configuration language guaranteed to terminate

Safe Haskell | None
Language | Haskell2010

Dhall.Binary

Contents

- Standard versions
- Encoding and decoding
- Exceptions

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 = V_4_0_0
- defaultStandardVersion :: StandardVersion
- parseStandardVersion :: Parser StandardVersion
- encodeWithVersion :: StandardVersion -> Expr s Import -> Term
- decodeWithVersion :: Term -> Either DecodingFailure (Expr s Import)
- data DecodingFailure
  - = CannotDecodeVersionString Term
  - | UnsupportedVersionString Text
  - | CBORIsNotDhall Term

# Standard versions

data StandardVersion Source #

Supported version strings

Constructors

V_4_0_0 | Version "4.0.0"

defaultStandardVersion :: StandardVersion Source #

parseStandardVersion :: Parser StandardVersion Source #

# Encoding and decoding

encodeWithVersion :: StandardVersion -> Expr s Import -> Term Source #

Encode a Dhall expression using the specified `Version`

decodeWithVersion :: Term -> Either DecodingFailure (Expr s Import) Source #

Decode a Dhall expression

This auto-detects which standard version to decode based on the included standard version string in the decoded expression

# Exceptions

data DecodingFailure Source #

Constructors

CannotDecodeVersionString Term |
UnsupportedVersionString Text |
CBORIsNotDhall Term |

Instances

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 #