StringBuffer 1.0.2

dotnet add package StringBuffer --version 1.0.2                
NuGet\Install-Package StringBuffer -Version 1.0.2                
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="StringBuffer" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StringBuffer --version 1.0.2                
#r "nuget: StringBuffer, 1.0.2"                
#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 StringBuffer as a Cake Addin
#addin nuget:?package=StringBuffer&version=1.0.2

// Install StringBuffer as a Cake Tool
#tool nuget:?package=StringBuffer&version=1.0.2                

StringBuffer

An F# computation expression for writing code with code


Builds

GitHub Actions | :---: | GitHub Actions Build History |

NuGet

Package Stable Prerelease
StringBuffer NuGet Badge NuGet Badge

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:

or

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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.2 89 11/15/2024
1.0.1 364 3/29/2024
1.0.0 82 3/29/2024

## [1.0.2] - 2024-11-15

[1.0.2]: https://github.com/simon-reynolds/StringBuffer//compare/v1.0.1...v1.0.2

### Fixed
- `indent` computation expression now directly implements methods such as `_.Zero()` instead of relying on member being visible from base computation expression builder