From ba76d7689e82a7ed2ea1e88c520cdc3d99b18773 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Mar 2016 17:32:27 -0400 Subject: minor style improvements --- src/Propellor/Property/ZFS/Process.hs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/Propellor/Property/ZFS') diff --git a/src/Propellor/Property/ZFS/Process.hs b/src/Propellor/Property/ZFS/Process.hs index 61d4473c..372bac6d 100644 --- a/src/Propellor/Property/ZFS/Process.hs +++ b/src/Propellor/Property/ZFS/Process.hs @@ -11,15 +11,12 @@ import Data.List -- | Gets the properties of a ZFS volume. zfsGetProperties :: ZFS -> IO ZFSProperties zfsGetProperties z = - let - plist = fromPropertyList . map (\(_:k:v:_) -> (k, v)) . (map (split "\t")) - in - do - plist <$> runZfs "get" [Just "-H", Just "-p", Just "all"] z + let plist = fromPropertyList . map (\(_:k:v:_) -> (k, v)) . (map (split "\t")) + in plist <$> runZfs "get" [Just "-H", Just "-p", Just "all"] z zfsExists :: ZFS -> IO Bool -zfsExists z = - any id . map (isInfixOf (zfsName z)) <$> runZfs "list" [Just "-H"] z +zfsExists z = any id . map (isInfixOf (zfsName z)) + <$> runZfs "list" [Just "-H"] z -- | Runs the zfs command with the arguments. -- @@ -28,11 +25,7 @@ zfsExists z = -- -- Replaces Nothing in the argument list with the ZFS pool/dataset. runZfs :: String -> [Maybe String] -> ZFS -> IO [String] -runZfs cmd args z = - let - (p, a) = zfsCommand cmd args z - in - lines <$> readProcess p a +runZfs cmd args z = lines <$> uncurry readProcess (zfsCommand cmd args z) -- | Return the ZFS command line suitable for readProcess or cmdProperty. zfsCommand :: String -> [Maybe String] -> ZFS -> (String, [String]) -- cgit v1.2.3