From f256ef09c4a78a424e3e00b45e09430e1227559c Mon Sep 17 00:00:00 2001 From: Neil Mitchell <35463327+neil-da@users.noreply.github.com> Date: Sat, 4 May 2019 12:54:27 +0100 Subject: [PATCH] Delete modules that appear entirely unused (#909) --- da-assistant/Data/These/Extended.hs | 25 ------ .../da-hs-damlc-app/src/da-hs-damlc-app.hs | 6 -- .../src/DA/Service/JsonRpc/Arbitrary.hs | 81 ------------------- 3 files changed, 112 deletions(-) delete mode 100644 da-assistant/Data/These/Extended.hs delete mode 100644 daml-foundations/daml-tools/da-hs-damlc-app/src/da-hs-damlc-app.hs delete mode 100644 libs-haskell/da-hs-json-rpc/src/DA/Service/JsonRpc/Arbitrary.hs diff --git a/da-assistant/Data/These/Extended.hs b/da-assistant/Data/These/Extended.hs deleted file mode 100644 index 9d68a3dc41..0000000000 --- a/da-assistant/Data/These/Extended.hs +++ /dev/null @@ -1,25 +0,0 @@ --- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. --- SPDX-License-Identifier: Apache-2.0 - - -module Data.These.Extended - ( module Data.These - , justHere - , justThere - ) where - -import Data.These - --- | Extract the first half of 'These'. -justHere :: These a t -> Maybe a -justHere = \case - This a -> Just a - That _ -> Nothing - These a _ -> Just a - --- | Extract the second half of 'These'. -justThere :: These t a -> Maybe a -justThere = \case - This _ -> Nothing - That a -> Just a - These _ a -> Just a diff --git a/daml-foundations/daml-tools/da-hs-damlc-app/src/da-hs-damlc-app.hs b/daml-foundations/daml-tools/da-hs-damlc-app/src/da-hs-damlc-app.hs deleted file mode 100644 index 331ba99491..0000000000 --- a/daml-foundations/daml-tools/da-hs-damlc-app/src/da-hs-damlc-app.hs +++ /dev/null @@ -1,6 +0,0 @@ --- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. --- SPDX-License-Identifier: Apache-2.0 - -module Main (module DA.Cli.Damlc) where - -import DA.Cli.Damlc diff --git a/libs-haskell/da-hs-json-rpc/src/DA/Service/JsonRpc/Arbitrary.hs b/libs-haskell/da-hs-json-rpc/src/DA/Service/JsonRpc/Arbitrary.hs deleted file mode 100644 index 0f9f07209c..0000000000 --- a/libs-haskell/da-hs-json-rpc/src/DA/Service/JsonRpc/Arbitrary.hs +++ /dev/null @@ -1,81 +0,0 @@ --- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. --- SPDX-License-Identifier: Apache-2.0 - -{-# OPTIONS_GHC -Wno-orphans #-} -module DA.Service.JsonRpc.Arbitrary() where - -import Data.Aeson.Types -import qualified Data.HashMap.Strict as M -import Data.Text (Text) -import qualified Data.Text as T -import DA.Service.JsonRpc.Data -import Test.QuickCheck.Arbitrary -import Test.QuickCheck.Gen - -instance Arbitrary Text where - arbitrary = T.pack <$> arbitrary - -instance Arbitrary Ver where - arbitrary = elements [V1, V2] - -instance Arbitrary Request where - arbitrary = oneof - [ Request <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary - , Notif <$> arbitrary <*> arbitrary <*> arbitrary - ] - -instance Arbitrary Response where - arbitrary = oneof - [ Response <$> arbitrary <*> arbitrary <*> arbitrary - , ResponseError <$> arbitrary <*> arbitrary <*> arbitrary - , OrphanError <$> arbitrary <*> arbitrary - ] - - -instance Arbitrary ErrorObj where - arbitrary = oneof - [ ErrorObj <$> arbitrary <*> arbitrary <*> arbitrary - , ErrorVal <$> arbitrary - ] - -instance Arbitrary BatchRequest where - arbitrary = oneof - [ BatchRequest <$> arbitrary - , SingleRequest <$> arbitrary - ] - -instance Arbitrary BatchResponse where - arbitrary = oneof - [ BatchResponse <$> arbitrary - , SingleResponse <$> arbitrary - ] - -instance Arbitrary Message where - arbitrary = oneof - [ MsgRequest <$> arbitrary - , MsgResponse <$> arbitrary - , MsgBatch <$> batch - ] - where - batch = listOf $ oneof [ MsgRequest <$> arbitrary - , MsgResponse <$> arbitrary - ] - -instance Arbitrary Id where - arbitrary = oneof [IdInt <$> arbitrary, IdTxt <$> arbitrary] - -instance Arbitrary Value where - arbitrary = resize 10 $ oneof [nonull, lsn, objn] where - nonull = oneof - [ toJSON <$> (arbitrary :: Gen String) - , toJSON <$> (arbitrary :: Gen Int) - , toJSON <$> (arbitrary :: Gen Double) - , toJSON <$> (arbitrary :: Gen Bool) - ] - val = oneof [ nonull, return Null ] - ls = toJSON <$> listOf val - obj = toJSON . M.fromList <$> listOf ps - ps = (,) <$> (arbitrary :: Gen String) <*> oneof [val, ls] - lsn = toJSON <$> listOf (oneof [ls, obj, val]) - objn = toJSON . M.fromList <$> listOf psn - psn = (,) <$> (arbitrary :: Gen String) <*> oneof [val, ls, obj]