summaryrefslogtreecommitdiffstats
path: root/Utils.hs
diff options
context:
space:
mode:
authorKierán Meinhardt <kieran.meinhardt@gmail.com>2020-09-23 17:44:40 +0200
committerKierán Meinhardt <kieran.meinhardt@gmail.com>2020-09-23 17:44:40 +0200
commit8e92e6e11d2b3b0bfb5ac9d68f347219493e6380 (patch)
tree6484ca42d85ca89475e922f7b45039c116ebbf97 /Utils.hs
parent6a6ad3aecd53ffd89101a0dee2b4ea576d4964d4 (diff)
split into library + executables
Diffstat (limited to 'Utils.hs')
-rw-r--r--Utils.hs28
1 files changed, 0 insertions, 28 deletions
diff --git a/Utils.hs b/Utils.hs
deleted file mode 100644
index a14be89..0000000
--- a/Utils.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-module Utils where
-
-import Control.Exception
-import System.Directory
-import System.IO
-
-
-withTempFile :: FilePath -> String -> ((FilePath, Handle) -> IO a) -> IO a
-withTempFile tmpdir template =
- bracket (openTempFile tmpdir template) (removeFile . fst)
-
-
-mintercalate :: Monoid b => b -> [b] -> b
-mintercalate c (h:t) = foldl (\acc x -> acc <> c <> x) h t
-mintercalate _ [] = mempty
-
-
-padl :: Int -> a -> [a] -> [a]
-padl n c s =
- if length s < n
- then padl n c (c:s)
- else s
-
-padr :: Int -> a -> [a] -> [a]
-padr n c s =
- if length s < n
- then padr n c (s ++ [c])
- else s