| Copyright | Anthony Wang 2021 |
|---|---|
| License | MIT |
| Maintainer | anthony.y.wang.math@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
SDParser
Description
SDParser defines a parser which parses text into a list of SDCommands,
which are then handled by the main thread of the program.
The notation for the text parsed is documented in the user's manual for the
tikzsd program.
Synopsis
- data SDCommand
- = DefineCat {
- dcat_id :: !String
- dcat_display_string :: !String
- | DefineFunc {
- dfun_id :: !String
- dfun_display_string :: !String
- dfun_source :: !String
- dfun_target :: !String
- dfun_opts :: !String
- | DefineNat {
- dnat_id :: !String
- dnat_display_string :: !String
- dnat_source :: ![CompElement]
- dnat_target :: ![CompElement]
- dnat_opts :: !String
- dnat_shape :: !String
- | DrawNat {
- dn_file_name :: !String
- dn_opts :: !String
- dn_parts :: ![SDDrawLine]
- = DefineCat {
- data SDDrawLine
- = SDDrawFun [CompElement]
- | SDDrawNat [CompElement]
- data CompElement
- sd_parser :: GenParser Char st [SDCommand]
Documentation
A SDCommand describes a command parsed from the file.
We have the following commands:
DefineCatis the command for defining a category.DefineFuncis the command for defining a basic functor.DefineNatis the command for defining a basic natural transformation.DrawNatis the command for creating a file with the TikZ code for the drawing a string diagram of a natural transformation.
Constructors
| DefineCat | |
Fields
| |
| DefineFunc | |
Fields
| |
| DefineNat | |
Fields
| |
| DrawNat | |
Fields
| |
data SDDrawLine Source #
SDDrawLine describes a line in a DrawNat command.
These lines are used to specify a NaturalTransformation and a NatFormatting
used format the NaturalTransformation.
See the user's manual for notation.
Constructors
| SDDrawFun [CompElement] | |
| SDDrawNat [CompElement] |
Instances
| Show SDDrawLine Source # | |
Defined in SDParser Methods showsPrec :: Int -> SDDrawLine -> ShowS # show :: SDDrawLine -> String # showList :: [SDDrawLine] -> ShowS # | |
data CompElement Source #
(CompElement i opts) refers to the element with id i, modified with options opts
Instances
| Eq CompElement Source # | |
Defined in SDParser | |
| Show CompElement Source # | |
Defined in SDParser Methods showsPrec :: Int -> CompElement -> ShowS # show :: CompElement -> String # showList :: [CompElement] -> ShowS # | |