diff options
| author | David Waern <david.waern@gmail.com> | 2010-11-16 01:14:15 +0000 | 
|---|---|---|
| committer | David Waern <david.waern@gmail.com> | 2010-11-16 01:14:15 +0000 | 
| commit | 9ae1088fd211df4796dcd0a99c048e09a7c61d51 (patch) | |
| tree | eb787efc4643c897ef3a87e359e8e937f250cc5b /src/Haddock/Backends/Xhtml/Themes.hs | |
| parent | 0a53f7fd06815ea995b000ce0194c9c296772453 (diff) | |
hlint police
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Themes.hs')
| -rw-r--r-- | src/Haddock/Backends/Xhtml/Themes.hs | 10 | 
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Haddock/Backends/Xhtml/Themes.hs b/src/Haddock/Backends/Xhtml/Themes.hs index cbcf10a4..79b093ec 100644 --- a/src/Haddock/Backends/Xhtml/Themes.hs +++ b/src/Haddock/Backends/Xhtml/Themes.hs @@ -18,6 +18,7 @@ module Haddock.Backends.Xhtml.Themes (  import Haddock.Options +import Control.Applicative  import Control.Monad (liftM)  import Data.Char (toLower)  import Data.Either (lefts, rights) @@ -97,13 +98,13 @@ directoryTheme path = do  -- | Check if we have a built in theme  doesBuiltInExist :: IO PossibleThemes -> String -> IO Bool -doesBuiltInExist pts s = pts >>= return . either (const False) test  +doesBuiltInExist pts s = fmap (either (const False) test) pts    where test = isJust . findTheme s  -- | Find a built in theme  builtInTheme :: IO PossibleThemes -> String -> IO PossibleTheme -builtInTheme pts s = pts >>= return . either Left fetch +builtInTheme pts s = either Left fetch <$> pts    where fetch = maybe (Left ("Unknown theme: " ++ s)) Right . findTheme s @@ -157,9 +158,10 @@ retRight = return . Right  -- * File Utilities  -------------------------------------------------------------------------------- +  getDirectoryItems :: FilePath -> IO [FilePath]  getDirectoryItems path = -  getDirectoryContents path >>= return . map (combine path) . filter notDot +  map (combine path) . filter notDot <$> getDirectoryContents path    where notDot s = s /= "." && s /= ".." @@ -178,7 +180,7 @@ cssFiles ts = nub $ concatMap themeFiles ts  styleSheet :: Themes -> Html  styleSheet ts = toHtml $ zipWith mkLink rels ts    where -    rels = ("stylesheet" : repeat "alternate stylesheet") +    rels = "stylesheet" : repeat "alternate stylesheet"      mkLink aRel t =        thelink          ! [ href (themeHref t),  rel aRel, thetype "text/css",  | 
