From a9fee6041205f27462a88332a5b449136a050917 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 3 Aug 2016 02:53:14 -0700 Subject: [PATCH] Docs and modest safety improvements. Signed-off-by: Edward Z. Yang --- cabal-install/Distribution/Client/BuildTarget.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal-install/Distribution/Client/BuildTarget.hs b/cabal-install/Distribution/Client/BuildTarget.hs index e21d4b58b01..eeeb15a4220 100644 --- a/cabal-install/Distribution/Client/BuildTarget.hs +++ b/cabal-install/Distribution/Client/BuildTarget.hs @@ -8,6 +8,10 @@ -- Maintainer : duncan@community.haskell.org -- -- Handling for user-specified build targets +-- Unlike "Distribution.Simple.BuildTarget" these build +-- targets also handle package qualification (so, up to +-- four levels of qualification, as opposed to the former's +-- three.) ----------------------------------------------------------------------------- module Distribution.Client.BuildTarget ( @@ -433,7 +437,9 @@ showUserBuildTarget = intercalate ":" . components showBuildTarget :: QualLevel -> BuildTarget PackageInfo -> String showBuildTarget ql = showUserBuildTarget . forgetFileStatus - . head . renderBuildTarget ql + . hd . renderBuildTarget ql + where hd [] = error "showBuildTarget: head" + hd (x:_) = x -- ------------------------------------------------------------