Skip to content

A peer-to-peer stack for code collaboration

Move spec tests to radicle-lang and tidy up moving Radicle module to radicle-lang, fixing up Radicle.Internal to just be the bindings export.

Fintan Halpennybd0537d3eb99
diff --git a/exe/Doc.hs b/exe/Doc.hs
index 94a4a6c..afcb67f 100644
--- a/exe/Doc.hs
+++ b/exe/Doc.hs
@@ -7,6 +7,7 @@ import Protolude
import qualified Data.Text as T
import Options.Applicative
import Radicle
+import Radicle.Internal
import Text.Pandoc
main :: IO ()
diff --git a/exe/RadicleExe.hs b/exe/RadicleExe.hs
index c8ce46c..6f697e0 100644
--- a/exe/RadicleExe.hs
+++ b/exe/RadicleExe.hs
@@ -8,6 +8,7 @@ import Options.Applicative
import System.Directory (doesFileExist)
import Radicle
+import Radicle.Internal
main :: IO ()
main = do
diff --git a/exe/RadicleRepl.hs b/exe/RadicleRepl.hs
index b2907b0..f413fc3 100644
--- a/exe/RadicleRepl.hs
+++ b/exe/RadicleRepl.hs
@@ -6,6 +6,7 @@ import Protolude hiding (TypeError, option, sourceFile)
import Options.Applicative
import Radicle
+import Radicle.Internal
main :: IO ()
main = do
diff --git a/exe/ReferenceDoc.hs b/exe/ReferenceDoc.hs
index 6855c04..c0e167b 100644
--- a/exe/ReferenceDoc.hs
+++ b/exe/ReferenceDoc.hs
@@ -14,6 +14,7 @@ import qualified Data.Text as T
import Data.Yaml hiding (Value)
import Radicle
import qualified Radicle.Daemon.HttpApi as Daemon
+import Radicle.Internal
import Radicle.Internal.Core
import qualified Radicle.Internal.Doc as Doc
import Radicle.Internal.Identifier
diff --git a/package.yaml b/package.yaml
index 5f3c3cb..63873a7 100644
--- a/package.yaml
+++ b/package.yaml
@@ -81,32 +81,6 @@ library:
- vector
tests:
- spec:
- main: Main.hs
- source-dirs:
- - test/spec
- dependencies:
- - radicle
- - async
- - containers
- - cryptonite
- - interpolate
- - megaparsec
- - process
- - QuickCheck
- - quickcheck-instances
- - scientific
- - serialise
- - stm
- - string-qq
- - tasty
- - tasty-hunit
- - tasty-quickcheck
- - text
- - time
- build-tools:
- - tasty-discover
- ghc-options: [-threaded, -rtsopts, -with-rtsopts=-N]
doctest:
main: Main.hs
source-dirs:
diff --git a/radicle-lang/package.yaml b/radicle-lang/package.yaml
index 27a8b5b..3d0bfed 100644
--- a/radicle-lang/package.yaml
+++ b/radicle-lang/package.yaml
@@ -54,6 +54,35 @@ library:
- unordered-containers
- vector
+tests:
+ spec:
+ main: Main.hs
+ source-dirs:
+ - test/spec
+ dependencies:
+ - async
+ - containers
+ - cryptonite
+ - interpolate
+ - megaparsec
+ - process
+ - protolude
+ - QuickCheck
+ - quickcheck-instances
+ - radicle-lang
+ - scientific
+ - serialise
+ - stm
+ - string-qq
+ - tasty
+ - tasty-hunit
+ - tasty-quickcheck
+ - text
+ - time
+ build-tools:
+ - tasty-discover
+ ghc-options: [-threaded, -rtsopts, -with-rtsopts=-N]
+
default-extensions:
- ConstraintKinds
- DefaultSignatures
diff --git a/src/Radicle.hs b/radicle-lang/src/Radicle.hs
similarity index 80%
rename from src/Radicle.hs
rename to radicle-lang/src/Radicle.hs
index 3e70ff6..3da827e 100644
--- a/src/Radicle.hs
+++ b/radicle-lang/src/Radicle.hs
@@ -89,7 +89,6 @@ module Radicle
, replPrimFns
, addPrimFns
, ReplM
- , createImpureBindings
-- * CLI
, getHistoryFile
@@ -105,4 +104,15 @@ module Radicle
import Control.Monad.Identity (runIdentity)
import Data.Text.Prettyprint.Doc
-import Radicle.Internal
+import Radicle.Internal.Annotation
+import Radicle.Internal.CLI
+import Radicle.Internal.Core
+import Radicle.Internal.Effects
+import Radicle.Internal.Eval
+import Radicle.Internal.Identifier
+import Radicle.Internal.Interpret
+import Radicle.Internal.Json
+import Radicle.Internal.Parse
+import Radicle.Internal.Pretty
+import Radicle.Internal.PrimFns
+import Radicle.Internal.Type
diff --git a/test/spec/Main.hs b/radicle-lang/test/spec/Main.hs
similarity index 100%
rename from test/spec/Main.hs
rename to radicle-lang/test/spec/Main.hs
diff --git a/test/spec/Radicle/Internal/Arbitrary.hs b/radicle-lang/test/spec/Radicle/Internal/Arbitrary.hs
similarity index 100%
rename from test/spec/Radicle/Internal/Arbitrary.hs
rename to radicle-lang/test/spec/Radicle/Internal/Arbitrary.hs
diff --git a/test/spec/Radicle/Internal/ConcurrentMapTest.hs b/radicle-lang/test/spec/Radicle/Internal/ConcurrentMapTest.hs
similarity index 100%
rename from test/spec/Radicle/Internal/ConcurrentMapTest.hs
rename to radicle-lang/test/spec/Radicle/Internal/ConcurrentMapTest.hs
diff --git a/test/spec/Radicle/Internal/Foo.hs b/radicle-lang/test/spec/Radicle/Internal/Foo.hs
similarity index 100%
rename from test/spec/Radicle/Internal/Foo.hs
rename to radicle-lang/test/spec/Radicle/Internal/Foo.hs
diff --git a/test/spec/Radicle/Internal/TestCapabilities.hs b/radicle-lang/test/spec/Radicle/Internal/TestCapabilities.hs
similarity index 100%
rename from test/spec/Radicle/Internal/TestCapabilities.hs
rename to radicle-lang/test/spec/Radicle/Internal/TestCapabilities.hs
diff --git a/test/spec/Radicle/Tests.hs b/radicle-lang/test/spec/Radicle/Tests.hs
similarity index 100%
rename from test/spec/Radicle/Tests.hs
rename to radicle-lang/test/spec/Radicle/Tests.hs
diff --git a/src/Radicle/Internal.hs b/src/Radicle/Internal.hs
index e27d98c..9da69ab 100644
--- a/src/Radicle/Internal.hs
+++ b/src/Radicle/Internal.hs
@@ -1,22 +1,12 @@
module Radicle.Internal
- ( module X
- , createImpureBindings
+ ( createImpureBindings
) where
import Protolude
import Radicle.Daemon.Client (createDaemonClientPrimFns)
-import Radicle.Internal.Annotation as X
-import Radicle.Internal.CLI as X
-import Radicle.Internal.Core as X
-import Radicle.Internal.Effects as X
-import Radicle.Internal.Eval as X
-import Radicle.Internal.Identifier as X
-import Radicle.Internal.Interpret as X
-import Radicle.Internal.Json as X
-import Radicle.Internal.Parse as X
-import Radicle.Internal.Pretty as X
-import Radicle.Internal.PrimFns as X
-import Radicle.Internal.Type as X
+import Radicle.Internal.Core (Bindings, PrimFns)
+import Radicle.Internal.Effects (ReplM, replPrimFns)
+import Radicle.Internal.PrimFns (addPrimFns, pureEnv)
-- | Create all impure bindings. This is in IO so as to create a
-- manager for the HTTP requests to the daemon.