我很难condition
在以下代码中提出定义。希望有一个例子和见解:
// a computation expression builder class
type Builder() =
.
.
.
[<CustomOperation( "condition",
MaintainsVariableSpaceUsingBind = true )>]
member this.Condition(p, [<ProjectionParameter>] b) =
condition p b
let attemp = AttemptBuilder()
let test =
attempt { let x, y = exp1, exp2
condition booleanExpr(x, y)
return (x, y) }
我认为b
是隐含的( fun x, y -> booleanExpr(x, y) )
。该术语booleanExpr(x, y)
只是一些涉及x
and的布尔表达式y
。