Skip to content
Permalink
Browse files

Remove dependency on bitraverse

  • Loading branch information...
psibi committed Jul 28, 2018
1 parent dad5745 commit b94db07a8e79ee11e1b05c3cd697d85786a3af8a
Showing with 3 additions and 6 deletions.
  1. +3 −4 XMonad/Util/Brightness.hs
  2. +0 −2 stack.yaml
@@ -70,11 +70,9 @@ module XMonad.Util.Brightness
import XMonad
#if (MIN_VERSION_base(4,10,0))
import Data.Traversable (traverse)
#else
import Prelude (traverse)
#endif
import Prelude
import System.IO (hPutStrLn, stderr)
import Data.Bitraversable (bitraverse)
import Control.Monad (join)
import Data.Bifunctor (first)
import Control.Exception (try)
@@ -126,7 +124,8 @@ readInt str = case (reads (unpack str)) of
_ -> Left "Could not parse string to int"

printError :: Either String e -> IO (Either () e)
printError = bitraverse (hPutStrLn stderr) (pure . id)
printError es = either (\str -> hPutStrLn stderr str *> (return . Left $ ())) (\_ -> return . Left $ ()) es


getFromFile :: FilePath -> (BS.ByteString -> Either String a) -> IO (Either String a)
getFromFile filename fcast = fmap (fcast =<<) (try' $ BS.readFile filename)
@@ -1,5 +1,3 @@


resolver: lts-11.16

extra-deps:

0 comments on commit b94db07

Please sign in to comment.
You can’t perform that action at this time.