An F# library that provides an easy way to write code that writes code
Get Started
| Product | Versions |
|---|---|
| .NET |
README
StringBuffer
An F# computation expression for writing code with code
Builds
| GitHub Actions |
|---|
NuGet
| Package | Stable | Prerelease |
|---|---|---|
| StringBuffer |
Using
Install the latest version from https://www.nuget.org/packages/StringBuffer/
Then use stringBuffer and indent to write your code that writes code.
stringBuffer {
"let square x ="
indent {
"x * x"
}
}
stringBuffer and indent can both be nested in each other and will correctly produce output indented as expected.
let namespaces = seq {
"System"
"System.IO"
}
let formattedCode = stringBuffer {
namespaces |> Seq.map (fun ns -> "open " + ns)
""
"module MyModule"
indent {
"let LifeUniverseAndEverything () ="
indent {
"42"
}
}
}
open System
open System.IO
module MyModule
let LifeUniverseAndEverything () =
42
Developing
Make sure the following requirements are installed on your system:
- dotnet SDK 6.0 or higher
or
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.