| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cubix.Language.Parametric.ProgInfo
Synopsis
- data ProgInfo (fs :: Signature)
- class HasProgInfo c (fs :: Signature) | c -> fs where
- progInfo :: Lens' c (ProgInfo fs)
- proginf_cfg :: Lens' c (Cfg fs)
- proginf_paths :: Lens' c (Map Label Path)
- proginf_program :: Lens' c (E (TermLab fs))
- makeProgInfo :: forall (fs :: Signature) l. (CfgBuilder fs, All HFoldable fs) => TermLab fs l -> ProgInfo fs
- cfgNodePath :: forall (fs :: Signature). ProgInfo fs -> CfgNode fs -> Maybe Path
- labToPath :: forall (fs :: Signature). Label -> ProgInfo fs -> Path
- termToPath :: forall (fs :: Signature) l. ProgInfo fs -> TermLab fs l -> Path
- containingCfgNode :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (All HTraversable fs, All HFoldable fs, All HFunctor fs) => ProgInfo fs -> TermLab fs l -> Maybe (E (TermLab fs))
- withContainingCfgNode :: forall (fs :: [(Type -> Type) -> Type -> Type]) m l. (All HTraversable fs, All HFoldable fs, All HFunctor fs, Applicative m) => ProgInfo fs -> TermLab fs l -> (forall i. TermLab fs i -> m ()) -> m ()
Type
class HasProgInfo c (fs :: Signature) | c -> fs where Source #
Minimal complete definition
Methods
progInfo :: Lens' c (ProgInfo fs) Source #
proginf_cfg :: Lens' c (Cfg fs) Source #
proginf_paths :: Lens' c (Map Label Path) Source #
proginf_program :: Lens' c (E (TermLab fs)) Source #
Instances
| HasProgInfo (ProgInfo fs) fs Source # | |
Construction
makeProgInfo :: forall (fs :: Signature) l. (CfgBuilder fs, All HFoldable fs) => TermLab fs l -> ProgInfo fs Source #
Accessors
Utilities involving multiple components
containingCfgNode :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (All HTraversable fs, All HFoldable fs, All HFunctor fs) => ProgInfo fs -> TermLab fs l -> Maybe (E (TermLab fs)) Source #
Let prog be the overall program, t be a subterm, and progInfo the ProgInfo for prog.
Then containingCfgNode progInf t returns the smallest ancestor
of t which has a corresponding node in the CFG, or Nothing if no such
node exists.
This is useful for writing code which deals with generic nodes such as Ident
which are contained in computation nodes, but are not themselves computation nodes.
withContainingCfgNode :: forall (fs :: [(Type -> Type) -> Type -> Type]) m l. (All HTraversable fs, All HFoldable fs, All HFunctor fs, Applicative m) => ProgInfo fs -> TermLab fs l -> (forall i. TermLab fs i -> m ()) -> m () Source #
See documentation of containingCfgNode. Runs the passed function
on the result of containingCfgNode, if the result is not Nothing.