aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-05-14 11:22:44 +0100
committerYann Herklotz <git@ymhg.org>2019-05-14 11:22:44 +0100
commitdefc7aa7ed9d93821aa4787f01ff143a9a256b35 (patch)
treeb0e11865bc9966a422ea317fd5220b2df74492c9 /src
parent76e9b994258d9af87868ba9f420db4ee1c29de67 (diff)
downloadverismith-defc7aa7ed9d93821aa4787f01ff143a9a256b35.tar.gz
verismith-defc7aa7ed9d93821aa4787f01ff143a9a256b35.zip
Add renameSource
Diffstat (limited to 'src')
-rw-r--r--src/VeriFuzz/Sim/Internal.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/VeriFuzz/Sim/Internal.hs b/src/VeriFuzz/Sim/Internal.hs
index ea90122..5c58e1a 100644
--- a/src/VeriFuzz/Sim/Internal.hs
+++ b/src/VeriFuzz/Sim/Internal.hs
@@ -19,6 +19,7 @@ module VeriFuzz.Sim.Internal
, Simulator(..)
, Synthesiser(..)
, Failed(..)
+ , renameSource
, checkPresent
, checkPresentModules
, replace
@@ -95,6 +96,10 @@ class Tool a => Synthesiser a where
synthOutput :: a -> FilePath
setSynthOutput :: a -> FilePath -> a
+renameSource :: (Synthesiser a) => a -> SourceInfo -> SourceInfo
+renameSource a src =
+ src & infoSrc . _Wrapped . traverse . modId . _Wrapped %~ (<> toText a)
+
-- | Type synonym for a 'ResultT' that will be used throughout 'VeriFuzz'. This
-- has instances for 'MonadSh' and 'MonadIO' if the 'Monad' it is parametrised
-- with also has those instances.