aboutsummaryrefslogtreecommitdiff
path: root/Utility/UserInfo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-11-14 14:14:10 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-11-14 14:14:10 -0400
commitbb5178557d8563608be7e9e04a4916fd2048d176 (patch)
tree0013232fca756f278dd44fefc45a18a1a9d35289 /Utility/UserInfo.hs
parentb9d5a5fd5e9631840857878935c3727217f12b9a (diff)
clean up build warnings on Windows
Diffstat (limited to 'Utility/UserInfo.hs')
-rw-r--r--Utility/UserInfo.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs
index dd66c331e..d504fa5c3 100644
--- a/Utility/UserInfo.hs
+++ b/Utility/UserInfo.hs
@@ -15,11 +15,13 @@ module Utility.UserInfo (
) where
import Utility.Env
-import Utility.Data
import Utility.Exception
+#ifndef mingw32_HOST_OS
+import Utility.Data
+import Control.Applicative
+#endif
import System.PosixCompat
-import Control.Applicative
import Prelude
{- Current user's home directory.
@@ -58,6 +60,7 @@ myVal envvars extract = go envvars
#ifndef mingw32_HOST_OS
go [] = Right . extract <$> (getUserEntryForID =<< getEffectiveUserID)
#else
- go [] = return $ Left ("environment not set: " ++ show envvars)
+ go [] = return $ either Left (Right . extract) $
+ Left ("environment not set: " ++ show envvars)
#endif
go (v:vs) = maybe (go vs) (return . Right) =<< getEnv v