aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/Windows/Registry.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-20 15:54:43 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-20 15:54:43 +0300
commit87ae152b71317b99bcbeeab80145ae1f3cf22d83 (patch)
tree0ba746abfb44730f07cf7681f90e6340cfaa0a9b /src/Windows/Registry.hs
parentlist_path: no weird symbols in output (diff)
downloadwindows-env-87ae152b71317b99bcbeeab80145ae1f3cf22d83.tar.gz
windows-env-87ae152b71317b99bcbeeab80145ae1f3cf22d83.zip
fix HLint warnings
Diffstat (limited to 'src/Windows/Registry.hs')
-rw-r--r--src/Windows/Registry.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Windows/Registry.hs b/src/Windows/Registry.hs
index a8504d6..6661177 100644
--- a/src/Windows/Registry.hs
+++ b/src/Windows/Registry.hs
@@ -25,6 +25,7 @@ module Windows.Registry
, setString
) where
+import Control.Monad (unless)
import Data.List (intercalate)
import Data.List.Split (splitOn)
import Foreign.ForeignPtr (withForeignPtr)
@@ -76,7 +77,7 @@ raiseDoesNotExistError functionName =
ioError $ mkIOError doesNotExistErrorType functionName Nothing Nothing
raiseUnknownError :: String -> WinAPI.ErrCode -> IO a
-raiseUnknownError functionName exitCode = WinAPI.failWith functionName exitCode
+raiseUnknownError = WinAPI.failWith
exitCodeSuccess :: WinAPI.ErrCode
exitCodeSuccess = 0
@@ -94,9 +95,8 @@ delValue keyHandle valueName =
withForeignPtr keyHandle $ \keyPtr ->
WinAPI.withTString valueName $ \valueNamePtr -> do
ret <- WinAPI.c_RegDeleteValue keyPtr valueNamePtr
- if ret == exitCodeSuccess
- then return ()
- else raiseError "RegDeleteValue" ret
+ unless (ret == exitCodeSuccess) $
+ raiseError "RegDeleteValue" ret
type ValueType = WinAPI.RegValueType