Skip to content

Commit

Permalink
Fixed a potential issue with lambdas returning multiple expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rickasaurus committed Dec 10, 2014
1 parent 5ebbe95 commit d396974
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Barb/Reduce.fs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ let resolveExpression exprs initialBindings settings (finalReduction: bool) =
| Lambda {Params = []; Contents = lambdaContents; Bindings = lambdaBindings } ->
let totalBindings = Seq.concat [(Map.toSeq initialBindings); (Map.toSeq lambdaBindings)] |> Map.ofSeq
match reduceExpressions [] [lambdaContents] totalBindings |> fst with
| {Expr = SubExpression (v :: [])} :: _ -> v |> Some
| {Expr = SubExpression _ } :: _ -> None
| {Expr = SubExpression (v :: [])} :: [] -> v |> Some
| {Expr = SubExpression _ } :: [] -> None
| result :: [] -> result |> Some
| many -> None
| And (lExpr, rExpr) ->
Expand Down

0 comments on commit d396974

Please sign in to comment.