Squashed commit of the following:

commit a6f62265f345c8b7a7226515171752586b0d66e5
Author: Stephen Diehl <stephen.m.diehl@gmail.com>
Date:   Wed Apr 13 13:41:05 2016 -0400

    bump version

commit 1a809623cd1484ce215612e6b3ecef15015bc602
Author: Stephen Diehl <stephen.m.diehl@gmail.com>
Date:   Wed Apr 13 13:26:11 2016 -0400

    masking for ghc 8.0 specific type

commit 54bafb0bb80c8450863eac53a1f3a20a21c8b0c9
Author: Stephen Diehl <stephen.m.diehl@gmail.com>
Date:   Wed Apr 13 12:55:08 2016 -0400

    bump ghc-prim for GHC 8.0 compat

commit 8808d5f37369107b3e5961255089a8a9e02bf3d5
Author: Stephen Diehl <stephen.m.diehl@gmail.com>
Date:   Wed Apr 13 12:53:39 2016 -0400

    expose base State transformers

commit 05c32a4542aa66f715aea3855e140f74e97d4852
Author: Stephen Diehl <stephen.m.diehl@gmail.com>
Date:   Wed Apr 13 12:46:00 2016 -0400

    adds compiler-independent base module
This commit is contained in:
Stephen Diehl
2016-04-13 13:51:47 -04:00
parent 99427e741c
commit 5388b8cd4b
7 changed files with 136 additions and 80 deletions
+27 -40
View File
@@ -1,13 +1,13 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Protolude (
module X,
module Base,
identity,
bool,
(&),
($!),
uncons,
applyN,
print,
@@ -16,16 +16,23 @@ module Protolude (
LByteString,
) where
import qualified Prelude as P
{-import qualified Prelude as P-}
import qualified List as X
import qualified Show as X
import qualified Bool as X
import qualified Debug as X
import qualified Monad as X
import qualified Functor as X
import qualified Either as X
import qualified Applicative as X
import List as X
import Show as X
import Bool as X
import Debug as X
import Monad as X
import Functor as X
import Either as X
import Applicative as X
import Base as Base hiding (
putStr
, putStrLn
, print
)
import qualified Base as PBase
-- Maybe'ized version of partial functions
import Safe as X (
@@ -88,7 +95,6 @@ import Control.DeepSeq as X (
-- Data structures
import Data.Tuple as X
import Data.Semiring as X
import Data.List as X (
splitAt
, break
@@ -99,6 +105,8 @@ import Data.List as X (
, reverse
, replicate
, take
, zipWith
, zip
)
import Data.Map as X (Map)
import Data.Set as X (Set)
@@ -117,6 +125,10 @@ import Control.Monad.State as X (
, modify
, withState
, runState
, execState
, evalState
, runStateT
, execStateT
, evalStateT
@@ -168,24 +180,6 @@ import Data.Function as X (
, on
)
-- Base GHC types
import GHC.IO as X (IO)
import GHC.Num as X
import GHC.Enum as X
import GHC.Real as X
import GHC.Float as X
import GHC.Show as X
import GHC.Exts as X (
Constraint
, Ptr
, FunPtr
, the
)
import GHC.Base as X (
(++)
, seq
, asTypeOf
)
-- Genericss
import GHC.Generics (
@@ -225,6 +219,7 @@ import Data.String.Conv as X (
, toS
, toSL
, Leniency(..)
, StringConv
)
-- Printf
@@ -270,14 +265,6 @@ infixl 1 &
(&) :: a -> (a -> b) -> b
x & f = f x
infixr 0 $!
($!) :: (a -> b) -> a -> b
($!) = (P.$!)
bool :: a -> a -> Bool -> a
bool f t b = if b then t else f
identity :: a -> a
identity x = x
@@ -288,5 +275,5 @@ uncons (x:xs) = Just (x, xs)
applyN :: Int -> (a -> a) -> a -> a
applyN n f = X.foldr (.) identity (X.replicate n f)
print :: (X.MonadIO m, P.Show a) => a -> m ()
print = liftIO . P.print
print :: (X.MonadIO m, PBase.Show a) => a -> m ()
print = liftIO . PBase.print