| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cubix.Language.Parametric.InjF
Synopsis
- class All HFunctor fs => InjF (fs :: [(Type -> Type) -> Type -> Type]) l l' where
- injectF :: forall g (fs :: Signature) l l' h (a :: Type -> Type). (g :-<: fs, InjF fs l l') => g (CxtS h fs a) l -> CxtS h fs a l'
- fromProjF :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' h (a :: Type -> Type). InjF fs l l' => CxtS h fs a l' -> CxtS h fs a l
- labeledInjF :: forall m (fs :: [(Type -> Type) -> Type -> Type]) l l'. (MonadAnnotater Label m, InjF fs l l', All HTraversable fs, All HFoldable fs) => TermLab fs l -> m (TermLab fs l')
- injFAnnDef :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' a. (InjF fs l l', All HTraversable fs, Default a, All HFoldable fs) => AnnTerm a fs l -> AnnTerm a fs l'
- injectFAnnDef :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' (f :: Fragment) a. (InjF fs l l', f :-<: fs, All HTraversable fs, All HFoldable fs, Default a) => (f :&: a) (AnnTerm a fs) l -> AnnTerm a fs l'
- type family IsSortInjection (f :: Fragment) :: Bool
- type family SortInjectionSource (f :: Fragment)
- type family SortInjectionTarget (f :: Fragment)
- class RemoveSortInjectionNode (f :: (Type -> Type) -> Sort -> Type) where
- removeSortInjectionNode :: forall h (fs :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) l. f (Cxt h fs a) l -> Cxt h fs a (SortInjectionSource f)
- type family InjectableSorts (fs :: Signature) l :: [Sort]
- class AInjF (fs :: Signature) l where
- promoteInjRF :: forall (fs :: Signature) l m. (AInjF fs l, MonadPlus m, MonadAnnotater Label m) => RewriteM m (TermLab fs) l -> GRewriteM m (TermLab fs)
Documentation
class All HFunctor fs => InjF (fs :: [(Type -> Type) -> Type -> Type]) l l' where Source #
InjF allows us to create "sort injections," stating that one sort can be considered a coercive subsort of another..
For example, if we wanted to parameterize whether a given syntax allows arbitrary expressions to be used as function arguments, we could have the function terms have arguments of sort FunArg and create an ExpressionIsFunArg . Defining an instance
instance (ExpressionIsFunArg :-<: f) => InjF fs ExpL FunArgL
would then allow us to use expression as function arguments freely.
Methods
injF :: forall h (a :: Type -> Type). CxtS h fs a l -> CxtS h fs a l' Source #
projF' :: forall h p (a :: Type -> Type). Cxt h (Sum fs :&: p) a l' -> Maybe (Cxt h (Sum fs :&: p) a l) Source #
Dynamically casing on subsorts
projF :: forall h (a :: Type -> Type). CxtS h fs a l' -> Maybe (CxtS h fs a l) Source #
Instances
injectF :: forall g (fs :: Signature) l l' h (a :: Type -> Type). (g :-<: fs, InjF fs l l') => g (CxtS h fs a) l -> CxtS h fs a l' Source #
fromProjF :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' h (a :: Type -> Type). InjF fs l l' => CxtS h fs a l' -> CxtS h fs a l Source #
labeledInjF :: forall m (fs :: [(Type -> Type) -> Type -> Type]) l l'. (MonadAnnotater Label m, InjF fs l l', All HTraversable fs, All HFoldable fs) => TermLab fs l -> m (TermLab fs l') Source #
injFAnnDef :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' a. (InjF fs l l', All HTraversable fs, Default a, All HFoldable fs) => AnnTerm a fs l -> AnnTerm a fs l' Source #
injectFAnnDef :: forall (fs :: [(Type -> Type) -> Type -> Type]) l l' (f :: Fragment) a. (InjF fs l l', f :-<: fs, All HTraversable fs, All HFoldable fs, Default a) => (f :&: a) (AnnTerm a fs) l -> AnnTerm a fs l' Source #
type family IsSortInjection (f :: Fragment) :: Bool Source #
Instances
type family SortInjectionSource (f :: Fragment) Source #
Instances
type family SortInjectionTarget (f :: Fragment) Source #
Instances
class RemoveSortInjectionNode (f :: (Type -> Type) -> Sort -> Type) where Source #
Methods
removeSortInjectionNode :: forall h (fs :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) l. f (Cxt h fs a) l -> Cxt h fs a (SortInjectionSource f) Source #
Instances
type family InjectableSorts (fs :: Signature) l :: [Sort] Source #
Instances
| type InjectableSorts MCSig MultiLocalVarDeclL Source # | |
Defined in Cubix.Language.C.Parametric.Common.Types | |
| type InjectableSorts MJavaSig MultiLocalVarDeclL Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Types | |
| type InjectableSorts MJSSig AssignL Source # | |
| type InjectableSorts MJSSig MultiLocalVarDeclL Source # | |
| type InjectableSorts MLuaSig AssignL Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Types | |
| type InjectableSorts MLuaSig SingleLocalVarDeclL Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Types | |
| type InjectableSorts MPythonSig AssignL Source # | |