From 0929246845330f7f92ba0336947c02dff170954b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Apr 2015 13:07:57 -0400 Subject: comment --- Types/Remote.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Types') diff --git a/Types/Remote.hs b/Types/Remote.hs index 5df08c775..ad8c0c4a7 100644 --- a/Types/Remote.hs +++ b/Types/Remote.hs @@ -66,7 +66,8 @@ data RemoteA a = Remote { -- (The MeterUpdate does not need to be used if it retrieves -- directly to the file, and not to an intermediate file.) retrieveKeyFile :: Key -> AssociatedFile -> FilePath -> MeterUpdate -> a Bool, - -- retrieves a key's contents to a tmp file, if it can be done cheaply + -- Retrieves a key's contents to a tmp file, if it can be done cheaply. + -- It's ok to create a symlink or hardlink. retrieveKeyFileCheap :: Key -> FilePath -> a Bool, -- removes a key's contents (succeeds if the contents are not present) removeKey :: Key -> a Bool, -- cgit v1.2.3 From 42c4cf332ce09d11b66d48ed3d39df7990882ecb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Apr 2015 10:52:49 -0400 Subject: add test for stable macs --- Test.hs | 1 + Types/Crypto.hs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'Types') diff --git a/Test.hs b/Test.hs index e8440dd1d..c84b36645 100644 --- a/Test.hs +++ b/Test.hs @@ -156,6 +156,7 @@ properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck" , testProperty "prop_read_show_TrustLevel" Types.TrustLevel.prop_read_show_TrustLevel , testProperty "prop_parse_show_TrustLog" Logs.Trust.prop_parse_show_TrustLog , testProperty "prop_hashes_stable" Utility.Hash.prop_hashes_stable + , testProperty "prop_mac_stable" Utility.Hash.prop_mac_stable , testProperty "prop_schedule_roundtrips" Utility.Scheduled.prop_schedule_roundtrips , testProperty "prop_past_sane" Utility.Scheduled.prop_past_sane , testProperty "prop_duration_roundtrips" Utility.HumanTime.prop_duration_roundtrips diff --git a/Types/Crypto.hs b/Types/Crypto.hs index 682629d6a..005be4531 100644 --- a/Types/Crypto.hs +++ b/Types/Crypto.hs @@ -18,6 +18,8 @@ module Types.Crypto ( ) where import qualified Data.ByteString.Lazy as L +import qualified Data.Text as T +import qualified Data.Text.Encoding as T import Data.Digest.Pure.SHA import Utility.Gpg (KeyIds(..)) @@ -71,3 +73,16 @@ calcMac mac = case mac of HmacSha512 -> showDigest $* hmacSha512 where ($*) g f x y = g $ f x y + +-- Check that all the MACs continue to produce the same. +prop_mac_stable :: Bool +prop_mac_stable = all (\(mac, result) -> calcMac mac key msg == result) + [ (HmacSha1, "46b4ec586117154dacd49d664e5d63fdc88efb51") + , (HmacSha224, "4c1f774863acb63b7f6e9daa9b5c543fa0d5eccf61e3ffc3698eacdd") + , (HmacSha256, "f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317") + , (HmacSha384, "3d10d391bee2364df2c55cf605759373e1b5a4ca9355d8f3fe42970471eca2e422a79271a0e857a69923839015877fc6") + , (HmacSha512, "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce") + ] + where + key = L.fromChunks [T.encodeUtf8 $ T.pack "foo"] + msg = L.fromChunks [T.encodeUtf8 $ T.pack "bar"] -- cgit v1.2.3 From 5610389a6880a82947582842db2d762a353b1f33 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Apr 2015 10:54:12 -0400 Subject: switch to using cryptohash for MAC --- Crypto.hs | 2 +- Types/Crypto.hs | 25 +++++++++++++------------ debian/control | 2 +- git-annex.cabal | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Types') diff --git a/Crypto.hs b/Crypto.hs index 4e3741715..66c27c527 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -34,7 +34,7 @@ module Crypto ( ) where import qualified Data.ByteString.Lazy as L -import Data.ByteString.Lazy.UTF8 (fromString) +import Data.ByteString.UTF8 (fromString) import Control.Applicative import qualified Data.Map as M import Control.Monad.IO.Class diff --git a/Types/Crypto.hs b/Types/Crypto.hs index 005be4531..ec61f1c4b 100644 --- a/Types/Crypto.hs +++ b/Types/Crypto.hs @@ -1,6 +1,6 @@ {- git-annex crypto types - - - Copyright 2011-2012 Joey Hess + - Copyright 2011-2015 Joey Hess - - Licensed under the GNU GPL version 3 or higher. -} @@ -17,10 +17,11 @@ module Types.Crypto ( calcMac, ) where -import qualified Data.ByteString.Lazy as L import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.Digest.Pure.SHA +import qualified Data.ByteString as B +import Crypto.Hash import Utility.Gpg (KeyIds(..)) @@ -62,17 +63,17 @@ readMac _ = Nothing calcMac :: Mac -- ^ MAC - -> L.ByteString -- ^ secret key - -> L.ByteString -- ^ message + -> B.ByteString -- ^ secret key + -> B.ByteString -- ^ message -> String -- ^ MAC'ed message, in hexadecimal calcMac mac = case mac of - HmacSha1 -> showDigest $* hmacSha1 - HmacSha224 -> showDigest $* hmacSha224 - HmacSha256 -> showDigest $* hmacSha256 - HmacSha384 -> showDigest $* hmacSha384 - HmacSha512 -> showDigest $* hmacSha512 + HmacSha1 -> use SHA1 + HmacSha224 -> use SHA224 + HmacSha256 -> use SHA256 + HmacSha384 -> use SHA384 + HmacSha512 -> use SHA512 where - ($*) g f x y = g $ f x y + use alg k m = show (hmacGetDigest (hmacAlg alg k m)) -- Check that all the MACs continue to produce the same. prop_mac_stable :: Bool @@ -84,5 +85,5 @@ prop_mac_stable = all (\(mac, result) -> calcMac mac key msg == result) , (HmacSha512, "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce") ] where - key = L.fromChunks [T.encodeUtf8 $ T.pack "foo"] - msg = L.fromChunks [T.encodeUtf8 $ T.pack "bar"] + key = T.encodeUtf8 $ T.pack "foo" + msg = T.encodeUtf8 $ T.pack "bar" diff --git a/debian/control b/debian/control index 6cb4a6327..11f42a8c1 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Build-Depends: libghc-hslogger-dev, libghc-pcre-light-dev, libghc-sha-dev, - libghc-cryptohash-dev, + libghc-cryptohash-dev (>= 0.11.0), libghc-dataenc-dev, libghc-utf8-string-dev, libghc-aws-dev (>= 0.9.2-2~), diff --git a/git-annex.cabal b/git-annex.cabal index b5ddb7d79..9b0407e1a 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -110,7 +110,7 @@ Executable git-annex IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, SafeSemaphore, uuid, random, dlist, unix-compat, async, stm (>= 2.3), data-default, case-insensitive, http-conduit, http-types, - cryptohash (>= 0.10.0), + cryptohash (>= 0.11.0), esqueleto, persistent-sqlite, persistent, persistent-template, monad-logger, resourcet CC-Options: -Wall -- cgit v1.2.3 From 85b079c4dfefac889d1a814e95390e29b575570d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Apr 2015 10:57:14 -0400 Subject: refactor --- Types/Crypto.hs | 41 +---------------------------------------- Utility/Hash.hs | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 42 deletions(-) (limited to 'Types') diff --git a/Types/Crypto.hs b/Types/Crypto.hs index ec61f1c4b..79970c288 100644 --- a/Types/Crypto.hs +++ b/Types/Crypto.hs @@ -17,12 +17,7 @@ module Types.Crypto ( calcMac, ) where -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import Data.Digest.Pure.SHA -import qualified Data.ByteString as B -import Crypto.Hash - +import Utility.Hash import Utility.Gpg (KeyIds(..)) -- XXX ideally, this would be a locked memory region @@ -34,13 +29,6 @@ data StorableCipher = EncryptedCipher String EncryptedCipherVariant KeyIds data EncryptedCipherVariant = Hybrid | PubKey deriving (Ord, Eq) -{- File names are (client-side) MAC'ed on special remotes. - - The chosen MAC algorithm needs to be same for all files stored on the - - remote. - -} -data Mac = HmacSha1 | HmacSha224 | HmacSha256 | HmacSha384 | HmacSha512 - deriving (Eq) - defaultMac :: Mac defaultMac = HmacSha1 @@ -60,30 +48,3 @@ readMac "HMACSHA256" = Just HmacSha256 readMac "HMACSHA384" = Just HmacSha384 readMac "HMACSHA512" = Just HmacSha512 readMac _ = Nothing - -calcMac - :: Mac -- ^ MAC - -> B.ByteString -- ^ secret key - -> B.ByteString -- ^ message - -> String -- ^ MAC'ed message, in hexadecimal -calcMac mac = case mac of - HmacSha1 -> use SHA1 - HmacSha224 -> use SHA224 - HmacSha256 -> use SHA256 - HmacSha384 -> use SHA384 - HmacSha512 -> use SHA512 - where - use alg k m = show (hmacGetDigest (hmacAlg alg k m)) - --- Check that all the MACs continue to produce the same. -prop_mac_stable :: Bool -prop_mac_stable = all (\(mac, result) -> calcMac mac key msg == result) - [ (HmacSha1, "46b4ec586117154dacd49d664e5d63fdc88efb51") - , (HmacSha224, "4c1f774863acb63b7f6e9daa9b5c543fa0d5eccf61e3ffc3698eacdd") - , (HmacSha256, "f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317") - , (HmacSha384, "3d10d391bee2364df2c55cf605759373e1b5a4ca9355d8f3fe42970471eca2e422a79271a0e857a69923839015877fc6") - , (HmacSha512, "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce") - ] - where - key = T.encodeUtf8 $ T.pack "foo" - msg = T.encodeUtf8 $ T.pack "bar" diff --git a/Utility/Hash.hs b/Utility/Hash.hs index 9881815bd..f960a134f 100644 --- a/Utility/Hash.hs +++ b/Utility/Hash.hs @@ -9,13 +9,16 @@ module Utility.Hash ( skein256, skein512, md5, - prop_hashes_stable + prop_hashes_stable, + Mac(..), + calcMac, + prop_mac_stable, ) where import qualified Data.ByteString.Lazy as L import qualified Data.Text as T import qualified Data.Text.Encoding as T - +import qualified Data.ByteString as S import Crypto.Hash sha1 :: L.ByteString -> Digest SHA1 @@ -60,3 +63,37 @@ prop_hashes_stable = all (\(hasher, result) -> hasher foo == result) ] where foo = L.fromChunks [T.encodeUtf8 $ T.pack "foo"] + +{- File names are (client-side) MAC'ed on special remotes. + - The chosen MAC algorithm needs to be same for all files stored on the + - remote. + -} +data Mac = HmacSha1 | HmacSha224 | HmacSha256 | HmacSha384 | HmacSha512 + deriving (Eq) + +calcMac + :: Mac -- ^ MAC + -> S.ByteString -- ^ secret key + -> S.ByteString -- ^ message + -> String -- ^ MAC'ed message, in hexadecimal +calcMac mac = case mac of + HmacSha1 -> use SHA1 + HmacSha224 -> use SHA224 + HmacSha256 -> use SHA256 + HmacSha384 -> use SHA384 + HmacSha512 -> use SHA512 + where + use alg k m = show (hmacGetDigest (hmacAlg alg k m)) + +-- Check that all the MACs continue to produce the same. +prop_mac_stable :: Bool +prop_mac_stable = all (\(mac, result) -> calcMac mac key msg == result) + [ (HmacSha1, "46b4ec586117154dacd49d664e5d63fdc88efb51") + , (HmacSha224, "4c1f774863acb63b7f6e9daa9b5c543fa0d5eccf61e3ffc3698eacdd") + , (HmacSha256, "f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317") + , (HmacSha384, "3d10d391bee2364df2c55cf605759373e1b5a4ca9355d8f3fe42970471eca2e422a79271a0e857a69923839015877fc6") + , (HmacSha512, "114682914c5d017dfe59fdc804118b56a3a652a0b8870759cf9e792ed7426b08197076bf7d01640b1b0684df79e4b67e37485669e8ce98dbab60445f0db94fce") + ] + where + key = T.encodeUtf8 $ T.pack "foo" + msg = T.encodeUtf8 $ T.pack "bar" -- cgit v1.2.3 From 5201613fc97b855bf60979ac7e2550ad08fa3798 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 10 May 2015 16:19:56 -0400 Subject: rejigger imports for clean build with ghc 7.10's AMP changes The explict import Prelude after import Control.Applicative is a trick to avoid a warning. --- Crypto.hs | 1 - Database/Fsck.hs | 8 +------- Logs/Difference.hs | 1 - Logs/Difference/Pure.hs | 1 - Test.hs | 1 - Types/DesktopNotify.hs | 1 + Types/Difference.hs | 3 ++- Utility/Directory.hs | 1 + Utility/Env.hs | 1 + Utility/FreeDesktop.hs | 1 + Utility/Gpg.hs | 10 ++++------ Utility/HumanTime.hs | 3 ++- Utility/LinuxMkLibs.hs | 15 ++++++++------- Utility/Misc.hs | 9 +++++---- Utility/Mounts.hsc | 1 + Utility/Network.hs | 1 + Utility/Path.hs | 1 + Utility/Process.hs | 1 + Utility/QuickCheck.hs | 1 + Utility/SRV.hs | 3 ++- Utility/SafeCommand.hs | 3 ++- Utility/Scheduled.hs | 3 ++- Utility/UserInfo.hs | 5 +++-- 23 files changed, 40 insertions(+), 35 deletions(-) (limited to 'Types') diff --git a/Crypto.hs b/Crypto.hs index 66c27c527..1b69c98a4 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -35,7 +35,6 @@ module Crypto ( import qualified Data.ByteString.Lazy as L import Data.ByteString.UTF8 (fromString) -import Control.Applicative import qualified Data.Map as M import Control.Monad.IO.Class diff --git a/Database/Fsck.hs b/Database/Fsck.hs index 8de0a8f3d..50c08cf61 100644 --- a/Database/Fsck.hs +++ b/Database/Fsck.hs @@ -25,6 +25,7 @@ import qualified Database.Handle as H import Locations import Utility.PosixFiles import Utility.Exception +import Common import Annex import Types.Key import Types.UUID @@ -33,13 +34,6 @@ import Annex.LockFile import Database.Persist.TH import Database.Esqueleto hiding (Key) -import Control.Monad -import Control.Monad.IfElse -import Control.Monad.IO.Class (liftIO) -import System.Directory -import System.FilePath -import Data.Maybe -import Control.Applicative data FsckHandle = FsckHandle H.DbHandle UUID diff --git a/Logs/Difference.hs b/Logs/Difference.hs index fcebffee9..8d37a09c4 100644 --- a/Logs/Difference.hs +++ b/Logs/Difference.hs @@ -12,7 +12,6 @@ module Logs.Difference ( module Logs.Difference.Pure ) where -import Data.Monoid import Data.Time.Clock.POSIX import qualified Data.Map as M diff --git a/Logs/Difference/Pure.hs b/Logs/Difference/Pure.hs index 25f3844d6..0e68ffd3c 100644 --- a/Logs/Difference/Pure.hs +++ b/Logs/Difference/Pure.hs @@ -10,7 +10,6 @@ module Logs.Difference.Pure ( parseDifferencesLog, ) where -import Data.Monoid import qualified Data.Map as M import Common.Annex diff --git a/Test.hs b/Test.hs index c84b36645..e6a678f55 100644 --- a/Test.hs +++ b/Test.hs @@ -14,7 +14,6 @@ import Test.Tasty.Runners import Test.Tasty.HUnit import Test.Tasty.QuickCheck import Test.Tasty.Ingredients.Rerun -import Data.Monoid import Options.Applicative hiding (command) import qualified Data.Map as M diff --git a/Types/DesktopNotify.hs b/Types/DesktopNotify.hs index 9ea51401f..e6df05ab1 100644 --- a/Types/DesktopNotify.hs +++ b/Types/DesktopNotify.hs @@ -8,6 +8,7 @@ module Types.DesktopNotify where import Data.Monoid +import Prelude data DesktopNotify = DesktopNotify { notifyStart :: Bool diff --git a/Types/Difference.hs b/Types/Difference.hs index 064703bf7..1bab3fe36 100644 --- a/Types/Difference.hs +++ b/Types/Difference.hs @@ -20,9 +20,10 @@ import Utility.PartialPrelude import qualified Git import qualified Git.Config +import qualified Data.Set as S import Data.Maybe import Data.Monoid -import qualified Data.Set as S +import Prelude -- Describes differences from the v5 repository format. -- diff --git a/Utility/Directory.hs b/Utility/Directory.hs index 2e037fdda..0c95d9675 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -18,6 +18,7 @@ import Control.Applicative import Control.Concurrent import System.IO.Unsafe (unsafeInterleaveIO) import Data.Maybe +import Prelude #ifdef mingw32_HOST_OS import qualified System.Win32 as Win32 diff --git a/Utility/Env.hs b/Utility/Env.hs index fdf06d807..0697dbc8d 100644 --- a/Utility/Env.hs +++ b/Utility/Env.hs @@ -13,6 +13,7 @@ module Utility.Env where import Utility.Exception import Control.Applicative import Data.Maybe +import Prelude import qualified System.Environment as E import qualified System.SetEnv #else diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs index ee1c2f302..4e35680b0 100644 --- a/Utility/FreeDesktop.hs +++ b/Utility/FreeDesktop.hs @@ -39,6 +39,7 @@ import Data.List import Data.String.Utils import Data.Maybe import Control.Applicative +import Prelude type DesktopEntry = [(Key, Value)] diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs index 6323d3a00..a1b782d97 100644 --- a/Utility/Gpg.hs +++ b/Utility/Gpg.hs @@ -9,14 +9,8 @@ module Utility.Gpg where -import Control.Applicative -import Control.Concurrent -import Control.Monad.IO.Class -import qualified Data.Map as M - import Common import qualified Build.SysConfig as SysConfig - #ifndef mingw32_HOST_OS import System.Posix.Types import qualified System.Posix.IO @@ -27,6 +21,10 @@ import Utility.Tmp #endif import Utility.Format (decode_c) +import Control.Concurrent +import Control.Monad.IO.Class +import qualified Data.Map as M + type KeyId = String newtype KeyIds = KeyIds { keyIds :: [KeyId] } diff --git a/Utility/HumanTime.hs b/Utility/HumanTime.hs index 85a9e15b6..e8fdb7c6e 100644 --- a/Utility/HumanTime.hs +++ b/Utility/HumanTime.hs @@ -20,11 +20,12 @@ import Utility.PartialPrelude import Utility.Applicative import Utility.QuickCheck +import qualified Data.Map as M import Data.Time.Clock import Data.Time.Clock.POSIX (POSIXTime) import Data.Char import Control.Applicative -import qualified Data.Map as M +import Prelude newtype Duration = Duration { durationSeconds :: Integer } deriving (Eq, Ord, Read, Show) diff --git a/Utility/LinuxMkLibs.hs b/Utility/LinuxMkLibs.hs index db64d1236..fdeb77959 100644 --- a/Utility/LinuxMkLibs.hs +++ b/Utility/LinuxMkLibs.hs @@ -7,7 +7,12 @@ module Utility.LinuxMkLibs where -import Control.Applicative +import Utility.PartialPrelude +import Utility.Directory +import Utility.Process +import Utility.Monad +import Utility.Path + import Data.Maybe import System.Directory import System.FilePath @@ -15,12 +20,8 @@ import Data.List.Utils import System.Posix.Files import Data.Char import Control.Monad.IfElse - -import Utility.PartialPrelude -import Utility.Directory -import Utility.Process -import Utility.Monad -import Utility.Path +import Control.Applicative +import Prelude {- Installs a library. If the library is a symlink to another file, - install the file it links to, and update the symlink to be relative. -} diff --git a/Utility/Misc.hs b/Utility/Misc.hs index e4eccac43..1fa08ddd1 100644 --- a/Utility/Misc.hs +++ b/Utility/Misc.hs @@ -9,20 +9,21 @@ module Utility.Misc where +import Utility.FileSystemEncoding +import Utility.Monad + import System.IO import Control.Monad import Foreign import Data.Char import Data.List -import Control.Applicative import System.Exit #ifndef mingw32_HOST_OS import System.Posix.Process (getAnyProcessStatus) import Utility.Exception #endif - -import Utility.FileSystemEncoding -import Utility.Monad +import Control.Applicative +import Prelude {- A version of hgetContents that is not lazy. Ensures file is - all read before it gets closed. -} diff --git a/Utility/Mounts.hsc b/Utility/Mounts.hsc index 1fb2362df..ad4adf334 100644 --- a/Utility/Mounts.hsc +++ b/Utility/Mounts.hsc @@ -26,6 +26,7 @@ import Utility.Exception import Data.Maybe import Control.Applicative #endif +import Prelude {- This is a stripped down mntent, containing only - fields available everywhere. -} diff --git a/Utility/Network.hs b/Utility/Network.hs index 7f228e155..dc044a932 100644 --- a/Utility/Network.hs +++ b/Utility/Network.hs @@ -11,6 +11,7 @@ import Utility.Process import Utility.Exception import Control.Applicative +import Prelude {- Haskell lacks uname(2) bindings, except in the - Bindings.Uname addon. Rather than depend on that, diff --git a/Utility/Path.hs b/Utility/Path.hs index 9f0737fe8..d8fab10cc 100644 --- a/Utility/Path.hs +++ b/Utility/Path.hs @@ -16,6 +16,7 @@ import Data.List import Data.Maybe import Data.Char import Control.Applicative +import Prelude #ifdef mingw32_HOST_OS import qualified System.FilePath.Posix as Posix diff --git a/Utility/Process.hs b/Utility/Process.hs index cbbe8a811..86a25ab91 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -54,6 +54,7 @@ import qualified System.Posix.IO import Control.Applicative #endif import Data.Maybe +import Prelude import Utility.Misc import Utility.Exception diff --git a/Utility/QuickCheck.hs b/Utility/QuickCheck.hs index 54200d3f7..cd408ddc9 100644 --- a/Utility/QuickCheck.hs +++ b/Utility/QuickCheck.hs @@ -19,6 +19,7 @@ import System.Posix.Types import qualified Data.Map as M import qualified Data.Set as S import Control.Applicative +import Prelude instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (M.Map k v) where arbitrary = M.fromList <$> arbitrary diff --git a/Utility/SRV.hs b/Utility/SRV.hs index 203585a7e..b6d57dea5 100644 --- a/Utility/SRV.hs +++ b/Utility/SRV.hs @@ -25,8 +25,9 @@ import Utility.PartialPrelude import Network import Data.Function import Data.List -import Control.Applicative import Data.Maybe +import Control.Applicative +import Prelude #ifdef WITH_ADNS import ADNS.Resolver diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs index 9eaa53084..efa14b48e 100644 --- a/Utility/SafeCommand.hs +++ b/Utility/SafeCommand.hs @@ -10,9 +10,10 @@ module Utility.SafeCommand where import System.Exit import Utility.Process import Data.String.Utils -import Control.Applicative import System.FilePath import Data.Char +import Control.Applicative +import Prelude {- A type for parameters passed to a shell command. A command can - be passed either some Params (multiple parameters can be included, diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs index e077a1fea..b3813323d 100644 --- a/Utility/Scheduled.hs +++ b/Utility/Scheduled.hs @@ -32,7 +32,6 @@ import Utility.QuickCheck import Utility.PartialPrelude import Utility.Misc -import Control.Applicative import Data.List import Data.Time.Clock import Data.Time.LocalTime @@ -41,6 +40,8 @@ import Data.Time.Calendar.WeekDate import Data.Time.Calendar.OrdinalDate import Data.Tuple.Utils import Data.Char +import Control.Applicative +import Prelude {- Some sort of scheduled event. -} data Schedule = Schedule Recurrance ScheduledTime diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index 5bf8d5c09..dbb09e70d 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -13,12 +13,13 @@ module Utility.UserInfo ( myUserGecos, ) where +import Utility.Env + import System.PosixCompat #ifndef mingw32_HOST_OS import Control.Applicative #endif - -import Utility.Env +import Prelude {- Current user's home directory. - -- cgit v1.2.3