make die take Text argument, fixes #51

This commit is contained in:
Stephen Diehl
2017-05-03 10:29:55 +01:00
parent 307ecd7d6a
commit 269c81b1d2
3 changed files with 24 additions and 3 deletions
+8
View File
@@ -28,3 +28,11 @@ stack build --resolver lts-8.2
stack build --resolver lts-8.3
stack build --resolver lts-8.4
stack build --resolver lts-8.5
stack build --resolver lts-8.6
stack build --resolver lts-8.7
stack build --resolver lts-8.8
stack build --resolver lts-8.9
stack build --resolver lts-8.10
stack build --resolver lts-8.11
stack build --resolver lts-8.12
stack build --resolver lts-8.13
+10 -3
View File
@@ -28,6 +28,7 @@ module Protolude (
#if !MIN_VERSION_base(4,8,0)
(&),
#endif
die,
) where
-- Protolude module exports.
@@ -430,14 +431,12 @@ import Data.Text.Encoding.Error as X (
-- IO
import System.Environment as X (getArgs)
import qualified System.Exit
import System.Exit as X (
ExitCode(..)
, exitWith
, exitFailure
, exitSuccess
#if MIN_VERSION_base(4,8,0)
, die
#endif
)
import System.IO as X (
Handle
@@ -594,3 +593,11 @@ show x = toS (PBase.show x)
{-# SPECIALIZE show :: Show a => a -> ByteString #-}
{-# SPECIALIZE show :: Show a => a -> LByteString #-}
{-# SPECIALIZE show :: Show a => a -> String #-}
#if MIN_VERSION_base(4,8,0)
die :: Text -> IO ()
die err = System.Exit.die (toS err)
#else
die :: Text -> IO ()
die err = hPutStrLn stderr err >> exitFailure
#endif
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
set +e
echo -e "\e[92mLTS 7.8"
STACK_YAML=stack-7.8.yaml stack build --no-terminal
echo -e "\e[92mLTS 7.10"
STACK_YAML=stack-7.10.yaml stack build --no-terminal
echo -e "\e[92mLTS 8.0"
STACK_YAML=stack-8.0.yaml stack build --no-terminal