hermit-0.1.1.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellSafe-Infered

Language.HERMIT.External

Contents

Synopsis

Externals

data External Source

An External is a Dynamic value with some associated meta-data (name, help string and tags).

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.

externFun :: External -> DynamicSource

Get the Dynamic value stored in an External.

externHelp :: External -> ExternalHelpSource

Get the list of help Strings for an External.

toDictionary :: [External] -> Map ExternalName [Dynamic]Source

Build a Map from names to Dynamic values.

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.

Associated Types

type Box a Source

An isomorphic wrapper.

Methods

box :: a -> Box aSource

Wrap a value in a Box.

unbox :: Box a -> aSource

Unwrap a value from a Box.

Instances

Extern Int 
Extern String 
Extern Name 
Extern TagE 
Extern MetaCommand 
Extern QueryFun 
Extern ShellEffect 
Extern AstEffect 
Extern ShellCommand 
Extern (RewriteH Core) 
(Extern a, Extern b) => Extern (a -> b) 
Extern (TranslateH Core String) 
Extern (TranslateH Core ()) 
Extern (TranslateH Core Path) 

Tags

data CmdTag Source

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

KURE command.

Loop

Command may operate multiple times.

Deep

O(n)

Shallow

O(1)

Navigation

Uses Path or Lens to focus onto something.

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 bash.

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.

data TagE Source

A data type of logical operations on tags.

Instances

class Tag a whereSource

Tags are meta-data that we add to Externals to make them sortable and searchable.

Methods

(.+) :: External -> a -> ExternalSource

Add a Tag to an External.

remTag :: a -> External -> ExternalSource

Remove a Tag from an External.

tagMatch :: a -> External -> BoolSource

Check if an External has the specified Tag.

Instances

(.&) :: (Tag a, Tag b) => a -> b -> TagESource

An "and" on Tags.

(.||) :: (Tag a, Tag b) => a -> b -> TagESource

An "or" on Tags.

notT :: Tag a => a -> TagESource

A "not" on Tags.

externTags :: External -> [CmdTag]Source

List all the CmdTags associated with an External

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 TagBox Source

Constructors

TagBox TagE 

Instances

data IntBox Source

Constructors

IntBox Int 

Instances

data NameBox Source

Constructors

NameBox Name 

Instances

data StringBox Source

Constructors

StringBox String 

Instances