Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- staticRef :: Name -> Q Exp
- staticKey :: Name -> Q Exp
- staticKeyType :: Name -> Q Type
- mkStatics :: [Name] -> Q [Dec]
- mkStaticsWithRefs :: ([Exp] -> Q [Dec]) -> Q [Dec]
- defaultStaticTab :: Name
- mkDefStaticTab :: [Name] -> Q [Dec]
- mkStaticTab :: Name -> [Name] -> Q [Dec]
- newtype CxtW c a = CxtW {
- unCxtW :: c => a
Documentation
staticRef :: Name -> Q Exp Source #
Refer to a static value, as a SKeyed
.
Be sure to pass the argument to mkStaticTab
so the referent exists.
staticKey :: Name -> Q Exp Source #
Get the symbol key of a static value, as a SKey
.
Be sure to pass the argument to mkStaticTab
so the referent exists.
Users typically don't need this; staticRef
is more type-safe as it
includes the type of the value, and this does not.
staticKeyType :: Name -> Q Type Source #
Get the symbol key type of a static value, as a type-level string.
mkStatics :: [Name] -> Q [Dec] Source #
Create top-level statically-keyed values from regular top-level values.
mkStaticsWithRefs :: ([Exp] -> Q [Dec]) -> Q [Dec] Source #
Create top-level statically-keyed values from regular top-level values, when their definitions need to refer to other statically-keyed values.
Since TH cannot handle references to names defined later in the source file,
it is not possible to use mkStatics
for this purpose; you must use this
function instead, and then register the names later using mkStaticTab
.
See unit tests for example usage.
mkDefStaticTab :: [Name] -> Q [Dec] Source #
Create a table holding the static values for a list of top-level names, binding it to the top-level name "staticTab".
mkStaticTab :: Name -> [Name] -> Q [Dec] Source #
Create a table holding the static values for a list of top-level names, binding it to the given top-level name.
Data type wrapping a constraint, to avoid ImpredicativeTypes GHC error.
Instances
PreClosure (CxtW c (e -> v -> r)) Source # | |
type Cxt (CxtW c (e -> v -> r)) Source # | |
Defined in Control.Static.Closure | |
type Env (CxtW c (e -> v -> r)) Source # | |
Defined in Control.Static.Closure | |
type Part (CxtW c (e -> v -> r)) Source # | |
Defined in Control.Static.Closure |