cuddle-0.5.0.0: CDDL Generator and test utilities
Safe HaskellNone
LanguageGHC2021

Codec.CBOR.Cuddle.CDDL

Description

This module defined the data structure of CDDL as specified in https://datatracker.ietf.org/doc/rfc8610/

Synopsis

Documentation

data CDDL Source #

The CDDL constructor takes three arguments: 1. Top level comments that precede the first definition 2. The root definition 3. All the other top level comments and definitions This ensures that CDDL is correct by construction.

Constructors

CDDL [Comment] Rule [TopLevel] 

Instances

Instances details
Semigroup CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(<>) :: CDDL -> CDDL -> CDDL #

sconcat :: NonEmpty CDDL -> CDDL #

stimes :: Integral b => b -> CDDL -> CDDL #

Generic CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep CDDL 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

from :: CDDL -> Rep CDDL x #

to :: Rep CDDL x -> CDDL #

Show CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> CDDL -> ShowS #

show :: CDDL -> String #

showList :: [CDDL] -> ShowS #

Eq CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: CDDL -> CDDL -> Bool #

(/=) :: CDDL -> CDDL -> Bool #

Pretty CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: CDDL -> Doc ann #

prettyList :: [CDDL] -> Doc ann #

ToExpr CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: CDDL -> Expr #

listToExpr :: [CDDL] -> Expr #

type Rep CDDL Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

sortCDDL :: CDDL -> CDDL Source #

Sort the CDDL Rules on the basis of their names Top level comments will be removed!

data TopLevel Source #

Instances

Instances details
Generic TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep TopLevel 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TopLevel = D1 ('MetaData "TopLevel" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "TopLevelRule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rule)) :+: C1 ('MetaCons "TopLevelComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

Methods

from :: TopLevel -> Rep TopLevel x #

to :: Rep TopLevel x -> TopLevel #

Show TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: TopLevel -> Doc ann #

prettyList :: [TopLevel] -> Doc ann #

ToExpr TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TopLevel Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TopLevel = D1 ('MetaData "TopLevel" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "TopLevelRule" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rule)) :+: C1 ('MetaCons "TopLevelComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

data Name Source #

A name can consist of any of the characters from the set {A to Z, "a" to "z", "0" to "9", "_", "-", "", ".", "$"}, starting with an alphabetic character (including "", "_", "$") and ending in such a character or a digit.

  • Names are case sensitive.
  • It is preferred style to start a name with a lowercase letter.
  • The hyphen is preferred over the underscore (except in a "bareword" (Section 3.5.1), where the semantics may actually require an underscore).
  • The period may be useful for larger specifications, to express some module structure (as in "tcp.throughput" vs. "udp.throughput").
  • A number of names are predefined in the CDDL prelude, as listed in Appendix D.
  • Rule names (types or groups) do not appear in the actual CBOR encoding, but names used as "barewords" in member keys do.

Constructors

Name 

Fields

Instances

Instances details
IsString Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

fromString :: String -> Name #

Generic Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Name 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Name = D1 ('MetaData "Name" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "nameComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

Methods

from :: Name -> Rep Name x #

to :: Rep Name x -> Name #

Show Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

CollectComments Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Ord Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Hashable Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

hashWithSalt :: Int -> Name -> Int #

hash :: Name -> Int #

Pretty Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Name -> Doc ann #

prettyList :: [Name] -> Doc ann #

ToExpr Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Name -> Expr #

listToExpr :: [Name] -> Expr #

type Rep Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Name = D1 ('MetaData "Name" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "nameComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

data Rule Source #

rule = typename [genericparm] S assignt S type / groupname [genericparm] S assigng S grpent

typename = id groupname = id

A rule defines a name for a type expression (production "type") or for a group expression (production "grpent"), with the intention that the semantics does not change when the name is replaced by its (parenthesized if needed) definition. Note that whether the name defined by a rule stands for a type or a group isn't always determined by syntax alone: e.g., "a = b" can make "a" a type if "b" is a type, or a group if "b" is a group. More subtly, in "a = (b)", "a" may be used as a type if "b" is a type, or as a group both when "b" is a group and when "b" is a type (a good convention to make the latter case stand out to the human reader is to write "a = (b,)"). (Note that the same dual meaning of parentheses applies within an expression but often can be resolved by the context of the parenthesized expression. On the more general point, it may not be clear immediately either whether "b" stands for a group or a type -- this semantic processing may need to span several levels of rule definitions before a determination can be made.)

Instances

Instances details
Generic Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Rule 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

from :: Rule -> Rep Rule x #

to :: Rep Rule x -> Rule #

Show Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Rule -> ShowS #

show :: Rule -> String #

showList :: [Rule] -> ShowS #

HasComment Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Rule -> Rule -> Bool #

(/=) :: Rule -> Rule -> Bool #

Pretty Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Rule -> Doc ann #

prettyList :: [Rule] -> Doc ann #

ToExpr Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Rule -> Expr #

listToExpr :: [Rule] -> Expr #

type Rep Rule Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

data TypeOrGroup Source #

Instances

Instances details
Generic TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep TypeOrGroup 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TypeOrGroup = D1 ('MetaData "TypeOrGroup" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "TOGType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: C1 ('MetaCons "TOGGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupEntry)))
Show TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

ToExpr TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TypeOrGroup = D1 ('MetaData "TypeOrGroup" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "TOGType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: C1 ('MetaCons "TOGGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupEntry)))

data Assign Source #

assignt = "=" "=" assigng = "=" "/="

A plain equals sign defines the rule name as the equivalent of the expression to the right; it is an error if the name was already defined with a different expression. A "=" or "/=" extends a named type or a group by additional choices; a number of these could be replaced by collecting all the right-hand sides and creating a single rule with a type choice or a group choice built from the right-hand sides in the order of the rules given. (It is not an error to extend a rule name that has not yet been defined; this makes the right-hand side the first entry in the choice being created.)

Constructors

AssignEq 
AssignExt 

Instances

Instances details
Generic Assign Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Assign 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Assign = D1 ('MetaData "Assign" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "AssignEq" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AssignExt" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Assign -> Rep Assign x #

to :: Rep Assign x -> Assign #

Show Assign Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq Assign Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Assign -> Assign -> Bool #

(/=) :: Assign -> Assign -> Bool #

ToExpr Assign Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Assign -> Expr #

listToExpr :: [Assign] -> Expr #

type Rep Assign Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Assign = D1 ('MetaData "Assign" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "AssignEq" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AssignExt" 'PrefixI 'False) (U1 :: Type -> Type))

newtype GenericArg Source #

Constructors

GenericArg (NonEmpty Type1) 

Instances

Instances details
Semigroup GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Generic GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep GenericArg 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericArg = D1 ('MetaData "GenericArg" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "GenericArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Type1))))
Show GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: GenericArg -> Doc ann #

prettyList :: [GenericArg] -> Doc ann #

ToExpr GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericArg = D1 ('MetaData "GenericArg" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "GenericArg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Type1))))

newtype GenericParam Source #

Generics

Using angle brackets, the left-hand side of a rule can add formal parameters after the name being defined, as in:

messages = message"now" / message1..100 messagev = {type: t, value: v}

When using a generic rule, the formal parameters are bound to the actual arguments supplied (also using angle brackets), within the scope of the generic rule (as if there were a rule of the form parameter = argument).

Generic rules can be used for establishing names for both types and groups.

Constructors

GenericParam (NonEmpty Name) 

Instances

Instances details
Semigroup GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Generic GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep GenericParam 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericParam = D1 ('MetaData "GenericParam" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "GenericParam" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Name))))
Show GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: GenericParam -> Doc ann #

prettyList :: [GenericParam] -> Doc ann #

ToExpr GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericParam Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GenericParam = D1 ('MetaData "GenericParam" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "GenericParam" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Name))))

newtype Type0 Source #

A type can be given as a choice between one or more types. The choice matches a data item if the data item matches any one of the types given in the choice.

Constructors

Type0 

Instances

Instances details
Semigroup Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(<>) :: Type0 -> Type0 -> Type0 #

sconcat :: NonEmpty Type0 -> Type0 #

stimes :: Integral b => b -> Type0 -> Type0 #

Generic Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Type0 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type0 = D1 ('MetaData "Type0" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "Type0" 'PrefixI 'True) (S1 ('MetaSel ('Just "t0Type1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Type1))))

Methods

from :: Type0 -> Rep Type0 x #

to :: Rep Type0 x -> Type0 #

Show Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Type0 -> ShowS #

show :: Type0 -> String #

showList :: [Type0] -> ShowS #

CollectComments Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Type0 -> Type0 -> Bool #

(/=) :: Type0 -> Type0 -> Bool #

Pretty Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Type0 -> Doc ann #

prettyList :: [Type0] -> Doc ann #

ToExpr Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Type0 -> Expr #

listToExpr :: [Type0] -> Expr #

type Rep Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type0 = D1 ('MetaData "Type0" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "Type0" 'PrefixI 'True) (S1 ('MetaSel ('Just "t0Type1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Type1))))

data Type1 Source #

Two types can be combined with a range operator (see below)

Constructors

Type1 

Instances

Instances details
Generic Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Type1 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type1 = D1 ('MetaData "Type1" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Type1" 'PrefixI 'True) (S1 ('MetaSel ('Just "t1Main") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type2) :*: (S1 ('MetaSel ('Just "t1TyOp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (TyOp, Type2))) :*: S1 ('MetaSel ('Just "t1Comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment))))

Methods

from :: Type1 -> Rep Type1 x #

to :: Rep Type1 x -> Type1 #

Show Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Type1 -> ShowS #

show :: Type1 -> String #

showList :: [Type1] -> ShowS #

CollectComments Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Default Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

def :: Type1 #

Eq Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Type1 -> Type1 -> Bool #

(/=) :: Type1 -> Type1 -> Bool #

Pretty Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Type1 -> Doc ann #

prettyList :: [Type1] -> Doc ann #

ToExpr Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Type1 -> Expr #

listToExpr :: [Type1] -> Expr #

type Rep Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type1 = D1 ('MetaData "Type1" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Type1" 'PrefixI 'True) (S1 ('MetaSel ('Just "t1Main") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type2) :*: (S1 ('MetaSel ('Just "t1TyOp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (TyOp, Type2))) :*: S1 ('MetaSel ('Just "t1Comment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment))))

data Type2 Source #

Constructors

T2Value Value

A type can be just a single value (such as 1 or "icecream" or h'0815'), which matches only a data item with that specific value (no conversions defined),

T2Name Name (Maybe GenericArg)

or be defined by a rule giving a meaning to a name (possibly after supplying generic arguments as required by the generic parameters)

T2Group Type0

or be defined in a parenthesized type expression (parentheses may be necessary to override some operator precedence),

T2Map Group

a map expression, which matches a valid CBOR map the key/value pairs of which can be ordered in such a way that the resulting sequence matches the group expression, or

T2Array Group

an array expression, which matches a CBOR array the elements of which when taken as values and complemented by a wildcard (matches anything) key each -- match the group, or

T2Unwrapped Name (Maybe GenericArg)

an "unwrapped" group (see Section 3.7), which matches the group inside a type defined as a map or an array by wrapping the group, or

T2Enum Group

an enumeration expression, which matches any value that is within the set of values that the values of the group given can take, or

T2EnumRef Name (Maybe GenericArg) 
T2Tag (Maybe Word64) Type0

a tagged data item, tagged with the "uint" given and containing the type given as the tagged value, or

T2DataItem Word8 (Maybe Word64)

a data item of a major type (given by the DIGIT), optionally constrained to the additional information given by the uint, or

T2Any

Any data item

Instances

Instances details
Generic Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Type2 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type2 = D1 ('MetaData "Type2" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (((C1 ('MetaCons "T2Value" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :+: C1 ('MetaCons "T2Name" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg)))) :+: (C1 ('MetaCons "T2Group" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: (C1 ('MetaCons "T2Map" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group)) :+: C1 ('MetaCons "T2Array" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group))))) :+: ((C1 ('MetaCons "T2Unwrapped" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg))) :+: (C1 ('MetaCons "T2Enum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group)) :+: C1 ('MetaCons "T2EnumRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg))))) :+: (C1 ('MetaCons "T2Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: (C1 ('MetaCons "T2DataItem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64))) :+: C1 ('MetaCons "T2Any" 'PrefixI 'False) (U1 :: Type -> Type)))))

Methods

from :: Type2 -> Rep Type2 x #

to :: Rep Type2 x -> Type2 #

Show Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Type2 -> ShowS #

show :: Type2 -> String #

showList :: [Type2] -> ShowS #

CollectComments Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Default Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

def :: Type2 #

Eq Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Type2 -> Type2 -> Bool #

(/=) :: Type2 -> Type2 -> Bool #

Pretty Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Type2 -> Doc ann #

prettyList :: [Type2] -> Doc ann #

ToExpr Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Type2 -> Expr #

listToExpr :: [Type2] -> Expr #

type Rep Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Type2 = D1 ('MetaData "Type2" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (((C1 ('MetaCons "T2Value" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :+: C1 ('MetaCons "T2Name" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg)))) :+: (C1 ('MetaCons "T2Group" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: (C1 ('MetaCons "T2Map" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group)) :+: C1 ('MetaCons "T2Array" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group))))) :+: ((C1 ('MetaCons "T2Unwrapped" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg))) :+: (C1 ('MetaCons "T2Enum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Group)) :+: C1 ('MetaCons "T2EnumRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GenericArg))))) :+: (C1 ('MetaCons "T2Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type0)) :+: (C1 ('MetaCons "T2DataItem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64))) :+: C1 ('MetaCons "T2Any" 'PrefixI 'False) (U1 :: Type -> Type)))))

data TyOp Source #

Instances

Instances details
Generic TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep TyOp 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TyOp = D1 ('MetaData "TyOp" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "RangeOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RangeBound)) :+: C1 ('MetaCons "CtrlOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CtlOp)))

Methods

from :: TyOp -> Rep TyOp x #

to :: Rep TyOp x -> TyOp #

Show TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> TyOp -> ShowS #

show :: TyOp -> String #

showList :: [TyOp] -> ShowS #

Eq TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: TyOp -> TyOp -> Bool #

(/=) :: TyOp -> TyOp -> Bool #

Pretty TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: TyOp -> Doc ann #

prettyList :: [TyOp] -> Doc ann #

ToExpr TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: TyOp -> Expr #

listToExpr :: [TyOp] -> Expr #

type Rep TyOp Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep TyOp = D1 ('MetaData "TyOp" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "RangeOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RangeBound)) :+: C1 ('MetaCons "CtrlOp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CtlOp)))

data RangeBound Source #

A range operator can be used to join two type expressions that stand for either two integer values or two floating-point values; it matches any value that is between the two values, where the first value is always included in the matching set and the second value is included for ".." and excluded for "...".

Constructors

ClOpen 
Closed 

Instances

Instances details
Generic RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep RangeBound 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep RangeBound = D1 ('MetaData "RangeBound" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "ClOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Closed" 'PrefixI 'False) (U1 :: Type -> Type))
Show RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Hashable RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

ToExpr RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep RangeBound Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep RangeBound = D1 ('MetaData "RangeBound" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "ClOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Closed" 'PrefixI 'False) (U1 :: Type -> Type))

data OccurrenceIndicator Source #

An optional _occurrence_ indicator can be given in front of a group entry. It is either (1) one of the characters "?" (optional), "*" (zero or more), or "+" (one or more) or (2) of the form n*m, where n and m are optional unsigned integers and n is the lower limit (default 0) and m is the upper limit (default no limit) of occurrences.

If no occurrence indicator is specified, the group entry is to occur exactly once (as if 1*1 were specified). A group entry with an occurrence indicator matches sequences of name/value pairs that are composed by concatenating a number of sequences that the basic group entry matches, where the number needs to be allowed by the occurrence indicator.

Instances

Instances details
Generic OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep OccurrenceIndicator 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep OccurrenceIndicator = D1 ('MetaData "OccurrenceIndicator" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) ((C1 ('MetaCons "OIOptional" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OIZeroOrMore" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "OIOneOrMore" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OIBounded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)))))
Show OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Hashable OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

ToExpr OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep OccurrenceIndicator Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep OccurrenceIndicator = D1 ('MetaData "OccurrenceIndicator" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) ((C1 ('MetaCons "OIOptional" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OIZeroOrMore" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "OIOneOrMore" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OIBounded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)))))

newtype Group Source #

A group matches any sequence of key/value pairs that matches any of the choices given (again using PEG semantics).

Constructors

Group 

Instances

Instances details
Semigroup Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(<>) :: Group -> Group -> Group #

sconcat :: NonEmpty Group -> Group #

stimes :: Integral b => b -> Group -> Group #

Generic Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Group 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Group = D1 ('MetaData "Group" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "Group" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty GrpChoice))))

Methods

from :: Group -> Rep Group x #

to :: Rep Group x -> Group #

Show Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Group -> ShowS #

show :: Group -> String #

showList :: [Group] -> ShowS #

CollectComments Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Group -> Group -> Bool #

(/=) :: Group -> Group -> Bool #

ToExpr Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Group -> Expr #

listToExpr :: [Group] -> Expr #

type Rep Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Group = D1 ('MetaData "Group" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'True) (C1 ('MetaCons "Group" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGroup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty GrpChoice))))

data GroupEntry Source #

A group entry can be given by a value type, which needs to be matched by the value part of a single element; and, optionally, a memberkey type, which needs to be matched by the key part of the element, if the memberkey is given. If the memberkey is not given, the entry can only be used for matching arrays, not for maps. (See below for how that is modified by the occurrence indicator.)

Instances

Instances details
Generic GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep GroupEntry 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GroupEntry = D1 ('MetaData "GroupEntry" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "GroupEntry" 'PrefixI 'True) (S1 ('MetaSel ('Just "geOccurrenceIndicator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe OccurrenceIndicator)) :*: (S1 ('MetaSel ('Just "geComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment) :*: S1 ('MetaSel ('Just "geVariant") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupEntryVariant))))
Show GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: GroupEntry -> Doc ann #

prettyList :: [GroupEntry] -> Doc ann #

ToExpr GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GroupEntry = D1 ('MetaData "GroupEntry" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "GroupEntry" 'PrefixI 'True) (S1 ('MetaSel ('Just "geOccurrenceIndicator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe OccurrenceIndicator)) :*: (S1 ('MetaSel ('Just "geComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment) :*: S1 ('MetaSel ('Just "geVariant") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GroupEntryVariant))))

data GroupEntryVariant Source #

Instances

Instances details
Generic GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Show GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

ToExpr GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

data MemberKey Source #

Key types can be given by a type expression, a bareword (which stands for a type that just contains a string value created from this bareword), or a value (which stands for a type that just contains this value). A key value matches its key type if the key value is a member of the key type, unless a cut preceding it in the group applies (see Section 3.5.4 for how map matching is influenced by the presence of the cuts denoted by "^" or ":" in previous entries).

Instances

Instances details
Generic MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep MemberKey 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Show MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: MemberKey -> Doc ann #

prettyList :: [MemberKey] -> Doc ann #

ToExpr MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep MemberKey Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

data Value Source #

Constructors

Value ValueVariant Comment 

Instances

Instances details
Generic Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep Value 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Value = D1 ('MetaData "Value" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Value" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ValueVariant) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

Methods

from :: Value -> Rep Value x #

to :: Rep Value x -> Value #

Show Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

CollectComments Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Default Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

def :: Value #

Eq Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Hashable Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

hashWithSalt :: Int -> Value -> Int #

hash :: Value -> Int #

Pretty Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Value -> Doc ann #

prettyList :: [Value] -> Doc ann #

ToExpr Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

toExpr :: Value -> Expr #

listToExpr :: [Value] -> Expr #

type Rep Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep Value = D1 ('MetaData "Value" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "Value" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ValueVariant) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))

data ValueVariant Source #

Instances

Instances details
Generic ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep ValueVariant 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep ValueVariant = D1 ('MetaData "ValueVariant" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (((C1 ('MetaCons "VUInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)) :+: C1 ('MetaCons "VNInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) :+: (C1 ('MetaCons "VBignum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: C1 ('MetaCons "VFloat16" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))) :+: ((C1 ('MetaCons "VFloat32" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)) :+: C1 ('MetaCons "VFloat64" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: (C1 ('MetaCons "VText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "VBytes" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "VBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))
Show ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Default ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Methods

def :: ValueVariant #

Eq ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Hashable ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Pretty ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: ValueVariant -> Doc ann #

prettyList :: [ValueVariant] -> Doc ann #

ToExpr ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep ValueVariant = D1 ('MetaData "ValueVariant" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (((C1 ('MetaCons "VUInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)) :+: C1 ('MetaCons "VNInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) :+: (C1 ('MetaCons "VBignum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)) :+: C1 ('MetaCons "VFloat16" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))) :+: ((C1 ('MetaCons "VFloat32" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)) :+: C1 ('MetaCons "VFloat64" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :+: (C1 ('MetaCons "VText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "VBytes" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "VBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))))

data GrpChoice Source #

Constructors

GrpChoice 

Instances

Instances details
Generic GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Associated Types

type Rep GrpChoice 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GrpChoice = D1 ('MetaData "GrpChoice" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "GrpChoice" 'PrefixI 'True) (S1 ('MetaSel ('Just "gcGroupEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GroupEntry]) :*: S1 ('MetaSel ('Just "gcComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))
Show GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

HasComment GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

Eq GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

ToExpr GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

type Rep GrpChoice = D1 ('MetaData "GrpChoice" "Codec.CBOR.Cuddle.CDDL" "cuddle-0.5.0.0-H0bbRBZdSvH43WSgb38tp7" 'False) (C1 ('MetaCons "GrpChoice" 'PrefixI 'True) (S1 ('MetaSel ('Just "gcGroupEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GroupEntry]) :*: S1 ('MetaSel ('Just "gcComment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Comment)))