ondim-0.1.0.0
Safe HaskellNone
LanguageGHC2021

Ondim.Debug

Synopsis

Debug data

data TraceData Source #

Data used for debugging purposes

Instances

Instances details
Show TraceData Source # 
Instance details

Defined in Ondim.Internal.Basic

Eq TraceData Source # 
Instance details

Defined in Ondim.Internal.Basic

data ExceptionType Source #

Constructors

MaxExpansionDepthExceeded 
TemplateError

Template errors are not meant to be catched from within the templates. Instead, they point at user errors that are supposed to be fixed.

Fields

Failure

Failures are expected in some sense.

Fields

  • !SomeTypeRep

    Type representation of the node which triggered the failure.

  • !Text

    Identifier of the node which triggered the failure.

  • !OndimFailure
     

data OndimFailure Source #

Failures related to the expansions.

Constructors

NotBound

Identifier is not a bound expansion.

ExpansionWrongType

Expansion bound under identifier has mismatched type.

Fields

  • !SomeTypeRep

    Type representation of the expansion that is bound under the identifier.

TemplateWrongType

Expansion bound under identifier has mismatched type.

Fields

  • !SomeTypeRep

    Type representation of the expansion that is bound under the identifier.

FailureOther !Text

Custom failure.

Disabling errors

withoutNBErrors :: Ondim s a -> Ondim s a Source #

Run subcomputation without (most) "not bound" errors. More specifically, if expandNode finds a node whose identifier is not bound, it will not throw an error and instead treat it as if it had no identifier, i.e., it will ignore it and recurse into the substructures.

withNBErrors :: Ondim s a -> Ondim s a Source #

Run subcomputation with "not bound" errors.

Throwing and catching errors

throwExpFailure :: forall {k} (t :: k) s a. Typeable t => Text -> OndimFailure -> Ondim s a Source #

Definition sites

data DefinitionSite Source #

Instances

Instances details
Generic DefinitionSite Source # 
Instance details

Defined in Ondim.Internal.Basic

Associated Types

type Rep DefinitionSite 
Instance details

Defined in Ondim.Internal.Basic

type Rep DefinitionSite = D1 ('MetaData "DefinitionSite" "Ondim.Internal.Basic" "ondim-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CodeDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SrcLoc)) :+: (C1 ('MetaCons "FileDefinition" 'PrefixI 'True) (S1 ('MetaSel ('Just "definitionPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "definitionExt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "NoDefinition" 'PrefixI 'False) (U1 :: Type -> Type)))
Show DefinitionSite Source # 
Instance details

Defined in Ondim.Internal.Basic

Eq DefinitionSite Source # 
Instance details

Defined in Ondim.Internal.Basic

type Rep DefinitionSite Source # 
Instance details

Defined in Ondim.Internal.Basic

type Rep DefinitionSite = D1 ('MetaData "DefinitionSite" "Ondim.Internal.Basic" "ondim-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CodeDefinition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SrcLoc)) :+: (C1 ('MetaCons "FileDefinition" 'PrefixI 'True) (S1 ('MetaSel ('Just "definitionPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "definitionExt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "NoDefinition" 'PrefixI 'False) (U1 :: Type -> Type)))