Copyright | Anthony Wang 2021 |
---|---|
License | MIT |
Maintainer | anthony.y.wang.math@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
SDParser
defines a parser which parses text into a list of SDCommand
s,
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:
DefineCat
is the command for defining a category.DefineFunc
is the command for defining a basic functor.DefineNat
is the command for defining a basic natural transformation.DrawNat
is the command for creating a file with the TikZ code for the drawing a string diagram of a natural transformation.
DefineCat | |
| |
DefineFunc | |
| |
DefineNat | |
| |
DrawNat | |
|
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.
Instances
Show SDDrawLine Source # | |
Defined in SDParser 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 (==) :: CompElement -> CompElement -> Bool # (/=) :: CompElement -> CompElement -> Bool # | |
Show CompElement Source # | |
Defined in SDParser showsPrec :: Int -> CompElement -> ShowS # show :: CompElement -> String # showList :: [CompElement] -> ShowS # |