StringBuffer
No description available
Install / Use
/learn @simon-reynolds/StringBufferREADME
StringBuffer
An F# computation expression for writing code with code
Builds
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
