@@ -624,31 +624,33 @@ renderArgs verbosity tmpFileOpts version comp platform args k = do
624
624
case o of
625
625
Html -> " index.html"
626
626
Hoogle -> pkgstr <.> " txt" )
627
- $ arg argOutput
627
+ . fromFlagOrDefault [Html ]
628
+ . argOutput
629
+ $ args
628
630
where
629
631
pkgstr = prettyShow $ packageName pkgid
630
632
pkgid = arg argPackageName
631
633
arg f = fromFlag $ f args
632
634
633
635
renderPureArgs :: Version -> Compiler -> Platform -> HaddockArgs -> [String ]
634
636
renderPureArgs version comp platform args = concat
635
- [ ( : [] ) . (\ f -> " --dump-interface=" ++ unDir (argOutputDir args) </> f)
636
- . fromFlag . argInterfaceFile $ args
637
+ [ map (\ f -> " --dump-interface=" ++ unDir (argOutputDir args) </> f)
638
+ . flagToList . argInterfaceFile $ args
637
639
638
640
, if isVersion 2 16
639
- then (\ pkg -> [ " --package-name=" ++ prettyShow (pkgName pkg)
640
- , " --package-version=" ++ prettyShow (pkgVersion pkg)
641
- ])
642
- . fromFlag . argPackageName $ args
641
+ then maybe [] (\ pkg -> [ " --package-name=" ++ prettyShow (pkgName pkg)
642
+ , " --package-version=" ++ prettyShow (pkgVersion pkg)
643
+ ])
644
+ . flagToMaybe . argPackageName $ args
643
645
else []
644
646
645
647
, [ " --since-qual=external" | isVersion 2 20 ]
646
648
647
649
, [ " --quickjump" | isVersion 2 19
648
- , fromFlag . argQuickJump $ args ]
650
+ , _ <- flagToList . argQuickJump $ args ]
649
651
650
652
, [ " --hyperlinked-source" | isVersion 2 17
651
- , fromFlag . argLinkedSource $ args ]
653
+ , True <- flagToList . argLinkedSource $ args ]
652
654
653
655
, (\ (All b,xs) -> bool (map ((" --hide=" ++ ) . prettyShow) xs) [] b)
654
656
. argHideModules $ args
@@ -673,16 +675,19 @@ renderPureArgs version comp platform args = concat
673
675
, bool [] [verbosityFlag] . getAny . argVerbose $ args
674
676
675
677
, map (\ o -> case o of Hoogle -> " --hoogle" ; Html -> " --html" )
676
- . fromFlag . argOutput $ args
678
+ . fromFlagOrDefault [] . argOutput $ args
677
679
678
680
, renderInterfaces . argInterfaces $ args
679
681
680
682
, (: [] ) . (" --odir=" ++ ) . unDir . argOutputDir $ args
681
683
682
- , (: [] ) . (" --title=" ++ )
683
- . (bool (++ " (internal documentation)" )
684
- id (getAny $ argIgnoreExports args))
685
- . fromFlag . argTitle $ args
684
+ , maybe []
685
+ ( (: [] )
686
+ . (" --title=" ++ )
687
+ . (bool (++ " (internal documentation)" )
688
+ id (getAny $ argIgnoreExports args))
689
+ )
690
+ . flagToMaybe . argTitle $ args
686
691
687
692
, [ " --optghc=" ++ opt | let opts = argGhcOptions args
688
693
, opt <- renderGhcOptions comp platform opts ]
@@ -710,7 +715,7 @@ renderPureArgs version comp platform args = concat
710
715
-- enabled
711
716
, Just x <- [hypsrc]
712
717
, isVersion 2 17
713
- , fromFlag . argLinkedSource $ args
718
+ , fromFlagOrDefault False . argLinkedSource $ args
714
719
]
715
720
, [ i ]
716
721
])
0 commit comments