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 ) 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)