Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- renderStandardVersion :: StandardVersion -> Text
- class ToTerm a where
- class FromTerm a where
- encodeExpression :: Expr s Import -> Term
- decodeExpression :: FromTerm a => Term -> Either DecodingFailure (Expr s a)
- data DecodingFailure = CBORIsNotDhall Term
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
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
Bounded StandardVersion Source # | |
Defined in Dhall.Binary | |
Enum StandardVersion Source # | |
Defined in Dhall.Binary succ :: StandardVersion -> StandardVersion # pred :: StandardVersion -> StandardVersion # toEnum :: Int -> StandardVersion # fromEnum :: StandardVersion -> Int # enumFrom :: StandardVersion -> [StandardVersion] # enumFromThen :: StandardVersion -> StandardVersion -> [StandardVersion] # enumFromTo :: StandardVersion -> StandardVersion -> [StandardVersion] # enumFromThenTo :: StandardVersion -> StandardVersion -> StandardVersion -> [StandardVersion] # |
renderStandardVersion :: StandardVersion -> Text Source #
Render a StandardVersion
as Expr
Encoding and decoding
Types that can be encoded as a CBOR Term
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
Instances
Eq DecodingFailure Source # | |
Defined in Dhall.Binary (==) :: DecodingFailure -> DecodingFailure -> Bool # (/=) :: DecodingFailure -> DecodingFailure -> Bool # | |
Show DecodingFailure Source # | |
Defined in Dhall.Binary showsPrec :: Int -> DecodingFailure -> ShowS # show :: DecodingFailure -> String # showList :: [DecodingFailure] -> ShowS # | |
Exception DecodingFailure Source # | |
Defined in Dhall.Binary |