From 871334f10f2d4d8033d2aca73e8df8dc6f83c02f Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sat, 28 Mar 2015 01:23:52 +0100 Subject: Handle inplace library deps and do a rename pass --- CabalHelper/Types.hs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'CabalHelper/Types.hs') diff --git a/CabalHelper/Types.hs b/CabalHelper/Types.hs index 85cf2d2..add6dc1 100644 --- a/CabalHelper/Types.hs +++ b/CabalHelper/Types.hs @@ -14,27 +14,35 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . +{-# LANGUAGE DeriveGeneric, DefaultSignatures #-} module CabalHelper.Types where +import GHC.Generics + newtype ChModuleName = ChModuleName String - deriving (Eq, Ord, Read, Show) + deriving (Eq, Ord, Read, Show, Generic) data ChComponentName = ChSetupHsName | ChLibName | ChExeName String | ChTestName String | ChBenchName String - deriving (Eq, Ord, Read, Show) + deriving (Eq, Ord, Read, Show, Generic) -data Response - = ResponseStrings [(ChComponentName, [String])] - | ResponseEntrypoints [(ChComponentName, ChEntrypoint)] - | ResponseLbi String - deriving (Eq, Ord, Read, Show) +data ChResponse + = ChResponseStrings [(ChComponentName, [String])] + | ChResponseEntrypoints [(ChComponentName, ChEntrypoint)] + | ChResponseLbi String + deriving (Eq, Ord, Read, Show, Generic) -data ChEntrypoint = ChExeEntrypoint { chMainIs :: FilePath +data ChEntrypoint = ChSetupEntrypoint -- ^ Almost like 'ChExeEntrypoint' but + -- @main-is@ could either be @"Setup.hs"@ + -- or @"Setup.lhs"@. Since we don't know + -- where the source directory is you have + -- to find these files. + | ChLibEntrypoint { chExposedModules :: [ChModuleName] , chOtherModules :: [ChModuleName] } - | ChLibentrypoint { chExposedModules :: [ChModuleName] + | ChExeEntrypoint { chMainIs :: FilePath , chOtherModules :: [ChModuleName] - } deriving (Eq, Ord, Read, Show) + } deriving (Eq, Ord, Read, Show, Generic) -- cgit v1.2.3