Skip to content

Commit

Permalink
Use CBOR encoding for equality
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Mar 26, 2019
1 parent c1a2a10 commit 9e965b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dhall_clj/beta_normalize.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns dhall-clj.beta-normalize
(:require [dhall-clj.alpha-normalize :refer [alpha-normalize]]
[dhall-clj.ast :refer :all]
[dhall-clj.binary :refer [encode]]
[clojure.string :as string]
[medley.core :refer [map-vals]])
(:import [dhall_clj.ast NaturalLit TextLit BoolLit Lam App ListBuild ListFold
Expand All @@ -19,9 +20,9 @@
"Returns `true` if two expressions are α-equivalent and β-equivalent and
`false` otherwise"
[a b]
(let [ab-normalize (comp beta-normalize alpha-normalize)]
(= (ab-normalize a)
(ab-normalize b))))
(let [term #(-> % beta-normalize alpha-normalize encode seq)]
(= (term a)
(term b))))


(defn text-show [text]
Expand Down

0 comments on commit 9e965b0

Please sign in to comment.