Commit 86629015 authored by ijones's avatar ijones
Browse files

cleaned up some types

parent 17d3f6d4
...@@ -444,7 +444,7 @@ registerCmd = Cmd { ...@@ -444,7 +444,7 @@ registerCmd = Cmd {
cmdAction = RegisterCmd False cmdAction = RegisterCmd False
} }
-- | Flags to @register@: (user package, verbose) -- | Flags to @register@ and @unregister@: (user package, verbose)
type RegisterFlags = (Bool,Int) type RegisterFlags = (Bool,Int)
parseRegisterArgs :: RegisterFlags -> [String] -> [OptDescr a] -> parseRegisterArgs :: RegisterFlags -> [String] -> [OptDescr a] ->
......
...@@ -54,7 +54,7 @@ module Distribution.Simple.Register ( ...@@ -54,7 +54,7 @@ module Distribution.Simple.Register (
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..)) import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..))
import Distribution.Simple.Install (mkLibDir) import Distribution.Simple.Install (mkLibDir)
import Distribution.Setup (CompilerFlavor(..), Compiler(..)) import Distribution.Setup (CompilerFlavor(..), Compiler(..), RegisterFlags)
import Distribution.PackageDescription (setupMessage, PackageDescription(..), import Distribution.PackageDescription (setupMessage, PackageDescription(..),
BuildInfo(..), Library(..)) BuildInfo(..), Library(..))
import Distribution.Package (PackageIdentifier(..), showPackageId) import Distribution.Package (PackageIdentifier(..), showPackageId)
...@@ -89,7 +89,7 @@ import HUnit (Test) ...@@ -89,7 +89,7 @@ import HUnit (Test)
-- then we use that file, perhaps creating it. -- then we use that file, perhaps creating it.
register :: PackageDescription -> LocalBuildInfo register :: PackageDescription -> LocalBuildInfo
-> (Bool,Int) -- ^Install in the user's database?; verbose -> RegisterFlags -- ^Install in the user's database?; verbose
-> IO () -> IO ()
register pkg_descr lbi (userInst,verbose) register pkg_descr lbi (userInst,verbose)
| isNothing (library pkg_descr) = do | isNothing (library pkg_descr) = do
...@@ -201,7 +201,7 @@ mkInstalledPackageInfo pkg_descr lbi ...@@ -201,7 +201,7 @@ mkInstalledPackageInfo pkg_descr lbi
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Unregistration -- Unregistration
unregister :: PackageDescription -> LocalBuildInfo -> (Bool,Int) -> IO () unregister :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
unregister pkg_descr lbi (user_unreg, verbose) = do unregister pkg_descr lbi (user_unreg, verbose) = do
setupMessage "Unregistering" pkg_descr setupMessage "Unregistering" pkg_descr
let ghc_63_plus = compilerVersion (compiler lbi) >= Version [6,3] [] let ghc_63_plus = compilerVersion (compiler lbi) >= Version [6,3] []
...@@ -228,8 +228,6 @@ unregister pkg_descr lbi (user_unreg, verbose) = do ...@@ -228,8 +228,6 @@ unregister pkg_descr lbi (user_unreg, verbose) = do
return () return ()
_ -> _ ->
die ("only unregistering with GHC and Hugs is implemented") die ("only unregistering with GHC and Hugs is implemented")
-- ------------------------------------------------------------ -- ------------------------------------------------------------
-- * Testing -- * Testing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment