From 9cb1c594fa944bdaba84de69e35118430b5590cf Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Wed, 7 Aug 2019 19:04:12 +0200 Subject: Break cycle between 'Package' and 'Unit' --- src/CabalHelper/Compiletime/Types.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/CabalHelper/Compiletime/Types.hs') diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs index d206cf0..44849f5 100644 --- a/src/CabalHelper/Compiletime/Types.hs +++ b/src/CabalHelper/Compiletime/Types.hs @@ -279,14 +279,16 @@ data QueryCache pt = QueryCache newtype DistDirLib = DistDirLib FilePath deriving (Eq, Ord, Read, Show) +type Package pt = Package' (NonEmpty (Unit pt)) + -- | A 'Package' is a named collection of many 'Unit's. -data Package pt = Package +data Package' units = Package { pPackageName :: !String , pSourceDir :: !FilePath , pCabalFile :: !CabalFile , pFlags :: ![(String, Bool)] -- | Cabal flags to set when configuring and building this package. - , pUnits :: !(NonEmpty (Unit pt)) + , pUnits :: !units } deriving (Show) -- | A 'Unit' is essentially a "build target". It is used to refer to a set @@ -303,7 +305,7 @@ data Package pt = Package -- was created in. However this is not enforced by the API. data Unit pt = Unit { uUnitId :: !UnitId - , uPackage :: !(Package pt) + , uPackage :: !(Package' ()) , uDistDir :: !DistDirLib , uImpl :: !(UnitImpl pt) } deriving (Show) -- cgit v1.2.3