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

Codec.CBOR.Cuddle.Comments

Synopsis

Documentation

class HasComment a where Source #

class CollectComments a where Source #

Minimal complete definition

Nothing

Methods

collectComments :: a -> [Comment] Source #

default collectComments :: (Generic a, GCollectComments (Rep a)) => a -> [Comment] Source #

Instances

Instances details
CollectComments Word16 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Word32 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Word64 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Word8 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments ByteString Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments GenericArg Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Group Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GroupEntry Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GroupEntryVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments GrpChoice Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Name Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Type0 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Type1 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Type2 Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments TypeOrGroup Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Value Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments ValueVariant Source # 
Instance details

Defined in Codec.CBOR.Cuddle.CDDL

CollectComments Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Text Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Integer Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Bool Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Double Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Float Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments a => CollectComments (NonEmpty a) Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments a => CollectComments (WithComment a) Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments a => CollectComments (Maybe a) Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments a => CollectComments [a] Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

collectComments :: [a] -> [Comment] Source #

(//-) :: HasComment a => a -> Comment -> a infixr 0 Source #

This operator is used to attach comments to terms. It will not overwrite any comments that are already present, but will add the new comments on a new line ``` arr [0, 1] //- "This is an array with two values" ```

(<*!) :: (HasComment a, Applicative m) => m a -> m Comment -> m a Source #

This operator will parse the values from left to right and then append the parsed comment on the right to the parsed value on the left.

(!*>) :: (HasComment a, Applicative m) => m Comment -> m a -> m a Source #

This operator will parse the values from left to right and then append the parsed comment on the left to the parsed value on the right.

data WithComment a Source #

Constructors

WithComment 

Instances

Instances details
Applicative WithComment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

pure :: a -> WithComment a #

(<*>) :: WithComment (a -> b) -> WithComment a -> WithComment b #

liftA2 :: (a -> b -> c) -> WithComment a -> WithComment b -> WithComment c #

(*>) :: WithComment a -> WithComment b -> WithComment b #

(<*) :: WithComment a -> WithComment b -> WithComment a #

Functor WithComment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

fmap :: (a -> b) -> WithComment a -> WithComment b #

(<$) :: a -> WithComment b -> WithComment a #

Monad WithComment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

(>>=) :: WithComment a -> (a -> WithComment b) -> WithComment b #

(>>) :: WithComment a -> WithComment b -> WithComment b #

return :: a -> WithComment a #

CollectComments a => CollectComments (WithComment a) Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

HasComment (WithComment a) Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

(!$>) :: (HasComment b, Functor f) => (a -> b) -> f (WithComment a) -> f b Source #

This operator maps a function over a functor containing a WithComment and applies the comment within to the output of the applied function. ``` (x -> LInt x "a") !$> WithComment "b" (1 :: Integer) == Literal (LInt 1) "anb" ```

newtype Comment Source #

Constructors

Comment Text 

Instances

Instances details
IsString Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

fromString :: String -> Comment #

Monoid Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Semigroup Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Generic Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Associated Types

type Rep Comment 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

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

Methods

from :: Comment -> Rep Comment x #

to :: Rep Comment x -> Comment #

Show Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

CollectComments Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

HasComment Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Default Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

def :: Comment #

Eq Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

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

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

Ord Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Hashable Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

hashWithSalt :: Int -> Comment -> Int #

hash :: Comment -> Int #

Pretty Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Pretty

Methods

pretty :: Comment -> Doc ann #

prettyList :: [Comment] -> Doc ann #

ToExpr Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

Methods

toExpr :: Comment -> Expr #

listToExpr :: [Comment] -> Expr #

type Rep Comment Source # 
Instance details

Defined in Codec.CBOR.Cuddle.Comments

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