Skip to content

Commit

Permalink
Remove now-unused utilities from World module
Browse files Browse the repository at this point in the history
No longer needed now that the world target is handled via UserTarget.
  • Loading branch information
dcoutts committed Feb 13, 2011
1 parent 68a77a3 commit 90d1256
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions Distribution/Client/World.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ module Distribution.Client.World (
insert,
delete,
getContents,

worldPkg,
isWorldTarget,
isGoodWorldTarget,
) where

import Distribution.Client.Types
( UnresolvedDependency(..) )
import Distribution.Package
( PackageName(..), Dependency(..) )
( Dependency(..) )
import Distribution.PackageDescription
( FlagAssignment, FlagName(FlagName) )
import Distribution.Version( anyVersion )
import Distribution.Verbosity
( Verbosity )
import Distribution.Simple.Utils
Expand Down Expand Up @@ -130,26 +123,6 @@ getContents world = do
| otherwise = ioError e


-- | A dummy package that represents the world file.
worldPkg :: PackageName
worldPkg = PackageName "world"

-- | Currently we have a silly way of representing the world target as
-- an 'UnresolvedDependency' so we need a way to recognise it.
--
-- We should be using a structured type with various target kinds, like
-- local file, repo package etc.
--
isWorldTarget :: UnresolvedDependency -> Bool
isWorldTarget (UnresolvedDependency (Dependency pkg _) _) =
pkg == worldPkg

isGoodWorldTarget :: UnresolvedDependency -> Bool
isGoodWorldTarget (UnresolvedDependency (Dependency pkg ver) flags) =
pkg == worldPkg
&& ver == anyVersion
&& null flags

instance Text WorldPkgInfo where
disp (WorldPkgInfo dep flags) = disp dep <+> dispFlags flags
where
Expand Down

0 comments on commit 90d1256

Please sign in to comment.