Commit f652a9ff authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Upgraded hindent to version 5.2.3

parent 2fd45269
#!/bin/sh #!/bin/sh -e
# Author: Henrik Tramberend <henrik@tramberend.de> # Author: Henrik Tramberend <henrik@tramberend.de>
hindent --version
for f in **/*.hs; do for f in **/*.hs; do
/bin/echo -n "Check formatting of '$f' ..."
cat $f | hindent | diff -q - $f || exit cat $f | hindent | diff -q - $f || exit
/bin/echo " OK."
done done
\ No newline at end of file
...@@ -26,7 +26,7 @@ import System.Directory ...@@ -26,7 +26,7 @@ import System.Directory
import System.FilePath import System.FilePath
import Text.Blaze (customAttribute) import Text.Blaze (customAttribute)
import Text.Blaze.Html.Renderer.String import Text.Blaze.Html.Renderer.String
import Text.Blaze.Html5 as H (div, figure, iframe, p, toValue, (!)) import Text.Blaze.Html5 as H ((!), div, figure, iframe, p, toValue)
import Text.Blaze.Html5.Attributes as A import Text.Blaze.Html5.Attributes as A
(class_, height, src, style, width) (class_, height, src, style, width)
import Text.Pandoc.Definition () import Text.Pandoc.Definition ()
...@@ -112,9 +112,7 @@ macroMap :: MacroMap ...@@ -112,9 +112,7 @@ macroMap :: MacroMap
macroMap = macroMap =
Map.fromList [("meta", metaValue), ("youtube", youtube), ("fa", fontAwesome)] Map.fromList [("meta", metaValue), ("youtube", youtube), ("fa", fontAwesome)]
readDefault readDefault :: Read a => a -> String -> a
:: Read a
=> a -> String -> a
readDefault default_ string = fromMaybe default_ (readMaybe string) readDefault default_ string = fromMaybe default_ (readMaybe string)
macroArg :: Int -> [String] -> String -> String macroArg :: Int -> [String] -> String -> String
......
...@@ -149,11 +149,8 @@ fileOrRelativeUrl _ = Nothing ...@@ -149,11 +149,8 @@ fileOrRelativeUrl _ = Nothing
-- Copy and link operations target the public directory in the project root -- Copy and link operations target the public directory in the project root
-- and recreate the source directory structure. -- and recreate the source directory structure.
-- This function is used to provision resources that are used at presentation time. -- This function is used to provision resources that are used at presentation time.
provisionResource :: Provisioning provisionResource ::
-> ProjectDirs Provisioning -> ProjectDirs -> FilePath -> FilePath -> IO FilePath
-> FilePath
-> FilePath
-> IO FilePath
provisionResource provisioning dirs base path = do provisionResource provisioning dirs base path = do
resource <- resourcePathes dirs base <$> findFile (project dirs) base path resource <- resourcePathes dirs base <$> findFile (project dirs) base path
case provisioning of case provisioning of
...@@ -232,9 +229,7 @@ removeCommonPrefix = ...@@ -232,9 +229,7 @@ removeCommonPrefix =
isPrefix a b = isPrefix_ (splitPath a) (splitPath b) isPrefix a b = isPrefix_ (splitPath a) (splitPath b)
where where
isPrefix_ isPrefix_ :: Eq a => [a] -> [a] -> Bool
:: Eq a
=> [a] -> [a] -> Bool
isPrefix_ al@(a:as) bl@(b:bs) isPrefix_ al@(a:as) bl@(b:bs)
| a == b = isPrefix_ as bs | a == b = isPrefix_ as bs
| otherwise = False | otherwise = False
......
...@@ -204,9 +204,7 @@ runShakeInContext context options rules = do ...@@ -204,9 +204,7 @@ runShakeInContext context options rules = do
watchFiles = setFilesToWatch watchFiles = setFilesToWatch
-- | Monadic version of list concatenation. -- | Monadic version of list concatenation.
(<++>) (<++>) :: Monad m => m [a] -> m [a] -> m [a]
:: Monad m
=> m [a] -> m [a] -> m [a]
(<++>) = liftM2 (++) (<++>) = liftM2 (++)
-- | Removes the last suffix from a filename -- | Removes the last suffix from a filename
...@@ -218,11 +216,8 @@ replaceSuffixWith suffix with pathes = ...@@ -218,11 +216,8 @@ replaceSuffixWith suffix with pathes =
return [dropSuffix suffix d ++ with | d <- pathes] return [dropSuffix suffix d ++ with | d <- pathes]
-- | Monadic version of suffix replacement for easy binding. -- | Monadic version of suffix replacement for easy binding.
calcTargetPath :: FilePath calcTargetPath ::
-> String FilePath -> String -> String -> [FilePath] -> Action [FilePath]
-> String
-> [FilePath]
-> Action [FilePath]
calcTargetPath projectDir suffix with pathes = calcTargetPath projectDir suffix with pathes =
return [projectDir </> dropSuffix suffix d ++ with | d <- pathes] return [projectDir </> dropSuffix suffix d ++ with | d <- pathes]
...@@ -711,11 +706,8 @@ copyImages baseDir pandoc = do ...@@ -711,11 +706,8 @@ copyImages baseDir pandoc = do
kvs kvs
return (i, cs, relKvs) return (i, cs, relKvs)
copyAndLinkFile :: FilePath copyAndLinkFile ::
-> FilePath FilePath -> FilePath -> FilePath -> FilePath -> Action FilePath
-> FilePath
-> FilePath
-> Action FilePath
copyAndLinkFile project public base url = do copyAndLinkFile project public base url = do
let rel = makeRelative project url let rel = makeRelative project url
if rel == url if rel == url
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment