From 1a657861eddcfb30d34a5946d7738e6d4033b7c8 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Tue, 2 Jan 2024 19:31:59 -0800 Subject: [PATCH] move 'Swarm.Language.*' modules to sublibrary --- .../Swarm/Language/Capability.hs | 0 .../Swarm/Language/Context.hs | 0 .../Swarm/Language/Direction.hs | 0 .../Swarm/Language/Elaborate.hs | 0 src/{ => swarm-lang}/Swarm/Language/Key.hs | 0 src/{ => swarm-lang}/Swarm/Language/LSP.hs | 0 .../Swarm/Language/LSP/Hover.hs | 0 .../Swarm/Language/LSP/VarUsage.hs | 0 src/{ => swarm-lang}/Swarm/Language/Module.hs | 0 src/{ => swarm-lang}/Swarm/Language/Parse.hs | 0 .../Swarm/Language/Parse/QQ.hs | 0 .../Swarm/Language/Pipeline.hs | 0 .../Swarm/Language/Pipeline/QQ.hs | 0 src/{ => swarm-lang}/Swarm/Language/Pretty.hs | 0 .../Swarm/Language/Requirement.hs | 0 src/{ => swarm-lang}/Swarm/Language/Syntax.hs | 0 .../Swarm/Language/Text/Markdown.hs | 0 .../Swarm/Language/Typecheck.hs | 0 .../Swarm/Language/Typecheck/Unify.hs | 0 src/{ => swarm-lang}/Swarm/Language/Typed.hs | 0 src/{ => swarm-lang}/Swarm/Language/Types.hs | 0 src/{ => swarm-lang}/Swarm/Language/Value.hs | 0 swarm.cabal | 117 +++++++++++++----- 23 files changed, 87 insertions(+), 30 deletions(-) rename src/{ => swarm-lang}/Swarm/Language/Capability.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Context.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Direction.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Elaborate.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Key.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/LSP.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/LSP/Hover.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/LSP/VarUsage.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Module.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Parse.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Parse/QQ.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Pipeline.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Pipeline/QQ.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Pretty.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Requirement.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Syntax.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Text/Markdown.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Typecheck.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Typecheck/Unify.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Typed.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Types.hs (100%) rename src/{ => swarm-lang}/Swarm/Language/Value.hs (100%) diff --git a/src/Swarm/Language/Capability.hs b/src/swarm-lang/Swarm/Language/Capability.hs similarity index 100% rename from src/Swarm/Language/Capability.hs rename to src/swarm-lang/Swarm/Language/Capability.hs diff --git a/src/Swarm/Language/Context.hs b/src/swarm-lang/Swarm/Language/Context.hs similarity index 100% rename from src/Swarm/Language/Context.hs rename to src/swarm-lang/Swarm/Language/Context.hs diff --git a/src/Swarm/Language/Direction.hs b/src/swarm-lang/Swarm/Language/Direction.hs similarity index 100% rename from src/Swarm/Language/Direction.hs rename to src/swarm-lang/Swarm/Language/Direction.hs diff --git a/src/Swarm/Language/Elaborate.hs b/src/swarm-lang/Swarm/Language/Elaborate.hs similarity index 100% rename from src/Swarm/Language/Elaborate.hs rename to src/swarm-lang/Swarm/Language/Elaborate.hs diff --git a/src/Swarm/Language/Key.hs b/src/swarm-lang/Swarm/Language/Key.hs similarity index 100% rename from src/Swarm/Language/Key.hs rename to src/swarm-lang/Swarm/Language/Key.hs diff --git a/src/Swarm/Language/LSP.hs b/src/swarm-lang/Swarm/Language/LSP.hs similarity index 100% rename from src/Swarm/Language/LSP.hs rename to src/swarm-lang/Swarm/Language/LSP.hs diff --git a/src/Swarm/Language/LSP/Hover.hs b/src/swarm-lang/Swarm/Language/LSP/Hover.hs similarity index 100% rename from src/Swarm/Language/LSP/Hover.hs rename to src/swarm-lang/Swarm/Language/LSP/Hover.hs diff --git a/src/Swarm/Language/LSP/VarUsage.hs b/src/swarm-lang/Swarm/Language/LSP/VarUsage.hs similarity index 100% rename from src/Swarm/Language/LSP/VarUsage.hs rename to src/swarm-lang/Swarm/Language/LSP/VarUsage.hs diff --git a/src/Swarm/Language/Module.hs b/src/swarm-lang/Swarm/Language/Module.hs similarity index 100% rename from src/Swarm/Language/Module.hs rename to src/swarm-lang/Swarm/Language/Module.hs diff --git a/src/Swarm/Language/Parse.hs b/src/swarm-lang/Swarm/Language/Parse.hs similarity index 100% rename from src/Swarm/Language/Parse.hs rename to src/swarm-lang/Swarm/Language/Parse.hs diff --git a/src/Swarm/Language/Parse/QQ.hs b/src/swarm-lang/Swarm/Language/Parse/QQ.hs similarity index 100% rename from src/Swarm/Language/Parse/QQ.hs rename to src/swarm-lang/Swarm/Language/Parse/QQ.hs diff --git a/src/Swarm/Language/Pipeline.hs b/src/swarm-lang/Swarm/Language/Pipeline.hs similarity index 100% rename from src/Swarm/Language/Pipeline.hs rename to src/swarm-lang/Swarm/Language/Pipeline.hs diff --git a/src/Swarm/Language/Pipeline/QQ.hs b/src/swarm-lang/Swarm/Language/Pipeline/QQ.hs similarity index 100% rename from src/Swarm/Language/Pipeline/QQ.hs rename to src/swarm-lang/Swarm/Language/Pipeline/QQ.hs diff --git a/src/Swarm/Language/Pretty.hs b/src/swarm-lang/Swarm/Language/Pretty.hs similarity index 100% rename from src/Swarm/Language/Pretty.hs rename to src/swarm-lang/Swarm/Language/Pretty.hs diff --git a/src/Swarm/Language/Requirement.hs b/src/swarm-lang/Swarm/Language/Requirement.hs similarity index 100% rename from src/Swarm/Language/Requirement.hs rename to src/swarm-lang/Swarm/Language/Requirement.hs diff --git a/src/Swarm/Language/Syntax.hs b/src/swarm-lang/Swarm/Language/Syntax.hs similarity index 100% rename from src/Swarm/Language/Syntax.hs rename to src/swarm-lang/Swarm/Language/Syntax.hs diff --git a/src/Swarm/Language/Text/Markdown.hs b/src/swarm-lang/Swarm/Language/Text/Markdown.hs similarity index 100% rename from src/Swarm/Language/Text/Markdown.hs rename to src/swarm-lang/Swarm/Language/Text/Markdown.hs diff --git a/src/Swarm/Language/Typecheck.hs b/src/swarm-lang/Swarm/Language/Typecheck.hs similarity index 100% rename from src/Swarm/Language/Typecheck.hs rename to src/swarm-lang/Swarm/Language/Typecheck.hs diff --git a/src/Swarm/Language/Typecheck/Unify.hs b/src/swarm-lang/Swarm/Language/Typecheck/Unify.hs similarity index 100% rename from src/Swarm/Language/Typecheck/Unify.hs rename to src/swarm-lang/Swarm/Language/Typecheck/Unify.hs diff --git a/src/Swarm/Language/Typed.hs b/src/swarm-lang/Swarm/Language/Typed.hs similarity index 100% rename from src/Swarm/Language/Typed.hs rename to src/swarm-lang/Swarm/Language/Typed.hs diff --git a/src/Swarm/Language/Types.hs b/src/swarm-lang/Swarm/Language/Types.hs similarity index 100% rename from src/Swarm/Language/Types.hs rename to src/swarm-lang/Swarm/Language/Types.hs diff --git a/src/Swarm/Language/Value.hs b/src/swarm-lang/Swarm/Language/Value.hs similarity index 100% rename from src/Swarm/Language/Value.hs rename to src/swarm-lang/Swarm/Language/Value.hs diff --git a/swarm.cabal b/swarm.cabal index ce77c5bbc..d4b4faf0e 100644 --- a/swarm.cabal +++ b/swarm.cabal @@ -95,6 +95,66 @@ common ghc2021-extensions -- Not GHC2021, but until we get \cases we use \case a lot LambdaCase +library swarm-lang + import: stan-config, common, ghc2021-extensions + visibility: public + exposed-modules: Swarm.Language.Capability + Swarm.Language.Context + Swarm.Language.Direction + Swarm.Language.Elaborate + Swarm.Language.Key + Swarm.Language.LSP + Swarm.Language.LSP.Hover + Swarm.Language.LSP.VarUsage + Swarm.Language.Module + Swarm.Language.Parse + Swarm.Language.Parse.QQ + Swarm.Language.Pipeline + Swarm.Language.Pipeline.QQ + Swarm.Language.Pretty + Swarm.Language.Requirement + Swarm.Language.Syntax + Swarm.Language.Text.Markdown + Swarm.Language.Typecheck + Swarm.Language.Typecheck.Unify + Swarm.Language.Typed + Swarm.Language.Types + Swarm.Language.Value + other-modules: Paths_swarm + autogen-modules: Paths_swarm + build-depends: aeson, + base, + commonmark >= 0.2 && < 0.3, + commonmark-extensions >= 0.2 && < 0.3, + containers, + extra, + lens, + lsp >= 1.6 && < 1.7, + hashable, + megaparsec, + mtl, + parser-combinators, + prettyprinter, + split, + syb >= 0.7 && < 0.8, + template-haskell, + text, + text-rope >= 0.2 && < 0.3, + transformers, + unification-fd >= 0.11 && < 0.12, + vector, + vty, + witch, + yaml, + + build-depends: swarm:swarm-util + hs-source-dirs: src/swarm-lang + default-language: Haskell2010 + default-extensions: + -- Avoid unexpected unevaluated thunk buildup + -- See discussion in #415 + StrictData + library swarm-web import: stan-config, common, ghc2021-extensions visibility: public @@ -121,6 +181,7 @@ library swarm-web wai-app-static >= 3.1.8 && < 3.1.9, warp, build-depends: swarm:swarm-util, + swarm:swarm-lang, swarm, hs-source-dirs: src/swarm-web default-language: Haskell2010 @@ -265,28 +326,6 @@ library Swarm.Game.World.Render Swarm.Game.World.Syntax Swarm.Game.World.Typecheck - Swarm.Language.Capability - Swarm.Language.Context - Swarm.Language.Direction - Swarm.Language.Elaborate - Swarm.Language.Key - Swarm.Language.LSP - Swarm.Language.LSP.Hover - Swarm.Language.LSP.VarUsage - Swarm.Language.Module - Swarm.Language.Parse - Swarm.Language.Parse.QQ - Swarm.Language.Pipeline - Swarm.Language.Pipeline.QQ - Swarm.Language.Pretty - Swarm.Language.Requirement - Swarm.Language.Syntax - Swarm.Language.Text.Markdown - Swarm.Language.Typecheck - Swarm.Language.Typecheck.Unify - Swarm.Language.Typed - Swarm.Language.Types - Swarm.Language.Value Swarm.TUI.View Swarm.TUI.View.Achievement Swarm.TUI.View.Attribute.Attr @@ -324,6 +363,27 @@ library reexported-modules: Control.Carrier.Accum.FixedStrict , Data.BoolExpr.Simplify + , Swarm.Language.Context + , Swarm.Language.Direction + , Swarm.Language.Elaborate + , Swarm.Language.Key + , Swarm.Language.LSP + , Swarm.Language.LSP.Hover + , Swarm.Language.LSP.VarUsage + , Swarm.Language.Module + , Swarm.Language.Parse + , Swarm.Language.Parse.QQ + , Swarm.Language.Pipeline + , Swarm.Language.Pipeline.QQ + , Swarm.Language.Pretty + , Swarm.Language.Requirement + , Swarm.Language.Syntax + , Swarm.Language.Text.Markdown + , Swarm.Language.Typecheck + , Swarm.Language.Typecheck.Unify + , Swarm.Language.Typed + , Swarm.Language.Types + , Swarm.Language.Value , Swarm.Util , Swarm.Util.Erasable , Swarm.Util.Lens @@ -333,6 +393,7 @@ library , Swarm.Util.UnitInterval , Swarm.Util.WindowedCounter , Swarm.Util.Yaml + , Swarm.Language.Capability other-modules: Paths_swarm autogen-modules: Paths_swarm @@ -348,8 +409,6 @@ library bytestring >= 0.10 && < 0.12, clock >= 0.8.2 && < 0.9, colour >= 2.3.6 && < 2.4, - commonmark >= 0.2 && < 0.3, - commonmark-extensions >= 0.2 && < 0.3, containers >= 0.6.2 && < 0.7, directory >= 1.3 && < 1.4, either >= 5.0 && < 5.1, @@ -367,7 +426,6 @@ library JuicyPixels >= 3.3 && < 3.4, lens >= 4.19 && < 5.3, linear >= 1.21.6 && < 1.23, - lsp >= 1.6 && < 1.7, megaparsec >= 9.6.1 && < 9.7, transformers >= 0.5 && < 0.7, mtl >= 2.2.2 && < 2.4, @@ -382,15 +440,11 @@ library SHA >= 1.6.4 && < 1.6.5, simple-enumeration >= 0.2 && < 0.3, split >= 0.2.3 && < 0.3, - syb >= 0.7 && < 0.8, tagged >= 0.8 && < 0.9, - template-haskell >= 2.16 && < 2.21, text >= 1.2.4 && < 2.1, - text-rope >= 0.2 && < 0.3, text-zipper >= 0.10 && < 0.14, time >= 1.9 && < 1.14, transformers >= 0.5.6.2 && < 0.6.2.0, - unification-fd >= 0.11 && < 0.12, unordered-containers >= 0.2.14 && < 0.3, vector >= 0.12 && < 0.14, vty >= 6.0 && < 6.1, @@ -399,7 +453,8 @@ library witherable >= 0.4 && < 0.5, word-wrap >= 0.5 && < 0.6, yaml >= 0.11 && < 0.11.12.0, - build-depends: swarm:swarm-util + build-depends: swarm:swarm-util, + swarm:swarm-lang, hs-source-dirs: src default-language: Haskell2010 default-extensions: @@ -425,6 +480,7 @@ executable swarm text, vty, swarm, + swarm:swarm-lang, swarm:swarm-web, swarm:swarm-util, if os(windows) @@ -465,6 +521,7 @@ executable swarm-docs text, transformers, vector, + swarm:swarm-lang, swarm:swarm-web, hs-source-dirs: app/doc default-language: Haskell2010