                       path-matches-without-binding-clause?
                       path-matches-with-binding-clause?
                       optional-path-matches-without-binding-clause?
-                      optional-path-matches-with-binding-clause?
-                      optional-clause?))
+                      optional-path-matches-with-binding-clause?))
 
 ;; helpers
 (defn clause-lens

  [path matcher bind]
  {:pre [(and (path? path) (matcher? matcher))]}
  (make-optional-path-matches-with-binding-clause path matcher bind))

;; 5.
(define-record-type
  ^{:doc "Represents an optional clause. Contains the original clause."}
  OptionalClause
  (make-optional-clause clause)
  optional-clause?
  [clause optional-clause-clause])

(defn optional
  "Takes a `clause` and returns it as an optional clause. If it already was an
  optional clause, this is the identity function."
  [clause]
  (if (optional-clause? clause)
    clause
    (make-optional-clause clause)))

(def clause? (some-fn key-exists-without-binding-clause?
                      key-exists-with-binding-clause?

          match-value (matcher->value matcher)]
      (if (predicate-matcher? matcher)
        `(~(fold-path path '_) :guard ~(match-value message path))
        (fold-path path (match-value message path))))))


(defn reduce-lhs
