Skip to content

Commit 929679c

Browse files
committed
Docs and modest safety improvements.
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 36a186a commit 929679c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cabal-install/Distribution/Client/BuildTarget.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
-- Maintainer : [email protected]
99
--
1010
-- Handling for user-specified build targets
11+
-- Unlike "Distribution.Simple.BuildTarget" these build
12+
-- targets also handle package qualification (so, up to
13+
-- four levels of qualification, as opposed to the former's
14+
-- three.)
1115
-----------------------------------------------------------------------------
1216
module Distribution.Client.BuildTarget (
1317

@@ -433,7 +437,9 @@ showUserBuildTarget = intercalate ":" . components
433437

434438
showBuildTarget :: QualLevel -> BuildTarget PackageInfo -> String
435439
showBuildTarget ql = showUserBuildTarget . forgetFileStatus
436-
. head . renderBuildTarget ql
440+
. hd . renderBuildTarget ql
441+
where hd [] = error "showBuildTarget: head"
442+
hd (x:_) = x
437443

438444

439445
-- ------------------------------------------------------------

0 commit comments

Comments
 (0)