From 6447095bcffd101507afb65854da22bd4ee6fcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 9 Nov 2024 19:29:06 +0100 Subject: Move withVar into MonadEval type class --- src/Run/Monad.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Run') diff --git a/src/Run/Monad.hs b/src/Run/Monad.hs index 9ec9065..1890572 100644 --- a/src/Run/Monad.hs +++ b/src/Run/Monad.hs @@ -96,6 +96,8 @@ instance MonadEval TestRun where lookupVar name = maybe (fail $ "variable not in scope: '" ++ unpackVarName name ++ "'") return =<< asks (lookup name . tsVars . snd) rootNetwork = asks $ tsNetwork . snd + withVar name value = local (fmap $ \s -> s { tsVars = ( name, SomeVarValue mempty $ const $ const value ) : tsVars s }) + instance MonadOutput TestRun where getOutput = asks $ teOutput . fst -- cgit v1.2.3