Units of Measure
#r "../../src/Fabulous.AST/bin/Release/netstandard2.1/publish/Fantomas.Core.dll"
#r "../../src/Fabulous.AST/bin/Release/netstandard2.1/publish/Fabulous.AST.dll"
#r "../../src/Fabulous.AST/bin/Release/netstandard2.1/publish/Fantomas.FCS.dll"
open Fabulous.AST
open type Fabulous.AST.Ast
Oak() {
AnonymousModule() {
Measure("cm")
Measure("ml", MeasurePowerType("cm", Integer "3"))
Measure("m")
Measure("s")
Measure("kg")
Measure("N", Tuple([ AppPrefix(LongIdent "kg", LongIdent "m"); MeasurePowerType("s", Integer "2") ], "/"))
}
}
|> Gen.mkOak
|> Gen.run
|> printfn "%s"
// produces the following code:
|
namespace Fabulous
namespace Fabulous.AST
type Ast =
class end
Multiple items
static member Ast.Oak: unit -> CollectionBuilder<Fantomas.Core.SyntaxOak.Oak,'marker>
--------------------
module Oak from Fabulous.AST
static member Ast.Oak: unit -> CollectionBuilder<Fantomas.Core.SyntaxOak.Oak,'marker>
--------------------
module Oak from Fabulous.AST
static member Ast.AnonymousModule: unit -> CollectionBuilder<Fantomas.Core.SyntaxOak.ModuleOrNamespaceNode,Fantomas.Core.SyntaxOak.ModuleDecl>
Multiple items
static member Ast.Measure: name: string * powerType: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeDefnAbbrevNode>
static member Ast.Measure: name: string * powerType: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeDefnAbbrevNode>
static member Ast.Measure: name: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeNameNode>
--------------------
module Measure from Fabulous.AST
--------------------
type MeasureAttribute = inherit Attribute new: unit -> MeasureAttribute
--------------------
new: unit -> MeasureAttribute
static member Ast.Measure: name: string * powerType: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeDefnAbbrevNode>
static member Ast.Measure: name: string * powerType: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeDefnAbbrevNode>
static member Ast.Measure: name: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.TypeNameNode>
--------------------
module Measure from Fabulous.AST
--------------------
type MeasureAttribute = inherit Attribute new: unit -> MeasureAttribute
--------------------
new: unit -> MeasureAttribute
static member Ast.MeasurePowerType: value: string * rational: WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode> -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.MeasurePowerType: value: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * rational: WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode> -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.MeasurePowerType: value: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * rational: WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode> -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Integer: value: int -> WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode>
static member Ast.Integer: value: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode>
static member Ast.Integer: value: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.RationalConstNode>
Multiple items
static member Ast.Tuple: items: string list * exponent: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> list * exponent: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
--------------------
module Tuple from Fabulous.AST
static member Ast.Tuple: items: string list * exponent: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> list * exponent: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.Tuple: items: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
--------------------
module Tuple from Fabulous.AST
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string list * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * argument: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string list * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string list * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string list * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * argument: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * argument: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string list * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * arguments: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string list * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> * postIdentifier: string * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string list * arguments: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.AppPrefix: t: string * postIdentifier: string * argument: WidgetBuilder<Fantomas.Core.SyntaxOak.Type> -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
(+0 other overloads)
static member Ast.LongIdent: value: string -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.LongIdent: value: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
static member Ast.LongIdent: value: string list -> WidgetBuilder<Fantomas.Core.SyntaxOak.Type>
module Gen
from Fabulous.AST
<summary> It takes the root of the widget tree and create the corresponding Fantomas node, and recursively creating all children nodes </summary>
<summary> It takes the root of the widget tree and create the corresponding Fantomas node, and recursively creating all children nodes </summary>
val mkOak: root: WidgetBuilder<'node> -> 'node
val run: oak: Fantomas.Core.SyntaxOak.Oak -> string
val printfn: format: Printf.TextWriterFormat<'T> -> 'T