aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2014-03-08 23:58:38 +0100
committerNiklas Haas <git@nand.wakku.to>2014-03-09 07:53:46 +0100
commit9aa5a2a420788e39806c5fe85845002181f3b945 (patch)
tree426a40256cd57fb90f18ef05cf004495dd5b5539 /src/Haddock/Options.hs
parent843c42c4179526a2ad3526e4c7d38cbf4d50001d (diff)
Use optLast instead of listToMaybe for sourceUrls/wikiUrls
This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates.
Diffstat (limited to 'src/Haddock/Options.hs')
-rw-r--r--src/Haddock/Options.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index 12c80b6e..2e10827e 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -32,7 +32,6 @@ module Haddock.Options (
) where
-import Data.Maybe
import Distribution.Verbosity
import Haddock.Utils
import Haddock.Types
@@ -219,16 +218,16 @@ optCssFile flags = optLast [ str | Flag_CSS str <- flags ]
sourceUrls :: [Flag] -> (Maybe String, Maybe String, Maybe String)
sourceUrls flags =
- (listToMaybe [str | Flag_SourceBaseURL str <- flags]
- ,listToMaybe [str | Flag_SourceModuleURL str <- flags]
- ,listToMaybe [str | Flag_SourceEntityURL str <- flags])
+ (optLast [str | Flag_SourceBaseURL str <- flags]
+ ,optLast [str | Flag_SourceModuleURL str <- flags]
+ ,optLast [str | Flag_SourceEntityURL str <- flags])
wikiUrls :: [Flag] -> (Maybe String, Maybe String, Maybe String)
wikiUrls flags =
- (listToMaybe [str | Flag_WikiBaseURL str <- flags]
- ,listToMaybe [str | Flag_WikiModuleURL str <- flags]
- ,listToMaybe [str | Flag_WikiEntityURL str <- flags])
+ (optLast [str | Flag_WikiBaseURL str <- flags]
+ ,optLast [str | Flag_WikiModuleURL str <- flags]
+ ,optLast [str | Flag_WikiEntityURL str <- flags])
optDumpInterfaceFile :: [Flag] -> Maybe FilePath