Skip to content

Commit

Permalink
improve haskell module hierarchy to be more consistent (digital-asset…
Browse files Browse the repository at this point in the history
  • Loading branch information
nickchapman-da authored Jul 29, 2019
1 parent 3724a57 commit b90862e
Show file tree
Hide file tree
Showing 47 changed files with 166 additions and 166 deletions.
4 changes: 2 additions & 2 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
- Development.IDE.Core.FileStore
- DA.Sdk.Cli.System
- DA.Sdk.Cli.Version
- DAML.Assistant.Install.Path
- DA.Daml.Assistant.Install.Path
- DA.Signals
- Development.IDE.Core.Compile
- Development.IDE.GHC.Compat
Expand All @@ -102,7 +102,7 @@
- {name: unsafePerformIO, within: [DA.Daml.LFConversion.UtilGHC]}
- {name: unsafeInterleaveIO, within: []}
- {name: unsafeDupablePerformIO, within: []}
- {name: setCurrentDirectory, within: [DAML.Assistant.Tests, Main]}
- {name: setCurrentDirectory, within: [DA.Daml.Assistant.Tests, Main]}
- {name: unsafeCoerce, within: []}

# Add custom hints for this project
Expand Down
6 changes: 3 additions & 3 deletions compiler/damlc/lib/DA/Cli/Damlc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import qualified DA.Service.Logger as Logger
import qualified DA.Service.Logger.Impl.GCP as Logger.GCP
import qualified DA.Service.Logger.Impl.IO as Logger.IO
import DA.Signals
import DAML.Project.Config
import DAML.Project.Consts
import DAML.Project.Types (ConfigError, ProjectPath(..))
import DA.Daml.Project.Config
import DA.Daml.Project.Consts
import DA.Daml.Project.Types (ConfigError, ProjectPath(..))
import qualified Da.DamlLf as PLF
import qualified Data.Aeson.Encode.Pretty as Aeson.Pretty
import Data.ByteArray.Encoding (Base(Base16), convertToBase)
Expand Down
4 changes: 2 additions & 2 deletions compiler/damlc/lib/DA/Cli/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import Text.Read
import qualified DA.Pretty as Pretty
import DA.Daml.Options.Types
import qualified DA.Daml.LF.Ast.Version as LF
import DAML.Project.Consts
import DAML.Project.Types
import DA.Daml.Project.Consts
import DA.Daml.Project.Types


-- | Pretty-printing documents with syntax-highlighting annotations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module Daml.Lsp.Test.Util
module DA.Daml.Lsp.Test.Util
( Cursor
, cursorPosition
, expectDiagnostics
Expand Down
2 changes: 1 addition & 1 deletion compiler/lsp-tests/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import System.IO.Extra
import Test.Tasty
import Test.Tasty.HUnit

import Daml.Lsp.Test.Util
import DA.Daml.Lsp.Test.Util
import qualified Language.Haskell.LSP.Test as LSP

main :: IO ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import Data.Maybe
import qualified Data.Set as S
import System.Directory

import DAML.Project.Config
import DAML.Project.Consts
import DAML.Project.Types
import DA.Daml.Project.Config
import DA.Daml.Project.Consts
import DA.Daml.Project.Types

import qualified DA.Daml.LF.Ast as LF
import qualified DA.Daml.LF.ScenarioServiceClient.LowLevel as LowLevel
Expand Down
12 changes: 6 additions & 6 deletions daml-assistant/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ da_haskell_library(
srcs = glob(
["src/**/*.hs"],
exclude = [
"src/DAML/Assistant.hs",
"src/DAML/Assistant/Tests.hs",
"src/DA/Daml/Assistant.hs",
"src/DA/Daml/Assistant/Tests.hs",
],
),
hazel_deps = [
Expand Down Expand Up @@ -77,7 +77,7 @@ da_haskell_library(

da_haskell_binary(
name = "daml",
srcs = ["exe/DAML/Assistant.hs"],
srcs = ["exe/DA/Daml/Assistant.hs"],
hazel_deps = [
"base",
"directory",
Expand All @@ -88,7 +88,7 @@ da_haskell_binary(
"typed-process",
"text",
],
main_function = "DAML.Assistant.main",
main_function = "DA.Daml.Assistant.main",
src_strip_prefix = "exe",
visibility = ["//visibility:public"],
deps = [
Expand All @@ -106,7 +106,7 @@ package_app(

da_haskell_test(
name = "test",
srcs = ["test/DAML/Assistant/Tests.hs"],
srcs = ["test/DA/Daml/Assistant/Tests.hs"],
hazel_deps = [
"base",
"conduit",
Expand All @@ -123,7 +123,7 @@ da_haskell_test(
"text",
"unix-compat",
],
main_function = "DAML.Assistant.Tests.main",
main_function = "DA.Daml.Assistant.Tests.main",
src_strip_prefix = "test",
visibility = ["//visibility:public"],
deps = [
Expand Down
6 changes: 3 additions & 3 deletions daml-assistant/daml-helper/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ da_haskell_library(
name = "daml-helper-lib",
srcs = glob(
["src/**/*.hs"],
exclude = ["src/DamlHelper/Main.hs"],
exclude = ["src/DA/Daml/Helper/Main.hs"],
),
hazel_deps = [
"aeson",
Expand Down Expand Up @@ -39,11 +39,11 @@ da_haskell_library(

da_haskell_binary(
name = "daml-helper",
srcs = ["src/DamlHelper/Main.hs"],
srcs = ["src/DA/Daml/Helper/Main.hs"],
hazel_deps = [
"base",
],
main_function = "DamlHelper.Main.main",
main_function = "DA.Daml.Helper.Main.main",
visibility = ["//visibility:public"],
deps = [
":daml-helper-lib",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module DamlHelper.Main (main) where
module DA.Daml.Helper.Main (main) where

import Control.Exception
import Data.Foldable
Expand All @@ -11,7 +11,7 @@ import System.Exit
import System.IO

import DA.Signals
import DamlHelper.Run
import DA.Daml.Helper.Run

main :: IO ()
main =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module DamlHelper.Run
module DA.Daml.Helper.Run
( runDamlStudio
, runInit
, runNew
Expand Down Expand Up @@ -56,10 +56,10 @@ import System.IO
import System.IO.Extra
import Web.Browser

import DAML.Project.Config
import DAML.Project.Consts
import DAML.Project.Types
import DAML.Project.Util
import DA.Daml.Project.Config
import DA.Daml.Project.Consts
import DA.Daml.Project.Types
import DA.Daml.Project.Util

import qualified DA.Ledger as L

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Project.Config
module DA.Daml.Project.Config
( DamlConfig
, ProjectConfig
, SdkConfig
Expand All @@ -20,9 +20,9 @@ module DAML.Project.Config
, querySdkConfigRequired
) where

import DAML.Project.Consts
import DAML.Project.Types
import DAML.Project.Util
import DA.Daml.Project.Consts
import DA.Daml.Project.Types
import DA.Daml.Project.Util
import qualified Data.Text as T
import Data.Text (Text)
import qualified Data.Yaml as Y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module DAML.Project.Consts
module DA.Daml.Project.Consts
( damlPathEnvVar
, projectPathEnvVar
, sdkPathEnvVar
Expand Down Expand Up @@ -30,7 +30,7 @@ import System.Exit
import System.FilePath
import System.IO

import DAML.Project.Types
import DA.Daml.Project.Types

-- | The DAML_HOME environment variable determines the path of the daml
-- assistant data directory. This defaults to:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Project.Types
( module DAML.Project.Types
module DA.Daml.Project.Types
( module DA.Daml.Project.Types
) where

import qualified Data.Yaml as Y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module DAML.Project.Util
module DA.Daml.Project.Util
( fromRightM
, fromMaybeM
, copyDirectory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Assistant
module DA.Daml.Assistant
( main
) where

import DA.Signals
import DAML.Project.Config
import DAML.Assistant.Types
import DAML.Assistant.Env
import DAML.Assistant.Command
import DAML.Assistant.Version
import DAML.Assistant.Install
import DAML.Assistant.Util
import DA.Daml.Project.Config
import DA.Daml.Assistant.Types
import DA.Daml.Assistant.Env
import DA.Daml.Assistant.Command
import DA.Daml.Assistant.Version
import DA.Daml.Assistant.Install
import DA.Daml.Assistant.Util
import System.FilePath
import System.Directory
import System.Process.Typed
Expand Down
2 changes: 1 addition & 1 deletion daml-assistant/integration-tests/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Test.Tasty
import Test.Tasty.HUnit

import DA.Bazel.Runfiles
import DamlHelper.Run
import DA.Daml.Helper.Run
import SdkVersion

main :: IO ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Assistant.Cache
module DA.Daml.Assistant.Cache
( cacheAvailableSdkVersions
, saveAvailableSdkVersions
) where

import DAML.Assistant.Types
import DAML.Assistant.Util
import DAML.Project.Config
import DA.Daml.Assistant.Types
import DA.Daml.Assistant.Util
import DA.Daml.Project.Config
import Control.Exception.Safe
import Control.Monad.Extra
import Data.Either.Extra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Assistant.Command
module DA.Daml.Assistant.Command
( Command(..)
, BuiltinCommand(..)
, SdkCommandInfo(..)
Expand All @@ -14,7 +14,7 @@ module DAML.Assistant.Command
, getCommand
) where

import DAML.Assistant.Types
import DA.Daml.Assistant.Types
import Data.List
import Data.Maybe
import Data.Foldable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- SPDX-License-Identifier: Apache-2.0


module DAML.Assistant.Env
module DA.Daml.Assistant.Env
( Env (..)
, DamlPath (..)
, ProjectPath (..)
Expand All @@ -17,10 +17,10 @@ module DAML.Assistant.Env
, getDispatchEnv
) where

import DAML.Assistant.Types
import DAML.Assistant.Util
import DAML.Assistant.Version
import DAML.Project.Consts hiding (getDamlPath, getProjectPath)
import DA.Daml.Assistant.Types
import DA.Daml.Assistant.Util
import DA.Daml.Assistant.Version
import DA.Daml.Project.Consts hiding (getDamlPath, getProjectPath)
import System.Directory
import System.FilePath
import System.Environment.Blank
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

module DAML.Assistant.Install
module DA.Daml.Assistant.Install
( InstallOptions (..)
, InstallURL (..)
, InstallEnv (..)
Expand All @@ -11,13 +11,13 @@ module DAML.Assistant.Install
, uninstallVersion
) where

import DAML.Assistant.Types
import DAML.Assistant.Util
import qualified DAML.Assistant.Install.Github as Github
import DAML.Assistant.Install.Path
import DAML.Project.Consts
import DAML.Project.Config
import DAML.Project.Util
import DA.Daml.Assistant.Types
import DA.Daml.Assistant.Util
import qualified DA.Daml.Assistant.Install.Github as Github
import DA.Daml.Assistant.Install.Path
import DA.Daml.Project.Consts
import DA.Daml.Project.Config
import DA.Daml.Project.Util
import Safe
import Data.List
import Conduit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@


-- | Discover releases from the digital-asset/daml github.
module DAML.Assistant.Install.Github
module DA.Daml.Assistant.Install.Github
( versionURL
, getLatestVersion
) where

import DAML.Assistant.Types
import DAML.Assistant.Util
import DA.Daml.Assistant.Types
import DA.Daml.Assistant.Util
import Data.Aeson
import Network.HTTP.Client
import Network.HTTP.Client.TLS
Expand Down
Loading

0 comments on commit b90862e

Please sign in to comment.