Safe Haskell | None |
---|
- data External
- type ExternalName = String
- type ExternalHelp = [String]
- externName :: External -> ExternalName
- externFun :: External -> Dynamic
- externHelp :: External -> ExternalHelp
- toDictionary :: [External] -> Map ExternalName [Dynamic]
- toHelp :: [External] -> Map ExternalName ExternalHelp
- external :: Extern a => ExternalName -> a -> ExternalHelp -> External
- class Typeable (Box a) => Extern a where
- matchingExternals :: (Extern tr, Tag t) => t -> [External] -> [(External, tr)]
- data CmdTag
- = Shell
- | Eval
- | KURE
- | Loop
- | Deep
- | Shallow
- | Navigation
- | Query
- | Predicate
- | Introduce
- | Commute
- | PreCondition
- | Debug
- | VersionControl
- | Bash
- | Context
- | Unsafe
- | TODO
- | Experiment
- | Deprecated
- data TagE
- class Tag a where
- (.&) :: (Tag a, Tag b) => a -> b -> TagE
- (.||) :: (Tag a, Tag b) => a -> b -> TagE
- notT :: Tag a => a -> TagE
- externTags :: External -> [CmdTag]
- dictionaryOfTags :: [(CmdTag, String)]
- data TagBox = TagBox TagE
- data IntBox = IntBox Int
- data RewriteCoreBox = RewriteCoreBox (RewriteH Core)
- data RewriteCoreTCBox = RewriteCoreTCBox (RewriteH CoreTC)
- data BiRewriteCoreBox = BiRewriteCoreBox (BiRewriteH Core)
- data TranslateCoreStringBox = TranslateCoreStringBox (TranslateH Core String)
- data TranslateCoreTCStringBox = TranslateCoreTCStringBox (TranslateH CoreTC String)
- data TranslateCoreCheckBox = TranslateCoreCheckBox (TranslateH Core ())
- data NameBox = NameBox Name
- newtype CoreString = CoreString {}
- data CoreBox = CoreBox CoreString
- data CrumbBox = CrumbBox Crumb
- data PathBox = PathBox PathH
- data TranslateCorePathBox = TranslateCorePathBox (TranslateH Core PathH)
- data StringBox = StringBox String
- data NameListBox = NameListBox [Name]
- data StringListBox = StringListBox [String]
Externals
type ExternalName = StringSource
External
names are just strings.
type ExternalHelp = [String]Source
Help information for External
s is stored as a list of strings, designed for multi-line displaying.
externName :: External -> ExternalNameSource
Get the name of an External
.
toDictionary :: [External] -> Map ExternalName [Dynamic]Source
toHelp :: [External] -> Map ExternalName ExternalHelpSource
Build a Map
from names to help information.
external :: Extern a => ExternalName -> a -> ExternalHelp -> ExternalSource
The primitive way to build an External
.
class Typeable (Box a) => Extern a whereSource
The class of things that can be made into External
s.
To be an Extern
there must exist an isomorphic Box
type that is an instance of Typeable
.
Extern Int | |
Extern String | |
Extern Name | |
Extern Crumb | |
Extern PathH | |
Extern CoreString | |
Extern TagE | |
Extern [String] | |
Extern [Name] | |
Extern (BiRewriteH Core) | |
Extern (RewriteH CoreTC) | |
Extern (RewriteH Core) | |
Extern (TranslateDocH CoreTC) | |
(Extern a, Extern b) => Extern (a -> b) | |
Extern (TranslateH CoreTC String) | |
Extern (TranslateH Core String) | |
Extern (TranslateH Core ()) | |
Extern (TranslateH Core PathH) |
matchingExternals :: (Extern tr, Tag t) => t -> [External] -> [(External, tr)]Source
Get all the External
s which match a given tag predicate
and box a Translate of the appropriate type.
Tags
Requirement: commands cannot have the same name as any CmdTag
(or the help function will not find it).
These should be user facing, because they give the user
a way of sub-dividing our confusing array of commands.
Shell | Shell-specific command. |
Eval | The arrow of evaluation (reduces a term). |
KURE |
|
Loop | Command may operate multiple times. |
Deep | Command may make a deep change, can be O(n). |
Shallow | Command operates on local nodes only, O(1). |
Navigation | |
Query | A question we ask. |
Predicate | Something that passes or fails. |
Introduce | Introduce something, like a new name. |
Commute | Commute is when you swap nested terms. |
PreCondition | Operation has a (perhaps undocumented) precondition. |
Debug | Commands specifically to help debugging. |
VersionControl | Version control for Core syntax. |
Bash | Commands that are run by |
Context | A command that uses its context, such as inlining. |
Unsafe | Commands that are not type safe (may cause Core Lint to fail), or may otherwise change the semantics of the program. |
TODO | An incomplete or potentially buggy command. |
Experiment | Things we are trying out. |
Deprecated | A command that will be removed in a future release; it has probably been renamed or subsumed by another command. |
Tags are meta-data that we add to External
s to make them sortable and searchable.
dictionaryOfTags :: [(CmdTag, String)]Source
Lists all the tags paired with a short description of what they're about.
Boxes
Boxes are used by the Extern
class.