base-compat 0.12.3 → 0.13.0
raw patch · 18 files changed
+475/−84 lines, 18 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Function.Compat: applyWhen :: Bool -> (a -> a) -> a -> a
+ Data.List.NonEmpty.Compat: inits1 :: NonEmpty a -> NonEmpty (NonEmpty a)
+ Data.List.NonEmpty.Compat: tails1 :: NonEmpty a -> NonEmpty (NonEmpty a)
+ Data.Traversable.Compat: forAccumM :: (Monad m, Traversable t) => s -> t a -> (s -> a -> m (s, b)) -> m (s, t b)
+ Data.Traversable.Compat: instance GHC.Base.Monad m => GHC.Base.Applicative (Data.Traversable.Compat.StateT s m)
+ Data.Traversable.Compat: instance GHC.Base.Monad m => GHC.Base.Functor (Data.Traversable.Compat.StateT s m)
+ Data.Traversable.Compat: instance GHC.Base.Monad m => GHC.Base.Monad (Data.Traversable.Compat.StateT s m)
+ Data.Traversable.Compat: mapAccumM :: forall m t s a b. (Monad m, Traversable t) => (s -> a -> m (s, b)) -> s -> t a -> m (s, t b)
+ Data.Typeable.Compat: heqT :: forall a b. (Typeable a, Typeable b) => Maybe (a :~~: b)
+ Debug.Trace.Compat: traceEventWith :: (a -> String) -> a -> a
+ Debug.Trace.Compat: traceShowWith :: Show b => (a -> b) -> a -> a
+ Debug.Trace.Compat: traceWith :: (a -> String) -> a -> a
+ Numeric.Natural.Compat: minusNaturalMaybe :: Natural -> Natural -> Maybe Natural
+ Prelude.Compat: (!!) :: [a] -> Int -> a
+ Prelude.Compat: ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
+ Prelude.Compat: ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
+ Prelude.Compat: (&&) :: Bool -> Bool -> Bool
+ Prelude.Compat: (*) :: Num a => a -> a -> a
+ Prelude.Compat: (**) :: Floating a => a -> a -> a
+ Prelude.Compat: (*>) :: Applicative f => f a -> f b -> f b
+ Prelude.Compat: (+) :: Num a => a -> a -> a
+ Prelude.Compat: (++) :: [a] -> [a] -> [a]
+ Prelude.Compat: (-) :: Num a => a -> a -> a
+ Prelude.Compat: (.) :: (b -> c) -> (a -> b) -> a -> c
+ Prelude.Compat: (/) :: Fractional a => a -> a -> a
+ Prelude.Compat: (/=) :: Eq a => a -> a -> Bool
+ Prelude.Compat: (<$) :: Functor f => a -> f b -> f a
+ Prelude.Compat: (<$>) :: Functor f => (a -> b) -> f a -> f b
+ Prelude.Compat: (<) :: Ord a => a -> a -> Bool
+ Prelude.Compat: (<*) :: Applicative f => f a -> f b -> f a
+ Prelude.Compat: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
+ Prelude.Compat: (<=) :: Ord a => a -> a -> Bool
+ Prelude.Compat: (<>) :: Semigroup a => a -> a -> a
+ Prelude.Compat: (=<<) :: Monad m => (a -> m b) -> m a -> m b
+ Prelude.Compat: (==) :: Eq a => a -> a -> Bool
+ Prelude.Compat: (>) :: Ord a => a -> a -> Bool
+ Prelude.Compat: (>=) :: Ord a => a -> a -> Bool
+ Prelude.Compat: (>>) :: Monad m => m a -> m b -> m b
+ Prelude.Compat: (>>=) :: Monad m => m a -> (a -> m b) -> m b
+ Prelude.Compat: (^) :: (Num a, Integral b) => a -> b -> a
+ Prelude.Compat: (^^) :: (Fractional a, Integral b) => a -> b -> a
+ Prelude.Compat: (||) :: Bool -> Bool -> Bool
+ Prelude.Compat: EQ :: Ordering
+ Prelude.Compat: False :: Bool
+ Prelude.Compat: GT :: Ordering
+ Prelude.Compat: Just :: a -> Maybe a
+ Prelude.Compat: LT :: Ordering
+ Prelude.Compat: Left :: a -> Either a b
+ Prelude.Compat: Nothing :: Maybe a
+ Prelude.Compat: Right :: b -> Either a b
+ Prelude.Compat: True :: Bool
+ Prelude.Compat: abs :: Num a => a -> a
+ Prelude.Compat: acos :: Floating a => a -> a
+ Prelude.Compat: acosh :: Floating a => a -> a
+ Prelude.Compat: all :: Foldable t => (a -> Bool) -> t a -> Bool
+ Prelude.Compat: and :: Foldable t => t Bool -> Bool
+ Prelude.Compat: any :: Foldable t => (a -> Bool) -> t a -> Bool
+ Prelude.Compat: appendFile :: FilePath -> String -> IO ()
+ Prelude.Compat: asTypeOf :: a -> a -> a
+ Prelude.Compat: asin :: Floating a => a -> a
+ Prelude.Compat: asinh :: Floating a => a -> a
+ Prelude.Compat: atan :: Floating a => a -> a
+ Prelude.Compat: atan2 :: RealFloat a => a -> a -> a
+ Prelude.Compat: atanh :: Floating a => a -> a
+ Prelude.Compat: break :: (a -> Bool) -> [a] -> ([a], [a])
+ Prelude.Compat: ceiling :: (RealFrac a, Integral b) => a -> b
+ Prelude.Compat: class Functor f => Applicative (f :: Type -> Type)
+ Prelude.Compat: class Bounded a
+ Prelude.Compat: class Enum a
+ Prelude.Compat: class Eq a
+ Prelude.Compat: class Fractional a => Floating a
+ Prelude.Compat: class Foldable (t :: TYPE LiftedRep -> Type)
+ Prelude.Compat: class Num a => Fractional a
+ Prelude.Compat: class Functor (f :: Type -> Type)
+ Prelude.Compat: class (Real a, Enum a) => Integral a
+ Prelude.Compat: class Applicative m => Monad (m :: Type -> Type)
+ Prelude.Compat: class Monad m => MonadFail (m :: Type -> Type)
+ Prelude.Compat: class Semigroup a => Monoid a
+ Prelude.Compat: class Num a
+ Prelude.Compat: class Eq a => Ord a
+ Prelude.Compat: class Read a
+ Prelude.Compat: class (Num a, Ord a) => Real a
+ Prelude.Compat: class (RealFrac a, Floating a) => RealFloat a
+ Prelude.Compat: class (Real a, Fractional a) => RealFrac a
+ Prelude.Compat: class Semigroup a
+ Prelude.Compat: class Show a
+ Prelude.Compat: class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
+ Prelude.Compat: compare :: Ord a => a -> a -> Ordering
+ Prelude.Compat: concat :: Foldable t => t [a] -> [a]
+ Prelude.Compat: concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
+ Prelude.Compat: const :: a -> b -> a
+ Prelude.Compat: cos :: Floating a => a -> a
+ Prelude.Compat: cosh :: Floating a => a -> a
+ Prelude.Compat: curry :: ((a, b) -> c) -> a -> b -> c
+ Prelude.Compat: cycle :: [a] -> [a]
+ Prelude.Compat: data Bool
+ Prelude.Compat: data Char
+ Prelude.Compat: data Double
+ Prelude.Compat: data Either a b
+ Prelude.Compat: data Float
+ Prelude.Compat: data IO a
+ Prelude.Compat: data Int
+ Prelude.Compat: data Integer
+ Prelude.Compat: data Maybe a
+ Prelude.Compat: data Ordering
+ Prelude.Compat: data Word
+ Prelude.Compat: decodeFloat :: RealFloat a => a -> (Integer, Int)
+ Prelude.Compat: div :: Integral a => a -> a -> a
+ Prelude.Compat: divMod :: Integral a => a -> a -> (a, a)
+ Prelude.Compat: drop :: Int -> [a] -> [a]
+ Prelude.Compat: dropWhile :: (a -> Bool) -> [a] -> [a]
+ Prelude.Compat: either :: (a -> c) -> (b -> c) -> Either a b -> c
+ Prelude.Compat: elem :: (Foldable t, Eq a) => a -> t a -> Bool
+ Prelude.Compat: encodeFloat :: RealFloat a => Integer -> Int -> a
+ Prelude.Compat: enumFrom :: Enum a => a -> [a]
+ Prelude.Compat: enumFromThen :: Enum a => a -> a -> [a]
+ Prelude.Compat: enumFromThenTo :: Enum a => a -> a -> a -> [a]
+ Prelude.Compat: enumFromTo :: Enum a => a -> a -> [a]
+ Prelude.Compat: error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a
+ Prelude.Compat: errorWithoutStackTrace :: forall (r :: RuntimeRep) (a :: TYPE r). [Char] -> a
+ Prelude.Compat: even :: Integral a => a -> Bool
+ Prelude.Compat: exp :: Floating a => a -> a
+ Prelude.Compat: exponent :: RealFloat a => a -> Int
+ Prelude.Compat: fail :: MonadFail m => String -> m a
+ Prelude.Compat: filter :: (a -> Bool) -> [a] -> [a]
+ Prelude.Compat: flip :: (a -> b -> c) -> b -> a -> c
+ Prelude.Compat: floatDigits :: RealFloat a => a -> Int
+ Prelude.Compat: floatRadix :: RealFloat a => a -> Integer
+ Prelude.Compat: floatRange :: RealFloat a => a -> (Int, Int)
+ Prelude.Compat: floor :: (RealFrac a, Integral b) => a -> b
+ Prelude.Compat: fmap :: Functor f => (a -> b) -> f a -> f b
+ Prelude.Compat: foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
+ Prelude.Compat: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
+ Prelude.Compat: foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
+ Prelude.Compat: foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
+ Prelude.Compat: foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
+ Prelude.Compat: fromEnum :: Enum a => a -> Int
+ Prelude.Compat: fromInteger :: Num a => Integer -> a
+ Prelude.Compat: fromIntegral :: (Integral a, Num b) => a -> b
+ Prelude.Compat: fromRational :: Fractional a => Rational -> a
+ Prelude.Compat: fst :: (a, b) -> a
+ Prelude.Compat: gcd :: Integral a => a -> a -> a
+ Prelude.Compat: getChar :: IO Char
+ Prelude.Compat: getContents :: IO String
+ Prelude.Compat: getLine :: IO String
+ Prelude.Compat: head :: [a] -> a
+ Prelude.Compat: id :: a -> a
+ Prelude.Compat: infix 4 >=
+ Prelude.Compat: infixl 1 >>=
+ Prelude.Compat: infixl 4 <$
+ Prelude.Compat: infixl 6 -
+ Prelude.Compat: infixl 7 `rem`
+ Prelude.Compat: infixl 9 !!
+ Prelude.Compat: infixr 0 `seq`
+ Prelude.Compat: infixr 1 =<<
+ Prelude.Compat: infixr 2 ||
+ Prelude.Compat: infixr 3 &&
+ Prelude.Compat: infixr 5 ++
+ Prelude.Compat: infixr 6 <>
+ Prelude.Compat: infixr 8 **
+ Prelude.Compat: infixr 9 .
+ Prelude.Compat: init :: [a] -> [a]
+ Prelude.Compat: interact :: (String -> String) -> IO ()
+ Prelude.Compat: ioError :: IOError -> IO a
+ Prelude.Compat: isDenormalized :: RealFloat a => a -> Bool
+ Prelude.Compat: isIEEE :: RealFloat a => a -> Bool
+ Prelude.Compat: isInfinite :: RealFloat a => a -> Bool
+ Prelude.Compat: isNaN :: RealFloat a => a -> Bool
+ Prelude.Compat: isNegativeZero :: RealFloat a => a -> Bool
+ Prelude.Compat: iterate :: (a -> a) -> a -> [a]
+ Prelude.Compat: last :: [a] -> a
+ Prelude.Compat: lcm :: Integral a => a -> a -> a
+ Prelude.Compat: length :: Foldable t => t a -> Int
+ Prelude.Compat: lex :: ReadS String
+ Prelude.Compat: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
+ Prelude.Compat: lines :: String -> [String]
+ Prelude.Compat: log :: Floating a => a -> a
+ Prelude.Compat: logBase :: Floating a => a -> a -> a
+ Prelude.Compat: lookup :: Eq a => a -> [(a, b)] -> Maybe b
+ Prelude.Compat: map :: (a -> b) -> [a] -> [b]
+ Prelude.Compat: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
+ Prelude.Compat: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
+ Prelude.Compat: mappend :: Monoid a => a -> a -> a
+ Prelude.Compat: max :: Ord a => a -> a -> a
+ Prelude.Compat: maxBound :: Bounded a => a
+ Prelude.Compat: maximum :: (Foldable t, Ord a) => t a -> a
+ Prelude.Compat: maybe :: b -> (a -> b) -> Maybe a -> b
+ Prelude.Compat: mconcat :: Monoid a => [a] -> a
+ Prelude.Compat: mempty :: Monoid a => a
+ Prelude.Compat: min :: Ord a => a -> a -> a
+ Prelude.Compat: minBound :: Bounded a => a
+ Prelude.Compat: minimum :: (Foldable t, Ord a) => t a -> a
+ Prelude.Compat: mod :: Integral a => a -> a -> a
+ Prelude.Compat: negate :: Num a => a -> a
+ Prelude.Compat: not :: Bool -> Bool
+ Prelude.Compat: notElem :: (Foldable t, Eq a) => a -> t a -> Bool
+ Prelude.Compat: null :: Foldable t => t a -> Bool
+ Prelude.Compat: odd :: Integral a => a -> Bool
+ Prelude.Compat: or :: Foldable t => t Bool -> Bool
+ Prelude.Compat: otherwise :: Bool
+ Prelude.Compat: pi :: Floating a => a
+ Prelude.Compat: pred :: Enum a => a -> a
+ Prelude.Compat: print :: Show a => a -> IO ()
+ Prelude.Compat: product :: (Foldable t, Num a) => t a -> a
+ Prelude.Compat: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
+ Prelude.Compat: pure :: Applicative f => a -> f a
+ Prelude.Compat: putChar :: Char -> IO ()
+ Prelude.Compat: putStr :: String -> IO ()
+ Prelude.Compat: putStrLn :: String -> IO ()
+ Prelude.Compat: quot :: Integral a => a -> a -> a
+ Prelude.Compat: quotRem :: Integral a => a -> a -> (a, a)
+ Prelude.Compat: read :: Read a => String -> a
+ Prelude.Compat: readFile :: FilePath -> IO String
+ Prelude.Compat: readIO :: Read a => String -> IO a
+ Prelude.Compat: readList :: Read a => ReadS [a]
+ Prelude.Compat: readLn :: Read a => IO a
+ Prelude.Compat: readParen :: Bool -> ReadS a -> ReadS a
+ Prelude.Compat: reads :: Read a => ReadS a
+ Prelude.Compat: readsPrec :: Read a => Int -> ReadS a
+ Prelude.Compat: realToFrac :: (Real a, Fractional b) => a -> b
+ Prelude.Compat: recip :: Fractional a => a -> a
+ Prelude.Compat: rem :: Integral a => a -> a -> a
+ Prelude.Compat: repeat :: a -> [a]
+ Prelude.Compat: replicate :: Int -> a -> [a]
+ Prelude.Compat: return :: Monad m => a -> m a
+ Prelude.Compat: reverse :: [a] -> [a]
+ Prelude.Compat: round :: (RealFrac a, Integral b) => a -> b
+ Prelude.Compat: scaleFloat :: RealFloat a => Int -> a -> a
+ Prelude.Compat: scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ Prelude.Compat: scanl1 :: (a -> a -> a) -> [a] -> [a]
+ Prelude.Compat: scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ Prelude.Compat: scanr1 :: (a -> a -> a) -> [a] -> [a]
+ Prelude.Compat: seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
+ Prelude.Compat: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
+ Prelude.Compat: sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
+ Prelude.Compat: sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
+ Prelude.Compat: show :: Show a => a -> String
+ Prelude.Compat: showChar :: Char -> ShowS
+ Prelude.Compat: showList :: Show a => [a] -> ShowS
+ Prelude.Compat: showParen :: Bool -> ShowS -> ShowS
+ Prelude.Compat: showString :: String -> ShowS
+ Prelude.Compat: shows :: Show a => a -> ShowS
+ Prelude.Compat: showsPrec :: Show a => Int -> a -> ShowS
+ Prelude.Compat: significand :: RealFloat a => a -> a
+ Prelude.Compat: signum :: Num a => a -> a
+ Prelude.Compat: sin :: Floating a => a -> a
+ Prelude.Compat: sinh :: Floating a => a -> a
+ Prelude.Compat: snd :: (a, b) -> b
+ Prelude.Compat: span :: (a -> Bool) -> [a] -> ([a], [a])
+ Prelude.Compat: splitAt :: Int -> [a] -> ([a], [a])
+ Prelude.Compat: sqrt :: Floating a => a -> a
+ Prelude.Compat: subtract :: Num a => a -> a -> a
+ Prelude.Compat: succ :: Enum a => a -> a
+ Prelude.Compat: sum :: (Foldable t, Num a) => t a -> a
+ Prelude.Compat: tail :: [a] -> [a]
+ Prelude.Compat: take :: Int -> [a] -> [a]
+ Prelude.Compat: takeWhile :: (a -> Bool) -> [a] -> [a]
+ Prelude.Compat: tan :: Floating a => a -> a
+ Prelude.Compat: tanh :: Floating a => a -> a
+ Prelude.Compat: toEnum :: Enum a => Int -> a
+ Prelude.Compat: toInteger :: Integral a => a -> Integer
+ Prelude.Compat: toRational :: Real a => a -> Rational
+ Prelude.Compat: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
+ Prelude.Compat: truncate :: (RealFrac a, Integral b) => a -> b
+ Prelude.Compat: type FilePath = String
+ Prelude.Compat: type IOError = IOException
+ Prelude.Compat: type Rational = Ratio Integer
+ Prelude.Compat: type ReadS a = String -> [(a, String)]
+ Prelude.Compat: type ShowS = String -> String
+ Prelude.Compat: type String = [Char]
+ Prelude.Compat: uncurry :: (a -> b -> c) -> (a, b) -> c
+ Prelude.Compat: undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
+ Prelude.Compat: unlines :: [String] -> String
+ Prelude.Compat: until :: (a -> Bool) -> (a -> a) -> a -> a
+ Prelude.Compat: unwords :: [String] -> String
+ Prelude.Compat: unzip :: [(a, b)] -> ([a], [b])
+ Prelude.Compat: unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ Prelude.Compat: userError :: String -> IOError
+ Prelude.Compat: words :: String -> [String]
+ Prelude.Compat: writeFile :: FilePath -> String -> IO ()
+ Prelude.Compat: zip :: [a] -> [b] -> [(a, b)]
+ Prelude.Compat: zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ Prelude.Compat: zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ Prelude.Compat: zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
Files
- CHANGES.markdown +24/−4
- README.markdown +32/−3
- base-compat.cabal +9/−17
- src/Control/Exception/Compat.hs +4/−0
- src/Data/Bifoldable1/Compat.hs +10/−0
- src/Data/Bifoldable1/Compat/Repl.hs +8/−0
- src/Data/Foldable1/Compat.hs +10/−0
- src/Data/Foldable1/Compat/Repl.hs +8/−0
- src/Data/Function/Compat.hs +34/−0
- src/Data/List/NonEmpty/Compat.hs +106/−56
- src/Data/Traversable/Compat.hs +109/−0
- src/Data/Traversable/Compat/Repl.hs +8/−0
- src/Data/Tuple/Compat.hs +8/−1
- src/Data/Typeable/Compat.hs +34/−0
- src/Data/Typeable/Compat/Repl.hs +8/−0
- src/Debug/Trace/Compat.hs +42/−1
- src/Numeric/Natural/Compat.hs +8/−0
- src/Prelude/Compat.hs +13/−2
CHANGES.markdown view
@@ -1,7 +1,27 @@-## Changes in 0.12.3 [2023.07.12]- - This coincides with the `base-compat-batteries-0.12.3` release. Refer to the- [`base-compat-batteries` changelog](https://github.com/haskell-compat/base-compat/blob/master/base-compat-batteries/CHANGES.markdown#changes-in-0123-20230712)- for more details.+## Changes in 0.13.0 [2023.03.10]+ - Sync with `base-4.18`/GHC 9.6+ - Backport `liftA2` being re-exported from `Prelude.Compat`.+ - `Data.Tuple.Compat`'s `Solo` API now matches what is present in `Data.Tuple`+ in `base-4.18`. In particular, we now re-export both the `MkSolo` and `Solo`+ data constructors when building with `ghc-prim-0.10.0` or later, with+ `MkSolo` being preferred over `Solo`. If you want to backport `MkSolo` to+ earlier versions of GHC, import `Data.Tuple.Compat` from+ `base-compat-batteries` instead.+ - Backport `traceWith`, `traceShowWith`, and `traceEventWith` to `Debug.Trace`.+ Note that `traceEventWith` is only provided when building with `base-4.5` or+ later, as that is the first version of `base` to provide the `traceEvent`+ primitive on which `traceEventWith` is defined.+ - Backport `inits1` and `tails1` to `Data.List.NonEmpty.Compat`.+ - Backport `minusNaturalMaybe` to `Numeric.Natural.Compat`.+ - Backport `applyWhen` to `Data.Function.Compat`.+ - Backport `mapAccumM` and `forAccumM` to `Data.Traversable.Compat`.+ - Backport `heqT` to `Data.Typeable.Compat`. Note that `heqT` is only defined+ when building with `base-4.10` or later, as that is the first version of+ `base` to provide the primitives needed to define `heqT`.+ - Introduce `Data.Foldable1.Compat` and `Data.Bifoldable1.Compat` modules,+ which correspond to changes made in `base-4.18.0.0`. You may consider using+ `base-compat-batteries` instead if you want increase the range of `base`+ versions that are supported. ## Changes in 0.12.2 [2022.08.11] - Sync with `base-4.17`/GHC 9.4
README.markdown view
@@ -129,7 +129,7 @@ and `cis` in `Data.Complex.Compat` * Added more efficient `maximumBy`/`minimumBy` to `Data.Foldable.Compat` * Added `($>)` and `void` functions to `Data.Functor.Compat`- * `(&)` function to `Data.Function.Compat`+ * `(&)` and `applyWhen` functions to `Data.Function.Compat` * `($>)` and `void` functions to `Data.Functor.Compat` * `modifyIORef'`, `atomicModifyIORef'` and `atomicWriteIORef` to `Data.IORef.Compat` * `dropWhileEnd`, `isSubsequenceOf`, `sortOn`, and `uncons` functions to `Data.List.Compat`@@ -139,7 +139,8 @@ * `String`, `lines`, `words`, `unlines`, and `unwords` to `Data.String.Compat` * `gcoerceWith` to `Data.Type.Coercion.Compat` * `makeVersion` function to `Data.Version.Compat`- * `traceId`, `traceShowId`, `traceM`, and `traceShowM` functions to `Debug.Trace.Compat`+ * `traceId`, `traceShowId`, `traceM`, `traceShowM`, `traceWith`,+ `traceShowWith`, and `traceEventWith` functions to `Debug.Trace.Compat` * `byteSwap16`, `byteSwap32`, and `byteSwap64` to `Data.Word.Compat` * `plusForeignPtr` to `Foreign.ForeignPtr.Compat` * `calloc` and `callocBytes` functions to `Foreign.Marshal.Alloc.Compat`@@ -150,13 +151,18 @@ * `lookupEnv`, `setEnv` and `unsetEnv` to `System.Environment.Compat` * `unsafeFixIO` and `unsafeDupablePerformIO` to `System.IO.Unsafe.IO` * `RuntimeRep`-polymorphic `($!)` to `Prelude.Compat`+ * `liftA2` is re-exported from `Prelude.Compat` * `RuntimeRep`-polymorphic `throw` to `Control.Exception.Compat` * `isResourceVanishedError`, `resourceVanishedErrorType`, and `isResourceVanishedErrorType` to `System.IO.Error.Compat` * `singleton` to `Data.List.Compat` and `Data.List.NonEmpty.Compat`+ * `inits1` and `tails1` to `Data.List.NonEmpty.Compat` * `hGetContents'`, `getContents'`, and `readFile'` to `System.IO.Compat` * `readBinP` to `Text.Read.Lex.Compat` * `withTypeable` and `pattern TypeRep` to `Type.Reflection.Compat`+ * `minusNaturalMaybe` to `Numeric.Natural.Compat`+ * `mapAccumM` and `forAccumM` to `Data.Traversable.Compat`+ * `heqT` to `Data.Typeable.Compat` ## What is not covered @@ -260,7 +266,7 @@ Here is a list of compatibility libraries that `base-compat-batteries` depends on, paired with the things that each library backports: -* [`bifunctors`](http://hackage.haskell.org/package/bifunctors)+* [`bifunctor-classes-compat`](http://hackage.haskell.org/package/bifunctor-classes-compat) for: * The [`Bifunctor`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Bifunctor.html#t:Bifunctor) type class, introduced in `base-4.8.0.0`@@ -273,6 +279,10 @@ * [`fail`](http://hackage.haskell.org/package/fail) for the [`MonadFail`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-Fail.html#t:MonadFail) type class, introduced in `base-4.9.0.0`+* [`foldable1-classes-compat`](https://hackage.haskell.org/package/foldable1-classes-compat)+ for the [`Foldable1`](https://hackage.haskell.org/package/foldable1-classes-compat-0.1/docs/Data-Foldable1.html#t:Foldable1)+ and [`Bifoldable1`](https://hackage.haskell.org/package/foldable1-classes-compat-0.1/docs/Data-Bifoldable1.html#t:Bifoldable1)+ type classes, introduced in `base-4.18.0.0` * [`nats`](http://hackage.haskell.org/package/nats) for the [`Natural`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Numeric-Natural.html) data type, introduced in `base-4.8.0.0`@@ -310,8 +320,27 @@ for the [`Void`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Void.html#t:Void) data type, introduced in `base-4.8.0.0` +## Version policy++This package follows the [Haskell Package Versioning+Policy](https://pvp.haskell.org/). As such, if a new `base-compat` release only+adds new exports, then as a general rule, we will release it with a minor+version bump. Moreover, since `base-compat` does not backport data type or+class definitions (see the "What is not covered" section above), `base-compat`+usually has fewer major version bumps than `base` itself.++An exception to the general rule about adding new exports is the+`Prelude.Compat` module. If a new `base-compat` release adds any new exports,+then it will _always_ be accompanied by a major version bump, even if there are+no other API changes. This is because of the special nature of+`Prelude.Compat`, which is designed to be imported unqualified. Pre-emptively+bumping the major version number is meant to signal to downstream libraries+that they should check to see if the new `Prelude.Compat` additions will clash+with identifiers of the same names in their code.+ ## Supported versions of GHC/`base` + * `ghc-9.6.*` / `base-4.18.*` * `ghc-9.4.*` / `base-4.17.*` * `ghc-9.2.*` / `base-4.16.*` * `ghc-9.0.*` / `base-4.15.*`
base-compat.cabal view
@@ -1,5 +1,5 @@ name: base-compat-version: 0.12.3+version: 0.13.0 license: MIT license-file: LICENSE copyright: (c) 2012-2018 Simon Hengel,@@ -44,22 +44,6 @@ anything in @base-compat-batteries@, to allow for easier use in GHCi. extra-source-files: CHANGES.markdown, README.markdown-tested-with: GHC == 7.0.4- , GHC == 7.2.2- , GHC == 7.4.2- , GHC == 7.6.3- , GHC == 7.8.4- , GHC == 7.10.3- , GHC == 8.0.2- , GHC == 8.2.2- , GHC == 8.4.4- , GHC == 8.6.5- , GHC == 8.8.4- , GHC == 8.10.7- , GHC == 9.0.2- , GHC == 9.2.7- , GHC == 9.4.5- , GHC == 9.6.2 source-repository head type: git@@ -94,6 +78,7 @@ Control.Monad.ST.Lazy.Unsafe.Compat Control.Monad.ST.Unsafe.Compat Data.Bifoldable.Compat+ Data.Bifoldable1.Compat Data.Bifunctor.Compat Data.Bitraversable.Compat Data.Bits.Compat@@ -101,6 +86,7 @@ Data.Complex.Compat Data.Either.Compat Data.Foldable.Compat+ Data.Foldable1.Compat Data.Function.Compat Data.Functor.Compat Data.Functor.Compose.Compat@@ -118,7 +104,9 @@ Data.Semigroup.Compat Data.STRef.Compat Data.String.Compat+ Data.Traversable.Compat Data.Tuple.Compat+ Data.Typeable.Compat Data.Type.Coercion.Compat Data.Type.Equality.Compat Data.Version.Compat@@ -156,6 +144,7 @@ Control.Monad.ST.Lazy.Unsafe.Compat.Repl Control.Monad.ST.Unsafe.Compat.Repl Data.Bifoldable.Compat.Repl+ Data.Bifoldable1.Compat.Repl Data.Bifunctor.Compat.Repl Data.Bitraversable.Compat.Repl Data.Bits.Compat.Repl@@ -163,6 +152,7 @@ Data.Complex.Compat.Repl Data.Either.Compat.Repl Data.Foldable.Compat.Repl+ Data.Foldable1.Compat.Repl Data.Function.Compat.Repl Data.Functor.Compat.Repl Data.Functor.Compose.Compat.Repl@@ -180,7 +170,9 @@ Data.Semigroup.Compat.Repl Data.STRef.Compat.Repl Data.String.Compat.Repl+ Data.Traversable.Compat.Repl Data.Tuple.Compat.Repl+ Data.Typeable.Compat.Repl Data.Type.Coercion.Compat.Repl Data.Type.Equality.Compat.Repl Data.Version.Compat.Repl
src/Control/Exception/Compat.hs view
@@ -3,9 +3,13 @@ {-# LANGUAGE Trustworthy #-} #endif #if MIN_VERSION_base(4,10,0)+{-# LANGUAGE DataKinds #-} {-# LANGUAGE MagicHash #-}+{-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-}+# if __GLASGOW_HASKELL__ < 806 {-# LANGUAGE TypeInType #-}+# endif #endif module Control.Exception.Compat ( module Base
+ src/Data/Bifoldable1/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Bifoldable1.Compat (+#if MIN_VERSION_base(4,18,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,18,0)+import Data.Bifoldable1 as Base+#endif
+ src/Data/Bifoldable1/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bifoldable1.Compat"+-- from a globally unique namespace.+module Data.Bifoldable1.Compat.Repl (+ module Data.Bifoldable1.Compat+) where+import "this" Data.Bifoldable1.Compat
+ src/Data/Foldable1/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Foldable1.Compat (+#if MIN_VERSION_base(4,18,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,18,0)+import Data.Foldable1 as Base+#endif
+ src/Data/Foldable1/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Foldable1.Compat"+-- from a globally unique namespace.+module Data.Foldable1.Compat.Repl (+ module Data.Foldable1.Compat+) where+import "this" Data.Foldable1.Compat
src/Data/Function/Compat.hs view
@@ -2,9 +2,14 @@ module Data.Function.Compat ( module Base , (&)+, applyWhen ) where import Data.Function as Base +#if !(MIN_VERSION_base(4,18,0))+import Prelude.Compat+#endif+ #if !(MIN_VERSION_base(4,8,0)) infixl 1 & @@ -16,4 +21,33 @@ (&) :: a -> (a -> b) -> b x & f = f x +#endif++#if !(MIN_VERSION_base(4,18,0))+-- | 'applyWhen' applies a function to a value if a condition is true,+-- otherwise, it returns the value unchanged.+--+-- It is equivalent to @'flip' ('Data.Bool.bool' 'id')@.+--+-- Algebraic properties:+--+-- * @applyWhen 'True' = 'id'@+--+-- * @applyWhen 'False' f = 'id'@+--+-- /Since: 4.18.0.0/+applyWhen :: Bool -> (a -> a) -> a -> a+applyWhen True f x = f x+applyWhen False _ x = x+-- Proofs:+--+-- flip bool id = \q f -> bool id f q+-- = \f q -> case q of+-- True -> f = \x -> f x+-- False -> id = \x -> x ∎+--+-- applyWhen True = \f x -> f x+-- = \f -> \x -> f x = \f -> f = id ∎+--+-- applyWhen False f = \x -> x = id ∎ #endif
src/Data/List/NonEmpty/Compat.hs view
@@ -7,81 +7,131 @@ NonEmpty(..) -- * Non-empty stream transformations- , map - , intersperse - , scanl - , scanr - , scanl1 - , scanr1 - , transpose - , sortBy - , sortWith + , map+ , intersperse+ , scanl+ , scanr+ , scanl1+ , scanr1+ , transpose+ , sortBy+ , sortWith -- * Basic functions- , length - , head - , tail - , last - , init + , length+ , head+ , tail+ , last+ , init , singleton- , (<|), cons - , uncons - , unfoldr - , sort - , reverse - , inits - , tails + , (<|), cons+ , uncons+ , unfoldr+ , sort+ , reverse+ , inits+ , inits1+ , tails+ , tails1 -- * Building streams- , iterate - , repeat - , cycle - , unfold - , insert - , some1 + , iterate+ , repeat+ , cycle+ , unfold+ , insert+ , some1 -- * Extracting sublists- , take - , drop - , splitAt - , takeWhile - , dropWhile - , span - , break - , filter - , partition - , group - , groupBy - , groupWith - , groupAllWith - , group1 - , groupBy1 - , groupWith1 - , groupAllWith1 + , take+ , drop+ , splitAt+ , takeWhile+ , dropWhile+ , span+ , break+ , filter+ , partition+ , group+ , groupBy+ , groupWith+ , groupAllWith+ , group1+ , groupBy1+ , groupWith1+ , groupAllWith1 -- * Sublist predicates- , isPrefixOf + , isPrefixOf -- * \"Set\" operations- , nub - , nubBy + , nub+ , nubBy -- * Indexing streams- , (!!) + , (!!) -- * Zipping and unzipping streams- , zip - , zipWith - , unzip + , zip+ , zipWith+ , unzip -- * Converting to and from a list- , fromList - , toList - , nonEmpty - , xor + , fromList+ , toList+ , nonEmpty+ , xor #endif ) where #if MIN_VERSION_base(4,9,0) import Data.List.NonEmpty++# if !(MIN_VERSION_base(4,18,0))+import qualified Prelude.Compat as Prelude+import Prelude.Compat ((.))++import qualified Data.Foldable.Compat as Foldable+import qualified Data.List.Compat as List+# endif #endif -#if MIN_VERSION_base(4,9,0) && !(MIN_VERSION_base(4,15,0))+#if MIN_VERSION_base(4,9,0)+# if !(MIN_VERSION_base(4,15,0)) -- | Construct a 'NonEmpty' list from a single element. -- -- /Since: 4.15/ singleton :: a -> NonEmpty a singleton a = a :| []+# endif++# if !(MIN_VERSION_base(4,18,0))+-- | The 'inits1' function takes a 'NonEmpty' stream @xs@ and returns all the+-- 'NonEmpty' finite prefixes of @xs@, starting with the shortest.+--+-- > inits1 (1 :| [2,3]) == (1 :| []) :| [1 :| [2], 1 :| [2,3]]+-- > inits1 (1 :| []) == (1 :| []) :| []+--+-- /Since: 4.18/+inits1 :: NonEmpty a -> NonEmpty (NonEmpty a)+inits1 =+ -- fromList is an unsafe function, but this usage should be safe, since:+ -- - `inits xs = [[], ..., init (init xs), init xs, xs]`+ -- - If `xs` is nonempty, it follows that `inits xs` contains at least one nonempty+ -- list, since `last (inits xs) = xs`.+ -- - The only empty element of `inits xs` is the first one (by the definition of `inits`)+ -- - Therefore, if we take all but the first element of `inits xs` i.e.+ -- `tail (inits xs)`, we have a nonempty list of nonempty lists+ fromList . Prelude.map fromList . List.tail . List.inits . Foldable.toList++-- | The 'tails1' function takes a 'NonEmpty' stream @xs@ and returns all the+-- non-empty suffixes of @xs@, starting with the longest.+--+-- > tails1 (1 :| [2,3]) == (1 :| [2,3]) :| [2 :| [3], 3 :| []]+-- > tails1 (1 :| []) == (1 :| []) :| []+--+-- /Since: 4.18/+tails1 :: NonEmpty a -> NonEmpty (NonEmpty a)+tails1 =+ -- fromList is an unsafe function, but this usage should be safe, since:+ -- - `tails xs = [xs, tail xs, tail (tail xs), ..., []]`+ -- - If `xs` is nonempty, it follows that `tails xs` contains at least one nonempty+ -- list, since `head (tails xs) = xs`.+ -- - The only empty element of `tails xs` is the last one (by the definition of `tails`)+ -- - Therefore, if we take all but the last element of `tails xs` i.e.+ -- `init (tails xs)`, we have a nonempty list of nonempty lists+ fromList . Prelude.map fromList . List.init . List.tails . Foldable.toList+# endif #endif
+ src/Data/Traversable/Compat.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+#if __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Trustworthy #-}+#endif+#if !(MIN_VERSION_base(4,18,0))+{-# LANGUAGE ScopedTypeVariables #-}+#endif+module Data.Traversable.Compat (+ module Base+, mapAccumM+, forAccumM+) where++import Data.Traversable as Base++#if !(MIN_VERSION_base(4,18,0))+import Prelude.Compat++import Control.Monad.Compat (liftM)++# if MIN_VERSION_base(4,8,0)+import Data.Coerce (Coercible, coerce)+# else+import Unsafe.Coerce (unsafeCoerce)+# endif+#endif++#if !(MIN_VERSION_base(4,18,0))+-- | A state transformer monad parameterized by the state and inner monad.+-- The implementation is copied from the transformers package with the+-- return tuple swapped.+--+-- /Since: 4.18.0.0/+newtype StateT s m a = StateT { runStateT :: s -> m (s, a) }++-- | /Since: 4.18.0.0/+instance Monad m => Functor (StateT s m) where+ fmap = liftM+ {-# INLINE fmap #-}++-- | /Since: 4.18.0.0/+instance Monad m => Applicative (StateT s m) where+ pure a = StateT $ \ s -> return (s, a)+ {-# INLINE pure #-}+ StateT mf <*> StateT mx = StateT $ \ s -> do+ (s', f) <- mf s+ (s'', x) <- mx s'+ return (s'', f x)+ {-# INLINE (<*>) #-}+ m *> k = m >>= \_ -> k+ {-# INLINE (*>) #-}++# if MIN_VERSION_base(4,8,0)+(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)+(#.) _f = coerce+# else+(#.) :: (b -> c) -> (a -> b) -> (a -> c)+(#.) _f = unsafeCoerce+# endif++-- | /Since: 4.18.0.0/+instance (Monad m) => Monad (StateT s m) where+ m >>= k = StateT $ \ s -> do+ (s', a) <- runStateT m s+ runStateT (k a) s'+ {-# INLINE (>>=) #-}+# if !(MIN_VERSION_base(4,11,0))+ return = pure+# endif++-- | The `mapAccumM` function behaves like a combination of `mapM` and+-- `mapAccumL` that traverses the structure while evaluating the actions+-- and passing an accumulating parameter from left to right.+-- It returns a final value of this accumulator together with the new structure.+-- The accummulator is often used for caching the intermediate results of a computation.+--+-- @since 4.18.0.0+--+-- ==== __Examples__+--+-- Basic usage:+--+-- >>> let expensiveDouble a = putStrLn ("Doubling " <> show a) >> pure (2 * a)+-- >>> :{+-- mapAccumM (\cache a -> case lookup a cache of+-- Nothing -> expensiveDouble a >>= \double -> pure ((a, double):cache, double)+-- Just double -> pure (cache, double)+-- ) [] [1, 2, 3, 1, 2, 3]+-- :}+-- Doubling 1+-- Doubling 2+-- Doubling 3+-- ([(3,6),(2,4),(1,2)],[2,4,6,2,4,6])+--+mapAccumM+ :: forall m t s a b. (Monad m, Traversable t)+ => (s -> a -> m (s, b))+ -> s -> t a -> m (s, t b)+mapAccumM f s t = runStateT (mapM (StateT #. flip f) t) s++-- | 'forAccumM' is 'mapAccumM' with the arguments rearranged.+--+-- @since 4.18.0.0+forAccumM+ :: (Monad m, Traversable t)+ => s -> t a -> (s -> a -> m (s, b)) -> m (s, t b)+{-# INLINE forAccumM #-}+forAccumM s t f = mapAccumM f s t+#endif
+ src/Data/Traversable/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Traversable.Compat"+-- from a globally unique namespace.+module Data.Traversable.Compat.Repl (+ module Data.Traversable.Compat+) where+import "this" Data.Traversable.Compat
src/Data/Tuple/Compat.hs view
@@ -2,6 +2,13 @@ #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Safe #-} #endif+#if MIN_VERSION_ghc_prim(0,7,0)+{-# LANGUAGE PatternSynonyms #-}+#endif+-- | Note that we only re-export @MkSolo@ when building with @ghc-prim-0.10.0@+-- (bundled with GHC 9.6) or later. If you want to backport @MkSolo@ to older+-- versions of GHC, import @Data.Tuple.Compat@ from @base-compat-batteries@+-- instead. module Data.Tuple.Compat ( fst , snd@@ -9,7 +16,7 @@ , uncurry , swap #if MIN_VERSION_ghc_prim(0,10,0)- , Solo(MkSolo, Solo)+ , Solo(MkSolo,Solo) #elif MIN_VERSION_ghc_prim(0,7,0) , Solo(Solo) #endif
+ src/Data/Typeable/Compat.hs view
@@ -0,0 +1,34 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+#if __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Trustworthy #-}+#endif+#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,18,0))+{-# LANGUAGE PolyKinds #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeOperators #-}+#endif+module Data.Typeable.Compat (+ module Base+#if MIN_VERSION_base(4,10,0)+, heqT+#endif+) where++import Data.Typeable as Base++#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,18,0))+import Prelude.Compat++import qualified Type.Reflection.Compat as TR+#endif++#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,18,0))+-- | Extract a witness of heterogeneous equality of two types+--+-- /Since: 4.18.0.0/+heqT :: forall a b. (Typeable a, Typeable b) => Maybe (a :~~: b)+heqT = ta `TR.eqTypeRep` tb+ where+ ta = TR.typeRep :: TR.TypeRep a+ tb = TR.typeRep :: TR.TypeRep b+#endif
+ src/Data/Typeable/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Typeable.Compat"+-- from a globally unique namespace.+module Data.Typeable.Compat.Repl (+ module Data.Typeable.Compat+) where+import "this" Data.Typeable.Compat
src/Debug/Trace/Compat.hs view
@@ -5,6 +5,11 @@ , traceShowId , traceM , traceShowM+, traceWith+, traceShowWith+#if MIN_VERSION_base(4,5,0)+, traceEventWith+#endif ) where #if !(MIN_VERSION_base(4,7,0)) || MIN_VERSION_base(4,9,0)@@ -16,7 +21,7 @@ ) #endif -#if !(MIN_VERSION_base(4,9,0))+#if !(MIN_VERSION_base(4,18,0)) import Prelude.Compat #endif @@ -74,4 +79,40 @@ -} traceShowM :: (Show a, Applicative f) => a -> f () traceShowM = traceM . show+#endif++#if !(MIN_VERSION_base(4,18,0))+{-|+Like 'trace', but outputs the result of calling a function on the argument.++>>> traceWith fst ("hello","world")+hello+("hello","world")++/Since: 4.18.0.0/+-}+traceWith :: (a -> String) -> a -> a+traceWith f a = trace (f a) a++{-|+Like 'traceWith', but uses 'show' on the result of the function to convert it to+a 'String'.++>>> traceShowWith length [1,2,3]+3+[1,2,3]++/Since: 4.18.0.0/+-}+traceShowWith :: Show b => (a -> b) -> a -> a+traceShowWith f = traceWith (show . f)++# if MIN_VERSION_base(4,5,0)+-- | Like 'traceEvent', but emits the result of calling a function on its+-- argument.+--+-- /Since: 4.18.0.0/+traceEventWith :: (a -> String) -> a -> a+traceEventWith f a = traceEvent (f a) a+# endif #endif
src/Numeric/Natural/Compat.hs view
@@ -1,10 +1,18 @@ {-# LANGUAGE CPP, NoImplicitPrelude #-}+#if __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Trustworthy #-}+#endif module Numeric.Natural.Compat ( #if MIN_VERSION_base(4,8,0) module Base+, minusNaturalMaybe #endif ) where #if MIN_VERSION_base(4,8,0) import Numeric.Natural as Base++# if !(MIN_VERSION_base(4,18,0))+import GHC.Natural (minusNaturalMaybe)+# endif #endif
src/Prelude/Compat.hs view
@@ -7,8 +7,11 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeInType #-} #endif+#if MIN_VERSION_base(4,17,0) && !(MIN_VERSION_base(4,18,0))+{-# LANGUAGE ExplicitNamespaces #-}+#endif module Prelude.Compat (-#if MIN_VERSION_base(4,12,0)+#if MIN_VERSION_base(4,18,0) module Base #else either@@ -133,6 +136,7 @@ , (<*) , (<*>) , pure+, liftA2 , (<$) , fmap , (>>)@@ -271,6 +275,11 @@ , ReadS , ShowS , String++# if MIN_VERSION_base(4,17,0)+-- The equality types+, type (~)+# endif #endif ) where @@ -286,6 +295,8 @@ # endif ) +import Control.Applicative (liftA2)+ #else import Prelude hiding (@@ -315,11 +326,11 @@ , sum ) +import Control.Applicative import Data.Foldable.Compat import Data.Traversable # if !(MIN_VERSION_base(4,8,0))-import Control.Applicative import Data.Monoid import Data.Word # endif