dhall-1.27.0: A configuration language guaranteed to terminate

Safe HaskellNone
LanguageHaskell2010

Dhall.Binary

Contents

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

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"

Encoding and decoding

class ToTerm a where Source #

Types that can be encoded as a CBOR Term

Methods

encode :: a -> Term Source #

Instances
ToTerm Void Source # 
Instance details

Defined in Dhall.Binary

Methods

encode :: Void -> Term Source #

ToTerm Import Source # 
Instance details

Defined in Dhall.Binary

Methods

encode :: Import -> Term Source #

ToTerm DhallDouble Source # 
Instance details

Defined in Dhall.Binary

ToTerm a => ToTerm (Expr Void a) Source # 
Instance details

Defined in Dhall.Binary

Methods

encode :: Expr Void a -> Term Source #

class FromTerm a where Source #

Types that can be decoded from a CBOR Term

Methods

decode :: Term -> Maybe a Source #

Instances
FromTerm Void Source # 
Instance details

Defined in Dhall.Binary

Methods

decode :: Term -> Maybe Void Source #

FromTerm Import Source # 
Instance details

Defined in Dhall.Binary

FromTerm a => FromTerm (Expr s a) Source # 
Instance details

Defined in Dhall.Binary

Methods

decode :: Term -> Maybe (Expr s a) Source #

encodeExpression :: Expr s Import -> Term Source #

Encode a Dhall expression as a CBOR Term

This denotes the expression before encoding it. To encode an already denoted expression, it is more efficient to directly use encode.

decodeExpression :: FromTerm a => Term -> Either DecodingFailure (Expr s a) Source #

Decode a Dhall expression from a CBOR Term

Exceptions

data DecodingFailure Source #

This indicates that a given CBOR expression did not correspond to a valid Dhall expression

Constructors

CBORIsNotDhall Term