Both libraries use C# and it was decided to stick with C#. The following is F# code because even if we don't compile it, it's good pseudocode.
The wpf-math Atom
type Atom =
/// representing horizontal row of other atoms, separated by glue.
| Row of Atom list
/// single character in specific text style
| Char of char * textStyle: string option
/// character that does not depend on text style
| FixedChar of c:char * fontId:int
/// base atom with accent above it
| Accented of Atom * Accent
/// big delimeter (e.g. brackets)
| BigDelimiter of delimiter:Atom * size:int // why is this called BigDelimiter not BigAtom?
/// big operator with optional limits
| BigOperator of baseAtom:Atom * upperLimit:Atom * lowerLimit:Atom // baseAtom must have type BigOperator
/// base atom surrounded by delimeters
| Fenced of baseAtom:Atom * leftDelimiter:Symbol * RightDelimiter:Symbol
/// fraction, with or without separation line
| Fraction of numerator:Atom * denominator:Atom * nAlign:XAlignment * dAlign:XAlignment
/// other atom with horizontal rule above it
| Overlined of baseAtom:Atom
/// scripts to attach to other atom
| Scripts of baseAtom:Atom * subscriptAtom: Atom option * superscriptAtom: Atom option
/// whitespace
| Space of width:float<mu> * height:float<mu>
/// other atom that is not rendered
| Phantom of baseAtom:Atom * useWidth:bool * useHeight:bool * useDepth:bool
/// other atom with custom left and right types
| Typed of atom:Atom * leftType:TexAtomType * rightType:TexAtomType
/// single character that can be marked as text symbol
| CharSymbol of isTextSymbol:bool
/// symbol (non-alphanumeric character)
| Symbol of name:char * TexAtomType * isDelimiter:bool
/// other atom with delimeter and script atoms over or under it
| OverUnderDelimiter of baseAtom:Atom * script:Atom * Symbol * kern:float<mu> * over:bool
/// other atom that is underlined
| Underlined of baseAtom:Atom
/// other atom with atoms optionally over and under it
| UnderOver of baseAtom:Atom * underOver:Atom * underOverSpace:float<mu>
/// other atom vertically centered with respect to axis
| VerticallyCentered of atom:Atom
/// radical (nth-root) construction
| Radical of baseAtom:Atom * degreeAtom:Atom
/// Atom specifying graphical style.
| Styled of RowAtom* background: Brush * foreground: Brush
/// Dummy atom whose type can change or which can be replaced by a ligature.
| Dummy of atom:Atom * isTextSymbol:bool
/// gets the types of the left and rightmost children or the type of the atom itself if it childless
member t.GetLR: TexAtomType * TexAtomType = ...
member t.GetLeftType = t.GetLR |> fst
member t.GetRightType = t.GetLR |> snd
member t.Type:TexAtomType = ...
In CSharp there is an Atom class and subclasses inherit from it.
These classes also contain code to generate a Box, which describes how to lay out and render it. I think this part can be moved into a separate layer and Atom classes just used to give a structural representation.
Both libraries use C# and it was decided to stick with C#. The following is F# code because even if we don't compile it, it's good pseudocode.
The wpf-math Atom
In CSharp there is an Atom class and subclasses inherit from it.
These classes also contain code to generate a Box, which describes how to lay out and render it. I think this part can be moved into a separate layer and Atom classes just used to give a structural representation.