From 41e166f1f966f6c7b2d7c379a33dbfba36913e8a Mon Sep 17 00:00:00 2001 From: Steven Ramsay Date: Fri, 22 Oct 2021 15:43:32 +0100 Subject: [PATCH 1/2] fix compile error due to typo --- src/Cycleq/Reduction.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cycleq/Reduction.hs b/src/Cycleq/Reduction.hs index 752447f..5d1767d 100644 --- a/src/Cycleq/Reduction.hs +++ b/src/Cycleq/Reduction.hs @@ -84,7 +84,7 @@ reduce expr0 = go expr0 [] Nothing -> empty go (Tick _ expr) args = go expr args go (Type ty) args = pure (mkApps (Type ty) args) - go expr args = pprPanic "Unsupported expression!" (ppr (mkApps exp args)) + go expr args = pprPanic "Unsupported expression!" (ppr (mkApps expr args)) -- | Match a core expression against a first-order normal form. viewNormalForm :: CoreExpr -> Maybe (Either (DataCon, [CoreArg]) Literal) From 631dc83c5519fe157960ca1ce150a1f56364808e Mon Sep 17 00:00:00 2001 From: Steven Ramsay Date: Fri, 22 Oct 2021 15:44:26 +0100 Subject: [PATCH 2/2] fix bug when proofs dir does not exist --- cycleq.cabal | 3 ++- src/Cycleq.hs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cycleq.cabal b/cycleq.cabal index bcb8dba..f3804a0 100644 --- a/cycleq.cabal +++ b/cycleq.cabal @@ -27,7 +27,8 @@ library text, process, ghc, - graphviz + graphviz, + directory ghc-options: -Wall -Wcompat diff --git a/src/Cycleq.hs b/src/Cycleq.hs index 4561d8c..885c85c 100644 --- a/src/Cycleq.hs +++ b/src/Cycleq.hs @@ -7,6 +7,7 @@ module Cycleq ) where +import System.Directory (createDirectoryIfMissing) import Control.Monad.Reader import Cycleq.Environment import Cycleq.Equation @@ -46,6 +47,7 @@ plugin = Nothing -> putMsgS "Failure!" Just proof -> do putMsgS "Success!" + liftIO $ createDirectoryIfMissing False "proofs" drawProof proof ("proofs/" ++ goalName ++ ".svg") pure mguts )