diff --git a/WoofWare.Whippet.Fantomas/SurfaceBaseline.txt b/WoofWare.Whippet.Fantomas/SurfaceBaseline.txt index 9c63951..526820a 100644 --- a/WoofWare.Whippet.Fantomas/SurfaceBaseline.txt +++ b/WoofWare.Whippet.Fantomas/SurfaceBaseline.txt @@ -212,6 +212,7 @@ WoofWare.Whippet.Fantomas.SynExpr.callGenericMethod [static method]: Fantomas.FC WoofWare.Whippet.Fantomas.SynExpr.callGenericMethod' [static method]: string -> string -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.callMethod [static method]: string -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.callMethodArg [static method]: string -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr +WoofWare.Whippet.Fantomas.SynExpr.composeWith [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.createCompExpr [static method]: string -> Fantomas.FCS.Syntax.SynExpr -> WoofWare.Whippet.Fantomas.CompExprBinding list -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.createDo [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.createForEach [static method]: Fantomas.FCS.Syntax.SynPat -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr @@ -235,6 +236,7 @@ WoofWare.Whippet.Fantomas.SynExpr.greaterThan [static method]: Fantomas.FCS.Synt WoofWare.Whippet.Fantomas.SynExpr.greaterThanOrEqual [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.ifThenElse [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.index [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr +WoofWare.Whippet.Fantomas.SynExpr.leftComposeWith [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.lessThan [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.lessThanOrEqual [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr WoofWare.Whippet.Fantomas.SynExpr.listCons [static method]: Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr -> Fantomas.FCS.Syntax.SynExpr @@ -286,6 +288,8 @@ WoofWare.Whippet.Fantomas.SynIdent.createS [static method]: string -> Fantomas.F WoofWare.Whippet.Fantomas.SynLongIdent inherit obj WoofWare.Whippet.Fantomas.SynLongIdent.booleanAnd [static property]: [read-only] Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.booleanOr [static property]: [read-only] Fantomas.FCS.Syntax.SynLongIdent +WoofWare.Whippet.Fantomas.SynLongIdent.compose [static property]: [read-only] Fantomas.FCS.Syntax.SynLongIdent +WoofWare.Whippet.Fantomas.SynLongIdent.composeLeft [static property]: [read-only] Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.create [static method]: Fantomas.FCS.Syntax.Ident list -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.createI [static method]: Fantomas.FCS.Syntax.Ident -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.createS [static method]: string -> Fantomas.FCS.Syntax.SynLongIdent @@ -294,6 +298,8 @@ WoofWare.Whippet.Fantomas.SynLongIdent.eq [static property]: [read-only] Fantoma WoofWare.Whippet.Fantomas.SynLongIdent.geq [static property]: [read-only] Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.get_booleanAnd [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.get_booleanOr [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent +WoofWare.Whippet.Fantomas.SynLongIdent.get_compose [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent +WoofWare.Whippet.Fantomas.SynLongIdent.get_composeLeft [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.get_eq [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.get_geq [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent WoofWare.Whippet.Fantomas.SynLongIdent.get_gt [static method]: unit -> Fantomas.FCS.Syntax.SynLongIdent diff --git a/WoofWare.Whippet.Fantomas/SynExpr.fs b/WoofWare.Whippet.Fantomas/SynExpr.fs index 3bfc415..73e7d42 100644 --- a/WoofWare.Whippet.Fantomas/SynExpr.fs +++ b/WoofWare.Whippet.Fantomas/SynExpr.fs @@ -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. diff --git a/WoofWare.Whippet.Fantomas/SynLongIdent.fs b/WoofWare.Whippet.Fantomas/SynLongIdent.fs index 90932d5..b87ec7f 100644 --- a/WoofWare.Whippet.Fantomas/SynLongIdent.fs +++ b/WoofWare.Whippet.Fantomas/SynLongIdent.fs @@ -61,6 +61,14 @@ module SynLongIdent = let pipe = SynLongIdent.SynLongIdent ([ Ident.create "op_PipeRight" ], [], [ Some (IdentTrivia.OriginalNotation "|>") ]) + /// The ">>" identifier. + let compose = + SynLongIdent.SynLongIdent ([ Ident.create "op_ComposeRight" ], [], [ Some (IdentTrivia.OriginalNotation ">>") ]) + + /// The "<<" identifier. + let composeLeft = + SynLongIdent.SynLongIdent ([ Ident.create "op_ComposeLeft" ], [], [ Some (IdentTrivia.OriginalNotation "<<") ]) + /// Convert this SynLongIdent into a human-readable string for display. /// This is not quite round-trippable, but it should be round-trippable if your identifiers are not pathological /// (e.g. you should not have a full stop in your identifiers; that's the job of LongIdent, not Ident). diff --git a/WoofWare.Whippet.Fantomas/version.json b/WoofWare.Whippet.Fantomas/version.json index 59bb1bf..8879101 100644 --- a/WoofWare.Whippet.Fantomas/version.json +++ b/WoofWare.Whippet.Fantomas/version.json @@ -1,5 +1,5 @@ { - "version": "0.5", + "version": "0.6", "publicReleaseRefSpec": [ "^refs/heads/main$" ],