{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Trustworthy #-}
module Distribution.Compat.Prelude
(
module BasePrelude
, Semigroup (..)
, gmappend
, gmempty
, Typeable
, TypeRep
, typeRep
, Data
, Generic
, NFData (..)
, Binary (..)
, Structured
, Alternative (..)
, MonadPlus (..)
, IsString (..)
, Map
, Set
, NonEmptySet
, Identity (..)
, Proxy (..)
, Const (..)
, Void
, partitionEithers
, catMaybes
, mapMaybe
, fromMaybe
, maybeToList
, listToMaybe
, isNothing
, isJust
, unfoldr
, isPrefixOf
, isSuffixOf
, intercalate
, intersperse
, sort
, sortBy
, nub
, nubBy
, partition
, dropWhileEnd
, NonEmpty ((:|))
, nonEmpty
, foldl1
, foldr1
, head
, tail
, last
, init
, Foldable
, foldMap
, foldr
, null
, length
, find
, foldl'
, traverse_
, for_
, any
, all
, toList
, Traversable
, traverse
, sequenceA
, for
, on
, comparing
, first
, liftM
, liftM2
, unless
, when
, ap
, void
, foldM
, filterM
, join
, guard
, catch
, throwIO
, evaluate
, Exception (..)
, IOException
, SomeException (..)
, tryIO
, catchIO
, catchExit
, deepseq
, force
, isSpace
, isDigit
, isUpper
, isAlpha
, isAlphaNum
, chr
, ord
, toLower
, toUpper
, absurd
, vacuous
, Word
, Word8
, Word16
, Word32
, Word64
, Int8
, Int16
, Int32
, Int64
, (<<>>)
, (Disp.<+>)
, ExitCode (..)
, exitWith
, exitSuccess
, exitFailure
, readMaybe
, trace
, traceShow
, traceShowId
, traceM
, traceShowM
) where
import Prelude as BasePrelude hiding
( mapM, mapM_, sequence, any, all, head, tail, last, init
, read
, foldr1, foldl1
, Word
, Traversable, traverse, sequenceA
, Foldable(..)
)
import Data.Foldable as BasePrelude (elem, foldl, maximum, minimum, product, sum)
import Data.Foldable
( Foldable (foldMap, foldr, toList)
, all
, any
, find
, foldl'
, for_
, length
, null
, traverse_
)
import Data.Traversable (Traversable (sequenceA, traverse), for)
import qualified Data.Foldable
import Control.Applicative (Alternative (..), Const (..))
import Control.Arrow (first)
import Control.DeepSeq (NFData (..), deepseq, force)
import Control.Exception (Exception (..), IOException, SomeException (..), catch, evaluate, throwIO)
import Control.Monad (MonadPlus (..), ap, filterM, foldM, guard, join, liftM, liftM2, unless, void, when)
import Data.Char (chr, isAlpha, isAlphaNum, isDigit, isSpace, isUpper, ord, toLower, toUpper)
import Data.Data (Data)
import Data.Either (partitionEithers)
import Data.Function (on)
import Data.Functor.Identity (Identity (..))
import Data.Int (Int16, Int32, Int64, Int8)
import Data.List (dropWhileEnd, intercalate, intersperse, isPrefixOf, isSuffixOf, nub, nubBy, partition, sort, sortBy, unfoldr)
import Data.List.NonEmpty (NonEmpty ((:|)), head, init, last, nonEmpty, tail)
import Data.Map (Map)
import Data.Maybe (catMaybes, fromMaybe, isJust, isNothing, listToMaybe, mapMaybe, maybeToList)
import Data.Ord (comparing)
import Data.Proxy (Proxy (..))
import Data.Set (Set)
import Data.String (IsString (..))
import Data.Typeable (TypeRep, Typeable, typeRep)
import Data.Void (Void, absurd, vacuous)
import Data.Word (Word, Word16, Word32, Word64, Word8)
import Distribution.Compat.Binary (Binary (..))
import Distribution.Compat.Semigroup (gmappend, gmempty)
import GHC.Generics (Generic)
import System.Exit (ExitCode (..), exitFailure, exitSuccess, exitWith)
import Text.Read (readMaybe)
import qualified Text.PrettyPrint as Disp
import Distribution.Compat.Exception
import Distribution.Compat.NonEmptySet (NonEmptySet)
import Distribution.Utils.Structured (Structured)
import qualified Debug.Trace
(<<>>) :: Disp.Doc -> Disp.Doc -> Disp.Doc
<<>> :: Doc -> Doc -> Doc
(<<>>) = Doc -> Doc -> Doc
(Disp.<>)
{-# INLINE foldr1 #-}
foldr1 :: (a -> a -> a) -> NonEmpty a -> a
foldr1 :: forall a. (a -> a -> a) -> NonEmpty a -> a
foldr1 = (a -> a -> a) -> NonEmpty a -> a
forall a. (a -> a -> a) -> NonEmpty a -> a
forall (t :: * -> *) a. Foldable t => (a -> a -> a) -> t a -> a
Data.Foldable.foldr1
{-# INLINE foldl1 #-}
foldl1 :: (a -> a -> a) -> NonEmpty a -> a
foldl1 :: forall a. (a -> a -> a) -> NonEmpty a -> a
foldl1 = (a -> a -> a) -> NonEmpty a -> a
forall a. (a -> a -> a) -> NonEmpty a -> a
forall (t :: * -> *) a. Foldable t => (a -> a -> a) -> t a -> a
Data.Foldable.foldl1
trace :: String -> a -> a
trace :: forall a. String -> a -> a
trace = String -> a -> a
forall a. String -> a -> a
Debug.Trace.trace
{-# DEPRECATED trace "Don't leave me in the code" #-}
traceShowId :: Show a => a -> a
traceShowId :: forall a. Show a => a -> a
traceShowId a
x = a -> a -> a
forall a b. Show a => a -> b -> b
Debug.Trace.traceShow a
x a
x
{-# DEPRECATED traceShowId "Don't leave me in the code" #-}
traceShow :: Show a => a -> b -> b
traceShow :: forall a b. Show a => a -> b -> b
traceShow = a -> b -> b
forall a b. Show a => a -> b -> b
Debug.Trace.traceShow
{-# DEPRECATED traceShow "Don't leave me in the code" #-}
traceM :: Applicative f => String -> f ()
traceM :: forall (f :: * -> *). Applicative f => String -> f ()
traceM = String -> f ()
forall (f :: * -> *). Applicative f => String -> f ()
Debug.Trace.traceM
{-# DEPRECATED traceM "Don't leave me in the code" #-}
traceShowM :: (Show a, Applicative f) => a -> f ()
traceShowM :: forall a (f :: * -> *). (Show a, Applicative f) => a -> f ()
traceShowM = a -> f ()
forall a (f :: * -> *). (Show a, Applicative f) => a -> f ()
Debug.Trace.traceShowM
{-# DEPRECATED traceShowM "Don't leave me in the code" #-}