Fabulous.AST 1.0.0-pre9

This is a prerelease version of Fabulous.AST.
dotnet add package Fabulous.AST --version 1.0.0-pre9
NuGet\Install-Package Fabulous.AST -Version 1.0.0-pre9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fabulous.AST" Version="1.0.0-pre9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fabulous.AST --version 1.0.0-pre9
#r "nuget: Fabulous.AST, 1.0.0-pre9"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Fabulous.AST as a Cake Addin
#addin nuget:?package=Fabulous.AST&version=1.0.0-pre9&prerelease

// Install Fabulous.AST as a Cake Tool
#tool nuget:?package=Fabulous.AST&version=1.0.0-pre9&prerelease


build NuGet version NuGet downloads

Welcome to the Fabulous.AST, an Abstract Syntax Tree (AST) Domain Specific Language (DSL) for F#.

Fabulous.AST uses Fantomas to generate F# code from AST. This means that you can use Fabulous.AST to generate F# code that is formatted according to the Fantomas style guide. It's designed to provide a simple and expressive way to represent code as a tree of nodes. This makes it easier to manipulate and analyze code programmatically.

Let's take a look at an AST example in Fantomas:

open Fantomas.Core
open Fantomas.Core.SyntaxOak
open Fantomas.FCS.Text
    [ ModuleOrNamespaceNode(
          [ BindingNode(
                MultipleTextsNode([ SingleTextNode("let", Range.Zero) ], Range.Zero),
                Choice1Of2(IdentListNode([ IdentifierOrDot.Ident(SingleTextNode("x", Range.Zero)) ], Range.Zero)),
                SingleTextNode("=", Range.Zero),
                Expr.Constant(Constant.FromText(SingleTextNode("12", Range.Zero))),
            |> ModuleDecl.TopLevelBinding ],
      ) ],
|> CodeFormatter.FormatOakAsync
|> Async.RunSynchronously
|> printfn "%s"

produces the following code:

let x = 12

Now let's take a look at same example using Fabulous.AST:

open Fantomas.Core
open Fabulous.AST
open type Fabulous.AST.Ast

Oak() { 
    AnonymousModule() { 
        Value("y", Unquoted "12") 
|> Gen.mkOak
|> CodeFormatter.FormatOakAsync
|> Async.RunSynchronously
|> printfn "%s"

produces the following code:

let x = 12


The full documentation for Fabulous.AST can be found at Fabulous.AST.

Other useful links:

Supporting Fabulous.AST

The simplest way to show us your support is by giving this project and the Fabulous.AST project a star. You can also support us by becoming our sponsor on the GitHub Sponsors program.


Have you found a bug or have a suggestion of how to enhance Fabulous.AST? Open an issue and we will take a look at it as soon as possible.

Do you want to contribute with a PR? PRs are always welcome, just make sure to create it from the correct branch (main) and follow the Contributor Guide.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-pre9 82 5/13/2024
1.0.0-pre8 70 5/12/2024
1.0.0-pre7 87 5/10/2024
1.0.0-pre6 69 5/10/2024
1.0.0-pre5 109 4/14/2024
1.0.0-pre4 79 4/7/2024
1.0.0-pre3 70 4/1/2024
1.0.0-pre2 88 3/27/2024
1.0.0-pre14 58 6/13/2024
1.0.0-pre13 68 6/2/2024
1.0.0-pre12 140 5/20/2024
1.0.0-pre11 78 5/16/2024
1.0.0-pre10 65 5/13/2024
1.0.0-pre1 70 3/25/2024
0.9.0 102 3/12/2024
0.8.2 78 3/11/2024
0.8.1 81 3/10/2024
0.8.0 74 3/8/2024
0.7.0 182 2/11/2024
0.6.2 192 6/8/2023
0.6.1 162 6/4/2023
0.6.0 141 5/29/2023
0.5.0 172 4/21/2023
0.4.0 196 4/13/2023
0.3.0 183 4/11/2023
0.2.0 170 4/6/2023
0.1.0 195 4/3/2023

### Added
- Support  widget by @edgarfgp in https://github.com/edgarfgp/Fabulous.AST/pull/97