diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-08 00:29:48 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-08 00:39:06 +0200 |
| commit | ea160e993a7196d0f5aa6749b1ea046f16cf0546 (patch) | |
| tree | 96f4b92fa4293ced54d2bf1125efa969c70f9c2e /test/TestUtils.hs | |
| parent | 05fcc94a561335a6502fc98c3737a7e851d1285a (diff) | |
Add "let memo" syntax for automatic memoization
Diffstat (limited to 'test/TestUtils.hs')
| -rw-r--r-- | test/TestUtils.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/TestUtils.hs b/test/TestUtils.hs index 86b3db5..1f0d386 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -1,6 +1,8 @@ {-# OPTIONS_GHC -Wno-missing-export-lists #-} module TestUtils where +import qualified Data.Map as M +import qualified Data.Bifunctor as B import Utils testConfig :: Config @@ -35,6 +37,9 @@ expectErrorL env lc = Left (LException _ err) -> return err Right (val, _) -> error $ "unexpected success: " ++ show val +makeEnv :: [(String, AST)] -> Env +makeEnv = M.fromList . map (B.second Regular) + ast :: ASTNode -> AST ast node = AST { an = node } |
