From 52c0143b217059f5686e45a2a4da03a8546bf205 Mon Sep 17 00:00:00 2001 From: romes Date: Fri, 9 Dec 2022 10:15:28 +0000 Subject: [PATCH] Release v0.3.0.0 --- CHANGELOG.md | 5 +++++ hegg.cabal | 4 ++-- src/Data/Equality/Graph.hs | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d281439..beefb8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.3.0.0 -- 2022-12-09 + * A better `Analysis` tutorial in the README. * Complete `Analysis` redesign. @@ -26,6 +28,9 @@ * An `EGraph` now also has two type parameters instead of one (the latter is the language is the former the domain of the analysis). +* Allow customization of Schedulers through parameters (by accepting a scheduler + rather than a proxy for it) + ## 0.2.0.0 -- 2022-09-19 * Expose `runEqualitySaturation` to run equality saturation on existing e-graphs diff --git a/hegg.cabal b/hegg.cabal index ec0b243..90169f1 100644 --- a/hegg.cabal +++ b/hegg.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: hegg -version: 0.2.0.0 -Tested-With: GHC ==9.4.1 || ==9.2.2 || ==9.0.2 || ==8.10.7 +version: 0.3.0.0 +Tested-With: GHC ==9.4.2 || ==9.2.2 || ==9.0.2 || ==8.10.7 synopsis: Fast equality saturation in Haskell description: Fast equality saturation and equality graphs based on "egg: diff --git a/src/Data/Equality/Graph.hs b/src/Data/Equality/Graph.hs index 6b35903..e7758a0 100644 --- a/src/Data/Equality/Graph.hs +++ b/src/Data/Equality/Graph.hs @@ -62,6 +62,8 @@ import Data.Equality.Utils -- instance Ord1 l => Monoid (EGraph l) where -- mempty = EGraph emptyUF mempty mempty mempty +-- | Represent an expression (in it's fixed point form) in an e-graph. +-- Returns the updated e-graph and the id from the e-class in which it was represented. represent :: forall a l. (Analysis a l, Language l) => Fix l -> EGraph a l -> (ClassId, EGraph a l) represent = cata (flip $ \e -> uncurry add . first Node . (`runState` e) . traverse (gets >=> \(x,e') -> x <$ put e'))