Add composition operators (#32)
Some checks are pending
.NET / Check links (push) Waiting to run
.NET / Check flake (push) Waiting to run
.NET / nuget-pack (push) Waiting to run
.NET / build (Debug) (push) Waiting to run
.NET / build (Release) (push) Waiting to run
.NET / analyzers (push) Waiting to run
.NET / check-dotnet-format (push) Waiting to run
.NET / check-nix-format (push) Waiting to run
.NET / expected-pack (push) Blocked by required conditions
.NET / check-accurate-generations (push) Waiting to run
.NET / all-required-checks-complete (push) Blocked by required conditions
.NET / nuget-publish (push) Blocked by required conditions
.NET / nuget-publish-core (push) Blocked by required conditions
.NET / nuget-publish-fantomas (push) Blocked by required conditions
.NET / nuget-publish-json-plugin (push) Blocked by required conditions
.NET / nuget-publish-json-attrs (push) Blocked by required conditions
.NET / nuget-publish-argparser-plugin (push) Blocked by required conditions
.NET / nuget-publish-argparser-attrs (push) Blocked by required conditions
.NET / nuget-publish-httpclient-plugin (push) Blocked by required conditions
.NET / nuget-publish-httpclient-attrs (push) Blocked by required conditions
.NET / nuget-publish-interfacemock-plugin (push) Blocked by required conditions
.NET / nuget-publish-interfacemock-attrs (push) Blocked by required conditions
.NET / nuget-publish-swagger-plugin (push) Blocked by required conditions

This commit is contained in:
Patrick Stevens
2025-04-21 09:43:21 +01:00
committed by GitHub
parent 546762652a
commit 5849ddcbdd
4 changed files with 23 additions and 1 deletions

View File

@@ -74,6 +74,14 @@ module SynExpr =
let pipeThroughFunction (func : SynExpr) (expr : SynExpr) : SynExpr =
createAppInfix (createLongIdent'' SynLongIdent.pipe) expr |> applyTo func
/// {expr} >> {func}
let composeWith (func : SynExpr) (expr : SynExpr) : SynExpr =
createAppInfix (createLongIdent'' SynLongIdent.compose) expr |> applyTo func
/// {expr} << {func}
let leftComposeWith (func : SynExpr) (expr : SynExpr) : SynExpr =
createAppInfix (createLongIdent'' SynLongIdent.composeLeft) expr |> applyTo func
/// if {cond} then {trueBranch} else {falseBranch}
/// Note that this function puts the trueBranch last, for pipelining convenience:
/// we assume that the `else` branch is more like an error case and is less interesting.