| Safe Haskell | Safe-Infered |
|---|
Language.HERMIT.External
- 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
- data CmdTag
- = Shell
- | Eval
- | KURE
- | Loop
- | Deep
- | Shallow
- | Navigation
- | Query
- | Predicate
- | Introduce
- | Commute
- | PreCondition
- | Debug
- | VersionControl
- | Bash
- | Context
- | TODO
- | Unimplemented
- | Experiment
- 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 TranslateCoreStringBox = TranslateCoreStringBox (TranslateH Core String)
- data TranslateCoreCheckBox = TranslateCoreCheckBox (TranslateH Core ())
- data NameBox = NameBox Name
- data TranslateCorePathBox = TranslateCorePathBox (TranslateH Core Path)
- data StringBox = StringBox String
Externals
type ExternalName = StringSource
External names are just strings.
type ExternalHelp = [String]Source
Help information for Externals 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 Externals.
To be an Extern there must exist an isomorphic Box type that is an instance of Typeable.
Instances
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.
Constructors
| Shell | Shell command. |
| Eval | The arrow of evaluation (reduces a term). |
| KURE |
|
| Loop | Command may operate multiple times. |
| Deep | O(n) |
| Shallow | O(1) |
| Navigation | |
| Query | A question we ask. |
| Predicate | Something that passes or fails. |
| Introduce | Introduce something, like a new name. |
| Commute | It's all about the commute. |
| PreCondition | Operation has a precondition. |
| Debug | Commands to help debugging. |
| VersionControl | Version control. |
| Bash | Commands that are run by |
| Context | a command that uses its context, like inline |
| TODO | TODO: check before the release. |
| Unimplemented | Something is not finished yet, do not use. |
| Experiment | Things we are trying out. |
Tags are meta-data that we add to Externals 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.
data TranslateCoreStringBox Source
Constructors
| TranslateCoreStringBox (TranslateH Core String) |
Instances