Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-thomas committed Mar 25, 2022
2 parents f4af104 + 692055c commit b374c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/PatternMatching.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object PatternMatching {
case class UnaryOperation(operator: String, argument: Expression) extends Expression
case class BinaryOperation(operator: String, left: Expression, right: Expression) extends Expression

// Write a function that uses pattern matching to simplify double negation, adding and multiplying by 1
// Write a function that uses pattern matching to simplify double negation, adding 0 and multiplying by 1
// e.g. UnOp("-", UnOp("-", e) == e (think --1 == 1)

// Think carefully about what is actually happening here, this a powerful example of pattern matching
Expand Down

0 comments on commit b374c6e

Please sign in to comment.