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>
hindent --version
for f in **/*.hs; do
/bin/echo -n "Check formatting of '$f' ..."
cat $f | hindent | diff -q - $f || exit
/bin/echo " OK."
done
\ No newline at end of file
......@@ -26,7 +26,7 @@ import System.Directory
import System.FilePath
import Text.Blaze (customAttribute)
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
(class_, height, src, style, width)
import Text.Pandoc.Definition ()
......@@ -112,9 +112,7 @@ macroMap :: MacroMap
macroMap =
Map.fromList [("meta", metaValue), ("youtube", youtube), ("fa", fontAwesome)]
readDefault
:: Read a
=> a -> String -> a
readDefault :: Read a => a -> String -> a
readDefault default_ string = fromMaybe default_ (readMaybe string)
macroArg :: Int -> [String] -> String -> String
......
......@@ -149,11 +149,8 @@ fileOrRelativeUrl _ = Nothing
-- Copy and link operations target the public directory in the project root
-- and recreate the source directory structure.
-- This function is used to provision resources that are used at presentation time.
provisionResource :: Provisioning
-> ProjectDirs
-> FilePath
-> FilePath
-> IO FilePath
provisionResource ::
Provisioning -> ProjectDirs -> FilePath -> FilePath -> IO FilePath
provisionResource provisioning dirs base path = do
resource <- resourcePathes dirs base <$> findFile (project dirs) base path
case provisioning of
......@@ -232,9 +229,7 @@ removeCommonPrefix =
isPrefix a b = isPrefix_ (splitPath a) (splitPath b)
where
isPrefix_
:: Eq a
=> [a] -> [a] -> Bool
isPrefix_ :: Eq a => [a] -> [a] -> Bool
isPrefix_ al@(a:as) bl@(b:bs)
| a == b = isPrefix_ as bs
| otherwise = False
......
......@@ -204,9 +204,7 @@ runShakeInContext context options rules = do
watchFiles = setFilesToWatch
-- | Monadic version of list concatenation.
(<++>)
:: Monad m
=> m [a] -> m [a] -> m [a]
(<++>) :: Monad m => m [a] -> m [a] -> m [a]
(<++>) = liftM2 (++)
-- | Removes the last suffix from a filename
......@@ -218,11 +216,8 @@ replaceSuffixWith suffix with pathes =
return [dropSuffix suffix d ++ with | d <- pathes]
-- | Monadic version of suffix replacement for easy binding.
calcTargetPath :: FilePath
-> String
-> String
-> [FilePath]
-> Action [FilePath]
calcTargetPath ::
FilePath -> String -> String -> [FilePath] -> Action [FilePath]
calcTargetPath projectDir suffix with pathes =
return [projectDir </> dropSuffix suffix d ++ with | d <- pathes]
......@@ -711,11 +706,8 @@ copyImages baseDir pandoc = do
kvs
return (i, cs, relKvs)
copyAndLinkFile :: FilePath
-> FilePath
-> FilePath
-> FilePath
-> Action FilePath
copyAndLinkFile ::
FilePath -> FilePath -> FilePath -> FilePath -> Action FilePath
copyAndLinkFile project public base url = do
let rel = makeRelative project 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