drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Symbol.Helpers

Description

Routines to help with Symbols and Stages.

Synopsis

Documentation

eqSymb :: HasSymbol q => q -> Symbol Source #

Helper function for getting a symbol in the Equational Stage.

codeSymb :: HasSymbol q => q -> Symbol Source #

Helper function for getting a symbol in the Implementation Stage.

hasStageSymbol :: HasSymbol q => q -> Stage -> Bool Source #

Finds if a Stage symbol is real or Empty. True if real.

autoStage :: Symbol -> Stage -> Symbol Source #

Helper for creating a symbol with Unicode in it.

hat :: Symbol -> Symbol Source #

Helper for creating a symbol with a hat ("^") atop it.

prime :: Symbol -> Symbol Source #

Helper for creating a Vector symbol.

staged :: Symbol -> Symbol -> Stage -> Symbol Source #

Helper for creating a symbol that depends on the stage.

sub :: Symbol -> Symbol -> Symbol Source #

Helper for creating a symbol with a subscript to the right. Arguments: Base symbol, then subscripted symbol.

subStr :: Symbol -> String -> Symbol Source #

Helper for a common case of subscript, with a string Arguments: Base symbol, then subscript String.

sup :: Symbol -> Symbol -> Symbol Source #

Helper for creating a symbol with a superscript to the right. Arguments: Base symbol, then superscripted symbol.

unicodeConv :: Symbol -> Symbol Source #

Helper for autoStage that applies unicodeString to all Symbols with Strings.

upperLeft :: Symbol -> Symbol -> Symbol Source #

Helper for creating a symbol with a superscript on the left side of the symbol. Arguments: Base symbol, then superscripted symbol.

vec :: Symbol -> Symbol Source #

Helper for creating a Vector symbol.

label :: String -> Symbol Source #

Label smart constructor, requires non-empty labels

variable :: String -> Symbol Source #

Variable smart constructor, requires non-empty variables

sortBySymbol :: HasSymbol a => [a] -> [a] Source #

Sorts a list of HasSymbols by Symbol.

sortBySymbolTuple :: HasSymbol a => [(a, b)] -> [(a, b)] Source #

Sorts a tuple list of HasSymbols by first Symbol in the tuple.

compareBySymbol :: HasSymbol a => a -> a -> Ordering Source #

Compare the equational Symbol of two things.