@@ -111,7 +111,7 @@ printGroups api registry = do
111111 -- is very naive about what is the canonical name and what is an alias.
112112 CM. forM_ es $ \ e -> do
113113 let same = L. sort [ f | f <- es, enumValue e == enumValue f ]
114- CM. when (e == head same) $ do
114+ CM. when (e == head same) $
115115 hRender h $ Comment (" * " ++ linkToToken e ++
116116 (case tail same of
117117 [] -> " "
@@ -274,7 +274,7 @@ extensionModules api registry =
274274 ]
275275 where suppProfs = latestProfiles api
276276 isProfileDependent mods = any (`S.member` allProfileNames) (mentionedProfileNames mods)
277- mentionedProfileNames mods = DM. catMaybes . map modificationProfile $ mods
277+ mentionedProfileNames = DM. mapMaybe modificationProfile
278278 allProfileNames = S. fromList . DM. catMaybes $ suppProfs
279279
280280-- We only consider non-empty supported extensions/modifications for the given API.
@@ -283,7 +283,7 @@ supportedExtensions api registry =
283283 [ nameAndMods
284284 | ext <- extensions registry
285285 , api `supports` extensionSupported ext
286- , nameAndMods@ (_,( _: _) ) <- [nameAndModifications ext] ]
286+ , nameAndMods@ (_, _: _) <- [nameAndModifications ext] ]
287287 where nameAndModifications :: Extension -> (ExtensionName , [Modification ])
288288 nameAndModifications e =
289289 (extensionName e,
@@ -351,11 +351,11 @@ printExtensionSupport extModules = do
351351 extString = joinWords [ extensionNameAPI extName
352352 , extensionNameCategory extName
353353 , extensionNameName extName ]
354- SI. hPutStrLn h $ " "
354+ SI. hPutStrLn h " "
355355 hRender h $ Comment (" | Is the " ++ extensionHyperlink extName ++ " extension supported?" )
356356 SI. hPutStrLn h $ predNameMonad ++ " :: MonadIO m => m Bool"
357357 SI. hPutStrLn h $ predNameMonad ++ " = getExtensions >>= (return . member " ++ show extString ++ " )"
358- SI. hPutStrLn h $ " "
358+ SI. hPutStrLn h " "
359359 hRender h $ Comment (" | Is the " ++ extensionHyperlink extName ++ " extension supported?" )
360360 hRender h $ Comment " Note that in the presence of multiple contexts with different capabilities,"
361361 hRender h $ Comment (" this might be wrong. Use '" ++ predNameMonad ++ " ' in those cases instead." )
@@ -374,7 +374,7 @@ capitalize :: String -> String
374374capitalize str = C. toUpper (head str) : map C. toLower (tail str)
375375
376376separate :: (a -> String ) -> [a ] -> String
377- separate f = L. intercalate " ,\n " . map (" " ++ ) . map f
377+ separate f = L. intercalate " ,\n " . map (( " " ++ ) . f)
378378
379379-- Note that we handle features just like extensions.
380380printExtension :: [String ] -> Maybe ExtensionName -> ExtensionParts -> IO ()
@@ -429,7 +429,7 @@ printTopLevel api extModules = do
429429 profToReExport = profileToReExport api
430430 lastComp = featureName (latestVersion api) profToReExport
431431 moduleNames = [ moduleNameFor [c] | c <- [ lastComp, " GetProcAddress" ] ++ mangledCategories ]
432- cmnt = [ Comment (L. intercalate " "
432+ cmnt = [ Comment (unwords
433433 [ " A convenience module, combining the latest"
434434 , apiName api
435435 , maybe " version" (\ p -> unProfileName p ++ " profile" ) profToReExport
@@ -543,7 +543,7 @@ interfaceElementsFor mbProfile modifications =
543543 op Remove = S. delete
544544
545545lookup' :: (Ord k , Show k ) => k -> M. Map k a -> a
546- lookup' k m = M. findWithDefault (error (" unknown name " ++ show k)) k m
546+ lookup' k = M. findWithDefault (error (" unknown name " ++ show k)) k
547547
548548matches :: Eq a => a -> Maybe a -> Bool
549549_ `matches` Nothing = True
@@ -561,22 +561,20 @@ showCommand api registry sigMap c =
561561 showString (P. render cmnt) .
562562
563563 showString (name ++ " \n " ) .
564- showString ( " :: MonadIO m\n " ) .
564+ showString " :: MonadIO m\n " .
565565 showString (" => " ++ signature True ) .
566566 showString (name ++ args ++ " = liftIO $ " ++ dyn_name ++ " " ++ ptr_name ++ args ++ " \n\n " ) .
567567
568568 showString (" {-# NOINLINE " ++ ptr_name ++ " #-}\n " ) .
569569 showString (ptr_name ++ " :: FunPtr (" ++ compactSignature ++ " )\n " ) .
570- showString (ptr_name ++ " = unsafePerformIO $ getCommand " ++ str_name ++ " \n " ) .
571-
572- id $ " "
570+ showString (ptr_name ++ " = unsafePerformIO $ getCommand " ++ str_name ++ " \n " ) $ " "
573571
574572 where name = signatureElementName (resultType c)
575573 dyn_name = lookup' compactSignature sigMap
576574 ptr_name = " ptr_" ++ name
577575 str_name = show name
578576 compactSignature = signature False
579- signature withComment = showSignatureFromCommand registry c withComment
577+ signature = showSignatureFromCommand registry c
580578 urls = M. findWithDefault [] (api, CommandName name) manPageURLs
581579 links = L. intercalate " or " (map renderURL urls)
582580 cmnt = case concat (man ++ ve ++ al) of
0 commit comments