A peer-to-peer stack for code collaboration
Add RADPATH. (#397)
Julian Arnib7d8039e98f5
diff --git a/bin/rad-issues b/bin/rad-issuesindex 041839b..94cf881 100755--- a/bin/rad-issues+++ b/bin/rad-issues@@ -1,9 +1,9 @@#!/usr/bin/env radicle-(load! "rad/prelude.rad")-(load! "rad/monadic/issues.rad")-(load! "rad/prelude/io-utils.rad")-(load! "rad/prelude/cmd-parsing.rad")+(load! (find-module-file! "prelude.rad"))+(load! (find-module-file! "monadic/issues.rad"))+(load! (find-module-file! "prelude/io-utils.rad"))+(load! (find-module-file! "prelude/cmd-parsing.rad"))(import prelude/validation :as 'validation)@@ -105,7 +105,7 @@(fn [chain options](def chain-ref (make-chain-ref chain))- (load! "rad/monadic/names.rad")+ (load! (find-module-file! "rad/monadic/names.rad"))(def names (ref (chain/load-chain! name-base)))(def add-username(fn [d]diff --git a/cloudbuild.yaml b/cloudbuild.yamlindex f542174..e4ad6e7 100644--- a/cloudbuild.yaml+++ b/cloudbuild.yaml@@ -67,7 +67,7 @@ steps:stack test :docteststack test :spec- stack exec -- radicle test/all.rad+ RADPATH="$(pwd)/rad" stack exec -- radicle test/all.rad- id: "Lint (weeder)"waitFor: ["Build"]@@ -87,7 +87,7 @@ steps:set -euxo pipefailmv docs/source/reference.rst oldref- stack exec radicle-ref-doc+ RADPATH="$(pwd)/rad" stack exec radicle-ref-docif ! (diff oldref docs/source/reference.rst); thenecho "Reference docs are not checked in"exit 1@@ -104,7 +104,7 @@ steps:- |set -euxo pipefail- stack exec radicle-doc docs/source/guide/Basics.lrad+ RADPATH="$(pwd)/rad" stack exec radicle-doc docs/source/guide/Basics.lrad- id: "Build radicle-server image"waitFor:@@ -171,6 +171,7 @@ steps:- |set -euxo pipefailexport RAD_IPFS_API_URL=http://ipfs-test-network:5001+ export RADPATH="$(pwd)/rad"stack test :e2estack exec -- radicle test/machine-backends.rad radicle-serverdiff --git a/docs/source/guide/Issues.lrad b/docs/source/guide/Issues.lradindex f750798..4382742 100644--- a/docs/source/guide/Issues.lrad+++ b/docs/source/guide/Issues.lrad@@ -11,10 +11,10 @@ exec doc -- docs/source/guide/Issues.lrad`.First we load the prelude:- (load! "rad/prelude.rad")+ (load! (find-module-file! "prelude.rad"))We'll use a ref to store the issues, as a dictionary from issue IDs to issues.-+(def issues (ref {}))To update the state of our issues we'll use `modify-ref`, a function which takes@@ -27,7 +27,7 @@ create a function for that:Next we'll define a function for creating a new issue. An issue is a dict whichlooks like:-+{ :id "ab12-xy23":author "user-id-here":title "I want pattern matching"@@ -90,7 +90,7 @@ leave such an `update` command with no restrictions; we'll talk about thatlater.(load! "rad/chain.rad")-+(def eval(updatable-eval(fn [expr state]@@ -103,7 +103,7 @@ function at the REPL.:author "james":title "Pattern matching":body "Pleeease"})-+(create {:id "a37e56bd-b66a-4f3f-af06-9eaeb4afdae9":author "julian":title "Better numbers"@@ -145,7 +145,7 @@ to issues.(modify-map issue-id(fn [i](modify-map :comments- (fn [cs] (add-right comment cs))+ (fn [cs] (add-right comment cs))i))is))))))diff --git a/docs/source/guide/Modules.lrad b/docs/source/guide/Modules.lradindex 8b91b5d..45a525e 100644--- a/docs/source/guide/Modules.lrad+++ b/docs/source/guide/Modules.lrad@@ -43,7 +43,7 @@ And then we could use this module with different values of `VAT`:(import (make-taxes 2/10));; We also need to import `prelude/io` to be able to use `print!`- (import (file-module! "rad/prelude/io.rad") :unqualified)+ (import (file-module! "prelude/io.rad") :unqualified)(print! (string-append "100 EUR + VAT is: " (show (taxes/add-VAT 100))))diff --git a/docs/source/guide/PatternMatching.lrad b/docs/source/guide/PatternMatching.lradindex b69995c..7d60555 100644--- a/docs/source/guide/PatternMatching.lrad+++ b/docs/source/guide/PatternMatching.lrad@@ -9,7 +9,7 @@ used in `match` expressions.Pattern matching is invoked as follows:;; Just getting an import out of the way- (import (file-module! "rad/prelude/io.rad") :unqualified)+ (import (file-module! "prelude/io.rad") :unqualified)(match 42'x (print! (string-append "x was: " (show x))))@@ -17,9 +17,9 @@ Pattern matching is invoked as follows:That's not very interesting, but it's all we can do before we import some morepatterns:- (import (file-module! "rad/prelude/test.rad") :unqualified)- (file-module! "rad/prelude/basic.rad")- (import (file-module! "rad/prelude/patterns.rad") :unqualified)+ (import (file-module! "prelude/test.rad") :unqualified)+ (file-module! "prelude/basic.rad")+ (import (file-module! "prelude/patterns.rad") :unqualified)Now we can pattern match on vectors, numbers, dicts, etc. For example,evaluating:@@ -69,7 +69,7 @@ These are the patterns that come included in the prelude:- The pattern `(/as x p)`, where `x` is an atom and `p` is a pattern, matchesany values that `p` matches while also binding this value to `x` in thebranch.-+## Binding variablesVariables used in patterns must be quoted because patterns are themselves@@ -77,12 +77,12 @@ evaluated. This means that if `x` is already bound to a value then it can beused in a pattern. For example:(def x 1)-+(print!(match [2 2][x 'y] (+ y y)[(+ x 1) 'y] (+ x y)))-+will print the number `3`, that is, evaluate the second branch. This is because`(+ x 1)` evaluates to `2`, and so this matches the first `2` of the value `[22]`.@@ -179,5 +179,5 @@ Will print `"DANGER! powerful player Alice Smith with spell radius 134 isapproaching!"`, but calling:(nearby bob)-+will print `"A weak elf with only 55 health is nearby! Attack!"`.diff --git a/docs/source/guide/index.rst b/docs/source/guide/index.rstindex de6f537..483c430 100644--- a/docs/source/guide/index.rst+++ b/docs/source/guide/index.rst@@ -2,7 +2,7 @@ The radicle guide==================radicle is a language for building and interacting with chains of the Open-Source Network. What these chains do--how they behave--is entirely up to you.+Source Network. What these chains do--how they behave--is entirely up to you.This guide provides an introduction to radicle--as a language, as a tool forbuilding chains, and as a means of interacting with existing chains.@@ -14,24 +14,24 @@ An exampleAs a running example, we'll create a chain for managing the issues of arepository. We'll see how to define the format of issues that can be created;how to define rights and permissions for certain types of interaction; and-how to allow for future changes to the chain.+how to allow for future changes to the chain... code-block:: radicle- (load! "rad/prelude.rad")+ (load! (find-module-file! "prelude.rad"))(def issues (ref { :open nil :closed nil }))(def system (ref {}))(def new-feature-request- (fn [author description test-case]+ (fn [author description test-case]...))(def new-bug-report- (fn [author description test-case]+ (fn [author description test-case]...))(def new-question- (fn [author description]+ (fn [author description]...))(def close-issue ...)@@ -48,7 +48,7 @@ how to allow for future changes to the chain.})- (def handle-input+ (def handle-input(fn [expr]...))diff --git a/docs/source/reference.rst b/docs/source/reference.rstindex 59b33c9..71d02d2 100644--- a/docs/source/reference.rst+++ b/docs/source/reference.rst@@ -357,6 +357,14 @@ Given a file whose code starts with module metadata, creates the module.That is, the file is evaluated as if the code was wrapped in``(module ...)``.+``find-module-file!``+~~~~~~~~~~~~~~~~~~~~~++Find a file according to radicle search path rules. These are: 1) If+RADPATH is set, first search there; 2) If RADPATH is not set, search in+the distribution directory 3) If the file is still not found, search in+the current directory.+``import``~~~~~~~~~~diff --git a/exe/Doc.hs b/exe/Doc.hsindex e0a9a00..2109033 100644--- a/exe/Doc.hs+++ b/exe/Doc.hs@@ -25,7 +25,7 @@ run f = dotxt <- readFile flet extensions = def { readerExtensions = githubMarkdownExtensions }pand <- runIOorExplode $ readMarkdown extensions txt- let code = T.append "(load! \"rad/prelude.rad\")" (getCode pand)+ let code = T.append "(load! (find-module-file! \"prelude.rad\"))" (getCode pand)res <- runLang (replBindings []) $ interpretMany (toS f) $ codecase res of(Left err, _) -> die . toS $ "Error: " ++ show errdiff --git a/exe/ReferenceDoc.hs b/exe/ReferenceDoc.hsindex 8ef3197..5b7d7cc 100644--- a/exe/ReferenceDoc.hs+++ b/exe/ReferenceDoc.hs@@ -35,8 +35,8 @@ main = dores_ <- interpret"reference-doc"( "(do"- <> "(file-module! \"rad/prelude/test-eval.rad\") (import prelude/test-eval '[eval tests] :unqualified)"- <> foldMap (\m -> "(file-module! \"rad/" <> m <> ".rad\")") (modules content)+ <> "(file-module! \"prelude/test-eval.rad\") (import prelude/test-eval '[eval tests] :unqualified)"+ <> foldMap (\m -> "(file-module! \"" <> m <> ".rad\")") (modules content)<> "(get-current-state))")(replBindings [])let res = res_ `lPanic` "Error running the prelude."diff --git a/nix/shell.nix b/nix/shell.nixindex da12324..16668fc 100644--- a/nix/shell.nix+++ b/nix/shell.nix@@ -13,7 +13,7 @@ instdenv.mkDerivation {name = "radicle-dev";- buildInputs = [ ghc zlib glibcLocales python3 wget stack postgresql moreutils fzf]+ buildInputs = [ ghc zlib glibcLocales python3 wget stack postgresql moreutils fzf docker_compose]++ (if doc then [docstuffs postgresql] else [])++ (if extras then [ vimPlugins.stylish-haskell haskellPackages.apply-refact hlint ] else []);LANG = "en_US.UTF-8";diff --git a/rad/examples/counter.rad b/rad/examples/counter.radindex 14d20e4..7cf0f3c 100644--- a/rad/examples/counter.rad+++ b/rad/examples/counter.rad@@ -9,7 +9,7 @@;; (counter/get-value "my-chain-id") ;; => 1;;-(load! "rad/prelude.rad")+(load! (find-module-file! "prelude.rad"))(import prelude/test '[assert-equal] :unqualified)diff --git a/rad/monadic/issues-upgrade.rad b/rad/monadic/issues-upgrade.radindex c89fad3..5e7c866 100644--- a/rad/monadic/issues-upgrade.rad+++ b/rad/monadic/issues-upgrade.rad@@ -1,4 +1,4 @@-(load! "rad/monadic/issues.rad")+(load! (find-module-file! "monadic/issues.rad"))(import prelude/chain :unqualified)diff --git a/rad/monadic/issues.rad b/rad/monadic/issues.radindex 6e2d11b..2887263 100644--- a/rad/monadic/issues.rad+++ b/rad/monadic/issues.rad@@ -3,9 +3,12 @@;; Create a remote issue chain. Returns a ref for the chain that you;; can assign to a variable.+{:module 'monadic/issues+ :doc "Functions for interacting with issues RSM"+ :exports '[create-issues-chain!]}(import prelude/lens :unqualified)-(import prelude/chain '[send-code! ]:unqualified)+(import prelude/chain '[send-code!] :unqualified)(import prelude/time '[install-fake-clock] :unqualified)(import prelude/io :as 'io)@@ -17,7 +20,7 @@"Create a remote issue chain with the given url."(fn [url](chain/send-prelude! url)- (send-code! url "rad/monadic/issue-remote.rad")))+ (send-code! url (find-module-file! "monadic/issue-remote.rad"))))(def sign-entity!"Assumes a key pair is stored at `my-keys.rad`. Using that key pair, will sign adiff --git a/rad/monadic/names-upgrade.rad b/rad/monadic/names-upgrade.radindex 22c95f8..45d84ea 100644--- a/rad/monadic/names-upgrade.rad+++ b/rad/monadic/names-upgrade.rad@@ -1,4 +1,4 @@-(load! "rad/monadic/names.rad")+(load! (find-module-file! "monadic/names.rad"))(import prelude/chain :unqualified)diff --git a/rad/monadic/names.rad b/rad/monadic/names.radindex 744631a..0448d59 100644--- a/rad/monadic/names.rad+++ b/rad/monadic/names.rad@@ -1,7 +1,7 @@(def create-name-chain!(fn [url](chain/send-prelude! url)- (chain/send-code! url "rad/monadic/names-remote.rad")))+ (chain/send-code! url (find-module-file! "rad/monadic/names-remote.rad"))))(def lookup-key(fn [chain-ref key]diff --git a/rad/prelude.rad b/rad/prelude.radindex 304f1ea..64774b8 100644--- a/rad/prelude.rad+++ b/rad/prelude.rad@@ -1,25 +1,25 @@-(file-module! "rad/prelude/test-eval.rad")+(file-module! "prelude/test-eval.rad")(import prelude/test-eval '[eval tests] :unqualified)-(file-module! "rad/prelude/basic.rad")-(file-module! "rad/prelude/patterns.rad")-(file-module! "rad/prelude/strings.rad")-(file-module! "rad/prelude/dict.rad")-(file-module! "rad/prelude/io.rad")-(file-module! "rad/prelude/bool.rad")-(file-module! "rad/prelude/maybe.rad")-(file-module! "rad/prelude/exception.rad")-(file-module! "rad/prelude/seq.rad")-(file-module! "rad/prelude/list.rad")-(file-module! "rad/prelude/set.rad")-(file-module! "rad/prelude/ref.rad")-(file-module! "rad/prelude/lens.rad")-(file-module! "rad/prelude/chain.rad")-(file-module! "rad/prelude/state-machine.rad")-(file-module! "rad/prelude/validation.rad")-(file-module! "rad/prelude/util.rad")-(file-module! "rad/prelude/time.rad")-(file-module! "rad/prelude/test.rad")+(file-module! "prelude/basic.rad")+(file-module! "prelude/patterns.rad")+(file-module! "prelude/strings.rad")+(file-module! "prelude/dict.rad")+(file-module! "prelude/io.rad")+(file-module! "prelude/bool.rad")+(file-module! "prelude/maybe.rad")+(file-module! "prelude/exception.rad")+(file-module! "prelude/seq.rad")+(file-module! "prelude/list.rad")+(file-module! "prelude/set.rad")+(file-module! "prelude/ref.rad")+(file-module! "prelude/lens.rad")+(file-module! "prelude/chain.rad")+(file-module! "prelude/state-machine.rad")+(file-module! "prelude/validation.rad")+(file-module! "prelude/util.rad")+(file-module! "prelude/time.rad")+(file-module! "prelude/test.rad")(import prelude/basic :unqualified)(import prelude/patterns :unqualified)diff --git a/rad/prelude/chain.rad b/rad/prelude/chain.radindex 966af7d..49abdb1 100644--- a/rad/prelude/chain.rad+++ b/rad/prelude/chain.rad@@ -245,19 +245,20 @@(def pure-prelude-files"List of files which together define the pure prelude."- ["rad/prelude/basic.rad"- "rad/prelude/patterns.rad"- "rad/prelude/strings.rad"- "rad/prelude/dict.rad"- "rad/prelude/bool.rad"- "rad/prelude/maybe.rad"- "rad/prelude/list.rad"- "rad/prelude/set.rad"- "rad/prelude/ref.rad"- "rad/prelude/lens.rad"- "rad/prelude/state-machine.rad"- "rad/prelude/validation.rad"- "rad/prelude/util.rad"])+ (map find-module-file!+ ["prelude/basic.rad"+ "prelude/patterns.rad"+ "prelude/strings.rad"+ "prelude/dict.rad"+ "prelude/bool.rad"+ "prelude/maybe.rad"+ "prelude/list.rad"+ "prelude/set.rad"+ "prelude/ref.rad"+ "prelude/lens.rad"+ "prelude/state-machine.rad"+ "prelude/validation.rad"+ "prelude/util.rad"]))(def file-to-module"Make the text of a file into code for a module."@@ -266,7 +267,7 @@(def pure-prelude-code"Code for the pure prelude. Useful as the first inputs to a new chain."- (<> [(file-to-module "rad/prelude/test-eval.rad")+ (<> [(file-to-module (find-module-file! "prelude/test-eval.rad"))'(import prelude/test-eval '[eval tests] :unqualified)](map file-to-module pure-prelude-files)))diff --git a/rad/repl.rad b/rad/repl.radindex e39f0d5..c5861d5 100644--- a/rad/repl.rad+++ b/rad/repl.rad@@ -1,4 +1,4 @@-(load! "rad/prelude.rad")+(load! (find-module-file! "prelude.rad"))(import prelude/chain '[eval] :unqualified)(def helpdiff --git a/reference-doc.yaml b/reference-doc.yamlindex 75e7d5e..91d6c4a 100644--- a/reference-doc.yaml+++ b/reference-doc.yaml@@ -81,6 +81,7 @@ primFns:- dict?# Modules- file-module!+- find-module-file!- import# State and Environment- pure-statediff --git a/src/Radicle/Internal/Effects.hs b/src/Radicle/Internal/Effects.hsindex 3c1c678..5600c8d 100644--- a/src/Radicle/Internal/Effects.hs+++ b/src/Radicle/Internal/Effects.hs@@ -38,7 +38,8 @@ type ReplM m =, ReadFile (Lang m), System m, GetEnv (Lang m) Value- , SetEnv (Lang m) Value )+ , SetEnv (Lang m) Value+ , FileModule (Lang m))instance MonadRandom (InputT IO) wheregetRandomBytes = liftIO . getRandomBytes@@ -322,12 +323,29 @@ replPrimFns sysArgs = fromList $ allDocs $\ That is, the file is evaluated as if the code was wrapped in `(module ...)`.", oneArg "file-module!" $ \caseString filename -> do- t_ <- fmap ignoreShebang <$> readFileS filename+ ef <- fileModuleS filename+ file <- case ef of+ Nothing -> throwError . toLangError . OtherError $ "File not found in RADPATH: " <> filename+ Just f -> pure f+ t_ <- fmap ignoreShebang <$> readFileS filet <- hoistEither . first (toLangError . OtherError) $ t_vs <- readValues filename tcreateModule vsv -> throwErrorHere $ TypeError "file-module!" 0 TString v)+ , ( "find-module-file!"+ , "Find a file according to radicle search path rules. These are: \+ \ 1) If RADPATH is set, first search there; \+ \ 2) If RADPATH is not set, search in the distribution directory \+ \ 3) If the file is still not found, search in the current directory."+ , oneArg "find-module-file!" $ \case+ String filename -> do+ t_ <- fileModuleS filename+ case t_ of+ Nothing -> throwError . toLangError . OtherError $ "File not found in RADPATH: " <> filename+ Just t -> pure $ String t+ v -> throwErrorHere $ TypeError "find-module-file!" 0 TString v+ )]-- | Since `#` is not a comment in radicle, we need to explictly remove shebangdiff --git a/src/Radicle/Internal/Effects/Capabilities.hs b/src/Radicle/Internal/Effects/Capabilities.hsindex 8d600ff..5cc90c4 100644--- a/src/Radicle/Internal/Effects/Capabilities.hs+++ b/src/Radicle/Internal/Effects/Capabilities.hs@@ -2,7 +2,6 @@---- The intent is that any set of primops may wear on their sleaves (i.e.-- constraints) what effects they do.-{-# LANGUAGE CPP #-}module Radicle.Internal.Effects.Capabilities whereimport Protolude@@ -10,9 +9,13 @@ import Protoludeimport qualified Data.ByteString as BSimport Data.Text.Prettyprint.Doc (PageWidth)import Data.Time+import Paths_radicleimport System.Console.ANSI (hSupportsANSI)import System.Console.Haskeline hiding (catch)+import System.Directory (doesFileExist)+import System.Environment (lookupEnv)import System.Exit (ExitCode)+import System.FilePath (splitSearchPath, (</>))import System.IO( BufferMode(LineBuffering), hClose@@ -137,8 +140,42 @@ instance ReadFile IO whereinstance {-# OVERLAPPABLE #-} ReadFile m => ReadFile (Lang m) wherereadFileS = lift . readFileS+class (Monad m) => FileModule m where+ fileModuleS :: Text -> m (Maybe Text)+instance FileModule IO where+ fileModuleS file = do+ x <- findModule $ toS file+ case x of+ Nothing -> pure Nothing+ Just f -> pure . Just $ toS f+instance FileModule (InputT IO) where+ fileModuleS = lift . fileModuleS+instance {-# OVERLAPPABLE #-} FileModule m => FileModule (Lang m) where+ fileModuleS = lift . fileModuleS+putStrLnS :: (Stdout m) => Text -> m ()putStrLnS t = putStrS t >> putStrS "\n"modifyEnvS :: (GetEnv m r, SetEnv m r) => (Env r -> Env r) -> m ()modifyEnvS f = getEnvS >>= setEnvS . f++-- | Importing works as follows:+--+-- (1) If the RADPATH environment variable exists, search there+-- (2) Otherwise search in data-dir+-- (3) Finally we search in the current directory.+--+-- RADPATH should be a colon-separated list of directories (just like PATH).+findModule :: FilePath -> IO (Maybe FilePath)+findModule file = do+ mrp <- lookupEnv "RADPATH"+ radPathDirs <- case mrp of+ Nothing -> (\x -> [x </> "rad"]) <$> getDataDir+ Just rp -> pure $ splitSearchPath rp+ let searchPath = radPathDirs ++ ["."]+ let doFind xs = case xs of+ [] -> pure Nothing+ x:xs' -> do+ exists <- doesFileExist (x </> file)+ if exists then pure (Just $ x </> file) else doFind xs'+ doFind searchPathdiff --git a/test/all.rad b/test/all.radindex e90878c..297de59 100755--- a/test/all.rad+++ b/test/all.rad@@ -3,10 +3,10 @@;; Run all tests defined in the prelude and print their results with;; TAP. Exit with status code 1 if any of the tests fail.-(load! "rad/tests/stub-primitives.rad")-(load! "rad/prelude.rad")-(load! "rad/monadic/issues.rad")-(load! "rad/monadic/names.rad")+(load! (find-module-file! "tests/stub-primitives.rad"))+(load! (find-module-file! "prelude.rad"))+(load! (find-module-file! "monadic/issues.rad"))+(load! (find-module-file! "monadic/names.rad"))(import prelude/test)diff --git a/test/spec/Radicle/Internal/TestCapabilities.hs b/test/spec/Radicle/Internal/TestCapabilities.hsindex 2522940..14592dd 100644--- a/test/spec/Radicle/Internal/TestCapabilities.hs+++ b/test/spec/Radicle/Internal/TestCapabilities.hs@@ -92,7 +92,7 @@ sourceFiles = doabsPaths <- FP.find FP.always (FP.extension FP.==? ".rad") dirfilesWithContent <- forM absPaths $ \absPath -> docontents <- readFile absPath- let path = drop (length dir + 1) absPath+ let path = drop (length dir + 5) absPathpure (toS path, contents)pure $ Map.fromList filesWithContent@@ -142,6 +142,11 @@ instance {-# OVERLAPPING #-} ReadFile TestLang whereJust f -> pure $ Right fNothing -> throwErrorHere . OtherError $ "File not found: " <> fn+instance {-# OVERLAPPING #-} FileModule TestLang where+ fileModuleS fn = do+ fs <- lift $ gets worldStateFiles+ pure $ if Map.member fn fs then Just fn else Nothing+instance Monad m => MonadRandom (StateT WorldState m) wheregetRandomBytes i = dodrg <- gets worldStateDRGdiff --git a/test/spec/Radicle/Tests.hs b/test/spec/Radicle/Tests.hsindex 3cc68a6..c8dd87b 100644--- a/test/spec/Radicle/Tests.hs+++ b/test/spec/Radicle/Tests.hs@@ -874,7 +874,7 @@ prettyEither (Right v) = renderPrettyDef v-- that the last two lines of the actual output equal @[a, b]@.assertReplInteraction :: [Text] -> [Text] -> IO ()assertReplInteraction input expected = do- (result, output) <- runCodeWithInput input "(load! \"rad/repl.rad\")"+ (result, output) <- runCodeWithInput input "(load! (find-module-file! \"repl.rad\"))"case result ofLeft err -> assertFailure $ "Error thrown in Repl: " <> toS (renderPrettyDef err)Right _ -> pure ()