base-compat 0.9.3 → 0.10.0
raw patch · 93 files changed
+927/−543 lines, 93 filesdep −QuickCheckdep −base-compatdep −hspecdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: QuickCheck, base-compat, hspec
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.Foldable.Compat: maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- Data.Foldable.Compat: minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- Data.Functor.Const.Compat: newtype Const k a (b :: k) :: forall k. * -> k -> *
+ Data.Functor.Compat: (<&>) :: Functor f => f a -> (a -> b) -> f b
+ Data.Functor.Compat: infixl 1 <&>
+ Data.Functor.Const.Compat: newtype Const k a (b :: k) :: forall k. () => * -> k -> *
+ Data.List.Compat: iterate' :: (a -> a) -> a -> [a]
+ Data.Semigroup.Compat: (<>) :: Semigroup a => a -> a -> a
+ Data.Semigroup.Compat: All :: Bool -> All
+ Data.Semigroup.Compat: Any :: Bool -> Any
+ Data.Semigroup.Compat: Arg :: a -> b -> Arg a b
+ Data.Semigroup.Compat: Dual :: a -> Dual a
+ Data.Semigroup.Compat: Endo :: (a -> a) -> Endo a
+ Data.Semigroup.Compat: First :: a -> First a
+ Data.Semigroup.Compat: Last :: a -> Last a
+ Data.Semigroup.Compat: Max :: a -> Max a
+ Data.Semigroup.Compat: Min :: a -> Min a
+ Data.Semigroup.Compat: Option :: Maybe a -> Option a
+ Data.Semigroup.Compat: Product :: a -> Product a
+ Data.Semigroup.Compat: Sum :: a -> Sum a
+ Data.Semigroup.Compat: WrapMonoid :: m -> WrappedMonoid m
+ Data.Semigroup.Compat: [appEndo] :: Endo a -> a -> a
+ Data.Semigroup.Compat: [getAll] :: All -> Bool
+ Data.Semigroup.Compat: [getAny] :: Any -> Bool
+ Data.Semigroup.Compat: [getDual] :: Dual a -> a
+ Data.Semigroup.Compat: [getFirst] :: First a -> a
+ Data.Semigroup.Compat: [getLast] :: Last a -> a
+ Data.Semigroup.Compat: [getMax] :: Max a -> a
+ Data.Semigroup.Compat: [getMin] :: Min a -> a
+ Data.Semigroup.Compat: [getOption] :: Option a -> Maybe a
+ Data.Semigroup.Compat: [getProduct] :: Product a -> a
+ Data.Semigroup.Compat: [getSum] :: Sum a -> a
+ Data.Semigroup.Compat: [unwrapMonoid] :: WrappedMonoid m -> m
+ Data.Semigroup.Compat: class Semigroup a
+ Data.Semigroup.Compat: cycle1 :: Semigroup m => m -> m
+ Data.Semigroup.Compat: data Arg a b :: * -> * -> *
+ Data.Semigroup.Compat: diff :: Semigroup m => m -> Endo m
+ Data.Semigroup.Compat: mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
+ Data.Semigroup.Compat: newtype All :: *
+ Data.Semigroup.Compat: newtype Any :: *
+ Data.Semigroup.Compat: newtype Dual a :: * -> *
+ Data.Semigroup.Compat: newtype Endo a :: * -> *
+ Data.Semigroup.Compat: newtype First a :: * -> *
+ Data.Semigroup.Compat: newtype Last a :: * -> *
+ Data.Semigroup.Compat: newtype Max a :: * -> *
+ Data.Semigroup.Compat: newtype Min a :: * -> *
+ Data.Semigroup.Compat: newtype Option a :: * -> *
+ Data.Semigroup.Compat: newtype Product a :: * -> *
+ Data.Semigroup.Compat: newtype Sum a :: * -> *
+ Data.Semigroup.Compat: newtype WrappedMonoid m :: * -> *
+ Data.Semigroup.Compat: option :: () => b -> (a -> b) -> Option a -> b
+ Data.Semigroup.Compat: sconcat :: Semigroup a => NonEmpty a -> a
+ Data.Semigroup.Compat: stimes :: (Semigroup a, Integral b) => b -> a -> a
+ Data.Semigroup.Compat: stimesIdempotent :: Integral b => b -> a -> a
+ Data.Semigroup.Compat: stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
+ Data.Semigroup.Compat: stimesMonoid :: (Integral b, Monoid a) => b -> a -> a
+ Data.Semigroup.Compat: type ArgMax a b = Max Arg a b
+ Data.Semigroup.Compat: type ArgMin a b = Min Arg a b
+ Numeric.Compat: showHFloat :: RealFloat a => a -> ShowS
+ Prelude.Compat: (!!) :: () => [a] -> Int -> a
+ Prelude.Compat: ($!) :: () => (a -> b) -> a -> b
+ Prelude.Compat: ($) :: () => (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 :: * -> *)
+ 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 :: * -> *)
+ Prelude.Compat: class Num a => Fractional a
+ Prelude.Compat: class Functor (f :: * -> *)
+ Prelude.Compat: class (Real a, Enum a) => Integral a
+ Prelude.Compat: class Applicative m => Monad (m :: * -> *)
+ Prelude.Compat: class 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 :: * -> *)
+ 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 :: HasCallStack => [Char] -> a
+ Prelude.Compat: errorWithoutStackTrace :: () => [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 :: Monad 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 $
+ 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: 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 :: () => 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 :: 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]
+ Type.Reflection.Compat: withTypeable :: forall (a :: k) (r :: TYPE rep). () => TypeRep a -> (Typeable a => r) -> r
- Control.Concurrent.Compat: forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
+ Control.Concurrent.Compat: forkFinally :: () => IO a -> (Either SomeException a -> IO ()) -> IO ThreadId
- Control.Concurrent.Compat: forkOSWithUnmask :: ((forall a. IO a -> IO a) -> IO ()) -> IO ThreadId
+ Control.Concurrent.Compat: forkOSWithUnmask :: ((forall a. () => IO a -> IO a) -> IO ()) -> IO ThreadId
- Control.Concurrent.MVar.Compat: withMVarMasked :: MVar a -> (a -> IO b) -> IO b
+ Control.Concurrent.MVar.Compat: withMVarMasked :: () => MVar a -> (a -> IO b) -> IO b
- Control.Monad.ST.Lazy.Unsafe.Compat: unsafeIOToST :: IO a -> ST s a
+ Control.Monad.ST.Lazy.Unsafe.Compat: unsafeIOToST :: () => IO a -> ST s a
- Control.Monad.ST.Lazy.Unsafe.Compat: unsafeInterleaveST :: ST s a -> ST s a
+ Control.Monad.ST.Lazy.Unsafe.Compat: unsafeInterleaveST :: () => ST s a -> ST s a
- Control.Monad.ST.Unsafe.Compat: unsafeIOToST :: IO a -> ST s a
+ Control.Monad.ST.Unsafe.Compat: unsafeIOToST :: () => IO a -> ST s a
- Control.Monad.ST.Unsafe.Compat: unsafeInterleaveST :: ST s a -> ST s a
+ Control.Monad.ST.Unsafe.Compat: unsafeInterleaveST :: () => ST s a -> ST s a
- Control.Monad.ST.Unsafe.Compat: unsafeSTToIO :: ST s a -> IO a
+ Control.Monad.ST.Unsafe.Compat: unsafeSTToIO :: () => ST s a -> IO a
- Data.Bool.Compat: bool :: a -> a -> Bool -> a
+ Data.Bool.Compat: bool :: () => a -> a -> Bool -> a
- Data.Either.Compat: fromLeft :: a -> Either a b -> a
+ Data.Either.Compat: fromLeft :: () => a -> Either a b -> a
- Data.Either.Compat: fromRight :: b -> Either a b -> b
+ Data.Either.Compat: fromRight :: () => b -> Either a b -> b
- Data.Either.Compat: isLeft :: Either a b -> Bool
+ Data.Either.Compat: isLeft :: () => Either a b -> Bool
- Data.Either.Compat: isRight :: Either a b -> Bool
+ Data.Either.Compat: isRight :: () => Either a b -> Bool
- Data.Function.Compat: (&) :: a -> (a -> b) -> b
+ Data.Function.Compat: (&) :: () => a -> (a -> b) -> b
- Data.IORef.Compat: atomicModifyIORef' :: IORef a -> (a -> (a, b)) -> IO b
+ Data.IORef.Compat: atomicModifyIORef' :: () => IORef a -> (a -> (a, b)) -> IO b
- Data.IORef.Compat: atomicWriteIORef :: IORef a -> a -> IO ()
+ Data.IORef.Compat: atomicWriteIORef :: () => IORef a -> a -> IO ()
- Data.IORef.Compat: modifyIORef' :: IORef a -> (a -> a) -> IO ()
+ Data.IORef.Compat: modifyIORef' :: () => IORef a -> (a -> a) -> IO ()
- Data.Proxy.Compat: asProxyTypeOf :: a -> proxy a -> a
+ Data.Proxy.Compat: asProxyTypeOf :: () => a -> proxy a -> a
- Data.STRef.Compat: modifySTRef' :: STRef s a -> (a -> a) -> ST s ()
+ Data.STRef.Compat: modifySTRef' :: () => STRef s a -> (a -> a) -> ST s ()
- Data.Type.Coercion.Compat: gcoerceWith :: Coercion a b -> (Coercible a b => r) -> r
+ Data.Type.Coercion.Compat: gcoerceWith :: () => Coercion k0 a b -> (Coercible k0 a b -> r) -> r
- Foreign.ForeignPtr.Compat: plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b
+ Foreign.ForeignPtr.Compat: plusForeignPtr :: () => ForeignPtr a -> Int -> ForeignPtr b
- Foreign.ForeignPtr.Safe.Compat: addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()
+ Foreign.ForeignPtr.Safe.Compat: addForeignPtrFinalizer :: () => FinalizerPtr a -> ForeignPtr a -> IO ()
- Foreign.ForeignPtr.Safe.Compat: addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
+ Foreign.ForeignPtr.Safe.Compat: addForeignPtrFinalizerEnv :: () => FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
- Foreign.ForeignPtr.Safe.Compat: castForeignPtr :: ForeignPtr a -> ForeignPtr b
+ Foreign.ForeignPtr.Safe.Compat: castForeignPtr :: () => ForeignPtr a -> ForeignPtr b
- Foreign.ForeignPtr.Safe.Compat: finalizeForeignPtr :: ForeignPtr a -> IO ()
+ Foreign.ForeignPtr.Safe.Compat: finalizeForeignPtr :: () => ForeignPtr a -> IO ()
- Foreign.ForeignPtr.Safe.Compat: mallocForeignPtr :: Storable a => IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: mallocForeignPtr :: Storable a => IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrArray :: Storable a => Int -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrArray0 :: Storable a => Int -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: mallocForeignPtrBytes :: () => Int -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: newForeignPtr :: () => FinalizerPtr a -> Ptr a -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: newForeignPtrEnv :: () => FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)
+ Foreign.ForeignPtr.Safe.Compat: newForeignPtr_ :: () => Ptr a -> IO ForeignPtr a
- Foreign.ForeignPtr.Safe.Compat: touchForeignPtr :: ForeignPtr a -> IO ()
+ Foreign.ForeignPtr.Safe.Compat: touchForeignPtr :: () => ForeignPtr a -> IO ()
- Foreign.ForeignPtr.Safe.Compat: withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
+ Foreign.ForeignPtr.Safe.Compat: withForeignPtr :: () => ForeignPtr a -> (Ptr a -> IO b) -> IO b
- Foreign.ForeignPtr.Unsafe.Compat: unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a
+ Foreign.ForeignPtr.Unsafe.Compat: unsafeForeignPtrToPtr :: () => ForeignPtr a -> Ptr a
- Foreign.Marshal.Alloc.Compat: calloc :: Storable a => IO (Ptr a)
+ Foreign.Marshal.Alloc.Compat: calloc :: Storable a => IO Ptr a
- Foreign.Marshal.Alloc.Compat: callocBytes :: Int -> IO (Ptr a)
+ Foreign.Marshal.Alloc.Compat: callocBytes :: () => Int -> IO Ptr a
- Foreign.Marshal.Array.Compat: callocArray :: Storable a => Int -> IO (Ptr a)
+ Foreign.Marshal.Array.Compat: callocArray :: Storable a => Int -> IO Ptr a
- Foreign.Marshal.Array.Compat: callocArray0 :: Storable a => Int -> IO (Ptr a)
+ Foreign.Marshal.Array.Compat: callocArray0 :: Storable a => Int -> IO Ptr a
- Foreign.Marshal.Unsafe.Compat: unsafeLocalState :: IO a -> a
+ Foreign.Marshal.Unsafe.Compat: unsafeLocalState :: () => IO a -> a
- Foreign.Marshal.Utils.Compat: fillBytes :: Ptr a -> Word8 -> Int -> IO ()
+ Foreign.Marshal.Utils.Compat: fillBytes :: () => Ptr a -> Word8 -> Int -> IO ()
- System.Environment.Compat: lookupEnv :: String -> IO (Maybe String)
+ System.Environment.Compat: lookupEnv :: String -> IO Maybe String
- System.Environment.Compat: withArgs :: [String] -> IO a -> IO a
+ System.Environment.Compat: withArgs :: () => [String] -> IO a -> IO a
- System.Environment.Compat: withProgName :: String -> IO a -> IO a
+ System.Environment.Compat: withProgName :: () => String -> IO a -> IO a
- System.Exit.Compat: die :: String -> IO a
+ System.Exit.Compat: die :: () => String -> IO a
- System.IO.Unsafe.Compat: unsafeDupablePerformIO :: IO a -> a
+ System.IO.Unsafe.Compat: unsafeDupablePerformIO :: () => IO a -> a
- System.IO.Unsafe.Compat: unsafeFixIO :: (a -> IO a) -> IO a
+ System.IO.Unsafe.Compat: unsafeFixIO :: () => (a -> IO a) -> IO a
- Text.Read.Compat: parens :: ReadPrec a -> ReadPrec a
+ Text.Read.Compat: parens :: () => ReadPrec a -> ReadPrec a
- Text.Read.Compat: readParen :: Bool -> ReadS a -> ReadS a
+ Text.Read.Compat: readParen :: () => Bool -> ReadS a -> ReadS a
Files
- CHANGES.markdown +34/−0
- LICENSE +1/−1
- README.markdown +70/−24
- base-compat.cabal +88/−42
- src/Control/Concurrent/Compat/Repl.hs +8/−0
- src/Control/Concurrent/MVar/Compat/Repl.hs +8/−0
- src/Control/Monad/Compat/Repl.hs +8/−0
- src/Control/Monad/Fail/Compat.hs +10/−0
- src/Control/Monad/Fail/Compat/Repl.hs +8/−0
- src/Control/Monad/IO/Class/Compat.hs +10/−0
- src/Control/Monad/IO/Class/Compat/Repl.hs +8/−0
- src/Control/Monad/ST/Lazy/Unsafe/Compat/Repl.hs +8/−0
- src/Control/Monad/ST/Unsafe/Compat/Repl.hs +8/−0
- src/Data/Bifoldable/Compat.hs +10/−0
- src/Data/Bifoldable/Compat/Repl.hs +8/−0
- src/Data/Bifunctor/Compat.hs +10/−0
- src/Data/Bifunctor/Compat/Repl.hs +8/−0
- src/Data/Bitraversable/Compat.hs +10/−0
- src/Data/Bitraversable/Compat/Repl.hs +8/−0
- src/Data/Bits/Compat/Repl.hs +8/−0
- src/Data/Bool/Compat/Repl.hs +8/−0
- src/Data/Complex/Compat/Repl.hs +8/−0
- src/Data/Either/Compat/Repl.hs +8/−0
- src/Data/Foldable/Compat/Repl.hs +8/−0
- src/Data/Function/Compat/Repl.hs +8/−0
- src/Data/Functor/Compat.hs +29/−0
- src/Data/Functor/Compat/Repl.hs +8/−0
- src/Data/Functor/Compose/Compat.hs +10/−0
- src/Data/Functor/Compose/Compat/Repl.hs +8/−0
- src/Data/Functor/Const/Compat/Repl.hs +8/−0
- src/Data/Functor/Identity/Compat.hs +10/−0
- src/Data/Functor/Identity/Compat/Repl.hs +8/−0
- src/Data/Functor/Product/Compat.hs +10/−0
- src/Data/Functor/Product/Compat/Repl.hs +8/−0
- src/Data/Functor/Sum/Compat.hs +10/−0
- src/Data/Functor/Sum/Compat/Repl.hs +8/−0
- src/Data/IORef/Compat/Repl.hs +8/−0
- src/Data/List/Compat.hs +33/−1
- src/Data/List/Compat/Repl.hs +8/−0
- src/Data/Monoid/Compat/Repl.hs +8/−0
- src/Data/Proxy/Compat/Repl.hs +8/−0
- src/Data/Ratio/Compat/Repl.hs +8/−0
- src/Data/STRef/Compat/Repl.hs +8/−0
- src/Data/Semigroup/Compat.hs +39/−0
- src/Data/Semigroup/Compat/Repl.hs +8/−0
- src/Data/String/Compat/Repl.hs +8/−0
- src/Data/Type/Coercion/Compat/Repl.hs +8/−0
- src/Data/Version/Compat/Repl.hs +8/−0
- src/Data/Void/Compat.hs +10/−0
- src/Data/Void/Compat/Repl.hs +8/−0
- src/Data/Word/Compat/Repl.hs +8/−0
- src/Debug/Trace/Compat/Repl.hs +8/−0
- src/Foreign/Compat/Repl.hs +8/−0
- src/Foreign/ForeignPtr/Compat/Repl.hs +8/−0
- src/Foreign/ForeignPtr/Safe/Compat/Repl.hs +8/−0
- src/Foreign/ForeignPtr/Unsafe/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Alloc/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Array/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Safe/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Unsafe/Compat/Repl.hs +8/−0
- src/Foreign/Marshal/Utils/Compat/Repl.hs +8/−0
- src/Numeric/Compat.hs +54/−0
- src/Numeric/Compat/Repl.hs +8/−0
- src/Numeric/Natural/Compat.hs +10/−0
- src/Numeric/Natural/Compat/Repl.hs +8/−0
- src/Prelude/Compat.hs +11/−1
- src/Prelude/Compat/Repl.hs +8/−0
- src/System/Environment/Compat/Repl.hs +8/−0
- src/System/Exit/Compat/Repl.hs +8/−0
- src/System/IO/Unsafe/Compat/Repl.hs +8/−0
- src/Text/Read/Compat/Repl.hs +8/−0
- src/Type/Reflection/Compat.hs +34/−0
- src/Type/Reflection/Compat/Repl.hs +8/−0
- test/Control/Monad/CompatSpec.hs +0/−16
- test/Data/Bits/CompatSpec.hs +0/−34
- test/Data/Bool/CompatSpec.hs +0/−18
- test/Data/Either/CompatSpec.hs +0/−25
- test/Data/Foldable/CompatSpec.hs +0/−13
- test/Data/Function/CompatSpec.hs +0/−13
- test/Data/Functor/CompatSpec.hs +0/−17
- test/Data/IORef/CompatSpec.hs +0/−22
- test/Data/List/CompatSpec.hs +0/−43
- test/Data/Monoid/CompatSpec.hs +0/−16
- test/Data/STRef/CompatSpec.hs +0/−19
- test/Data/Version/CompatSpec.hs +0/−10
- test/Data/Word/CompatSpec.hs +0/−22
- test/Foreign/Marshal/Alloc/CompatSpec.hs +0/−17
- test/Foreign/Marshal/Utils/CompatSpec.hs +0/−20
- test/Numeric/CompatSpec.hs +0/−24
- test/Spec.hs +0/−1
- test/System/Environment/CompatSpec.hs +0/−120
- test/Text/Read/CompatSpec.hs +0/−24
CHANGES.markdown view
@@ -1,3 +1,37 @@+## Changes in 0.10.0 [2018.04.05]+ - Sync with `base-4.11`/GHC 8.4+ - Backport `Semigroup((<>))` to `Prelude.Compat`.++ Note that the `Semigroup` class has only been in `base` since+ `base-4.9`/GHC 8.0, so accordingly, this can only be backported back+ to GHC 8.0. If you wish to have a version of `Prelude.Compat` that backports+ `Semigroup` to older GHCs (by conditionally depending on the `semigroups`+ library), use the `Prelude.Compat` module from the `base-compat-batteries`+ package.+ - Backport `(<&>)` to `Data.Functor.Compat`+ - Backport `iterate'` to `Data.List.Compat`+ - Backport `showHFloat` to `Numeric.Compat`+ - Backport a `RuntimeRep`-polymorphic `withTypeable` function to+ `Type.Reflection.Compat`. (This is only exported on `base-4.10`/GHC 8.2.)+ - Introduce the following modules, back until the oldest version of `base`+ that can support backporting them. If you wish to use them in conjunction+ with older versions of `base`, use the `base-compat-batteries` package.+ - `Control.Monad.Fail.Compat` (back until `base-4.9`/GHC 8.0)+ - `Control.Monad.IO.Class.Compat` (back until `base-4.9`/GHC 8.0)+ - `Data.Bifunctor` (back until `base-4.8`/GHC 7.10)+ - `Data.Bifoldable` and `Data.Bitraversable` (back until `base-4.10`/GHC 8.2)+ - `Data.Functor.Compose.Compat`, `Data.Functor.Product.Compat`, and+ `Data.Functor.Sum.Compat` (back until `base-4.9`/GHC 8.0)+ - `Data.Functor.Identity.Compat` (back until `base-4.8`/GHC 7.10)+ - `Data.Semigroup.Compat` (back until `base-4.9`/GHC 8.0)+ - `Data.Void.Compat` (back until `base-4.8`/GHC 7.10)+ - `Numeric.Natural.Compat` (back until `base-4.8`/GHC 7.10)+ - Introduce versions of modules with the suffix `.Repl`. These simply reexport+ the contents of their counterparts without the `.Repl` suffix to provide+ a globally unique namespace to import from in the event one wants to import+ `base-compat` modules into GHCi. (In `base-compat-batteries`, the+ corresponding suffix is `.Repl.Batteries`.)+ ## Changes in 0.9.3 [2017.04.10] - Sync with `base-4.10`/GHC 8.2 - Backport `fromLeft`/`fromRight` to `Data.Either.Compat`
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2012-2017 Simon Hengel <sol@typeful.net> and Ryan Scott <ryan.gl.scott@gmail.com>+Copyright (c) 2012-2018 Simon Hengel <sol@typeful.net> and Ryan Scott <ryan.gl.scott@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.markdown view
@@ -3,7 +3,6 @@ [](http://packdeps.haskellers.com/reverse/base-compat) [][Haskell.org] [][tl;dr Legal: MIT]-[](https://travis-ci.org/haskell-compat/base-compat) [Hackage: base-compat]: http://hackage.haskell.org/package/base-compat@@ -34,6 +33,13 @@ [Data types and type classes](#data-types-and-type-classes) section. +`base-compat` is intentionally designed to have zero dependencies. As a+consequence, there are some modules that can only be backported up to certain+versions of `base`. If an even wider support window is desired in these+scenarios, there also exists a `base-compat-batteries` package which augments+`base-compat` with certain compatibility package dependencies. For more info,+see the [Dependencies](#dependencies) section.+ ## Basic usage In your cabal file, you should have something like this:@@ -167,13 +173,13 @@ ```haskell class Bits b => FiniteBits b where finiteBitSize :: b -> Int- countLeadingZeros :: b -> Int- countTrailingZeros :: b -> Int+ countLeadingZeros :: b -> Int -- ^ @since 4.8.0.0+ countTrailingZeros :: b -> Int -- ^ @since 4.8.0.0 ``` This raises the question: how can `FiniteBits` be backported consistently across all versions of `base`? One approach is to backport the API exposed in-`base-4.8.0.0` on versions prior to `4.7.0.0`. The problem with this is that+`base-4.8.0.0` on versions prior to `4.7.0.0`. The problem with this is that `countLeadingZeros` and `countTrailingZeros` are not exposed in `base-4.7.0.0`, so instances of `FiniteBits` would have to be declared like this: @@ -186,15 +192,65 @@ #endif ``` -This is a very unsatisfactory solution, and for this reason, we do not pursue-it. For similar reasons, we do not backport data types.+Another approach is to backport the API from `base-4.7.0.0` and to declare+additional methods outside of the class: -### Other compatibility packages+```haskell+#if MIN_VERSION_base(4,7,0) && !(MIN_VERSION_base(4,8,0))+countLeadingZeros :: FiniteBits b => b -> Int+countLeadingZeros = {- default implementation #-}+#endif+``` -If you _really_ need your favorite data type or type class in `base` to be-backported, you might be in luck, since several data types have their own-compatibility packages on Hackage. Here is a list of such packages:+The situation is only slightly better for classes which exist across all versions of `base`,+but have grown their API. For example, it's tempting to define +```haskell+#if !(MIN_VERSION_base(4,8,0))+displayException :: Exception e => e -> String+displayException = show+#endif+```++As with the previous approach, you won't be able to define new members of the type+class without CPP guards. In other words, the non-CPP approach would limit+uses to the lowest common denominator.++As neither approach is a very satisfactory solution, and to embrace+consistency, we do not pursue either approach. For similar reasons, we do not+backport data types.++### Dependencies++`base-compat` is designed to have zero dependencies (besides libraries that+ship with GHC itself). A consequence of this choice is that there are certain+modules that have a "limited" support window. An important example of this is+`Prelude.Compat`, which backports the `Semigroup` class to versions of `base`+older than 4.11 (when it was added to the `Prelude`). Because `Semigroup` was+not added to `base` until `base-4.9`, `base-compat` cannot backport it to+any earlier version of `base` than this.++If you would instead desire to be able to use a version of `Prelude.Compat`+that _does_ backport `Semigroup` to even older versions of `base`, even if it+means pulling in other dependencies, then you are in luck. There also exists+a `base-compat-batteries` package, which exposes a strict superset of the API+in `base-compat`. `base-compat-batteries` has all the same modules as+`base-compat`, but exposes more functionality on more versions of `base` by+reexporting things from compatibility libraries whenever necessary. (For+instance, `base-compat-batteries` exports the `Semigroup` class from the+`semigroups` library when built against versions of `base` older than 4.9.)++Because `base-compat` and `base-compat-batteries` have the same module names,+they are quite easy to switch out for one another in library projects, at the+expense of having clashing names if one tries to import them in GHCi. To+work around this issue, `base-compat` and `base-compat-batteries` also provide+copies of each module with the suffix `.Repl` (for `base-compat`) and+`.Repl.Batteries` (for `base-compat-batteries`) to give them globally unique+namespaces in the event one wants to import them into GHCi.++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) for: * The [`Bifunctor`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Bifunctor.html#t:Bifunctor)@@ -205,9 +261,6 @@ * [`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`-* [`generic-deriving`](http://hackage.haskell.org/package/generic-deriving)- for everything in the [`GHC.Generics`](http://hackage.haskell.org/package/base-4.8.0.0/docs/GHC-Generics.html)- module, introduced to `ghc-prim` in GHC 7.2 (and later moved to `base-4.6.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`@@ -231,17 +284,8 @@ for: * The [`Identity`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Functor-Identity.html#t:Identity) data type, introduced in `base-4.8.0.0`- * The [`MonadIO`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-IO-Class.html#t:MonadIO),- [`Eq1`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Eq1),- [`Eq2`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Eq2),- [`Ord1`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Ord1),- [`Ord2`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Ord2),- [`Read1`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Read1),- [`Read2`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Read2),- [`Show1`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Show1),- and- [`Show2`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Classes.html#t:Show2)- typeclasses; and the+ * The [`MonadIO`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-IO-Class.html#t:MonadIO)+ type class; and the [`Compose`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Compose.html#t:Compose), [`Product`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Functor-Product.html#t:Product), and@@ -253,6 +297,8 @@ ## Supported versions of GHC/`base` + * `ghc-8.4.1` / `base-4.11.0.0`+ * `ghc-8.2.2` / `base-4.10.1.0` * `ghc-8.2.1` / `base-4.10.0.0` * `ghc-8.0.2` / `base-4.9.1.0` * `ghc-8.0.1` / `base-4.9.0.0`
base-compat.cabal view
@@ -1,10 +1,10 @@ name: base-compat-version: 0.9.3+version: 0.10.0 license: MIT license-file: LICENSE-copyright: (c) 2012-2017 Simon Hengel,- (c) 2014-2017 João Cristóvão,- (c) 2015-2017 Ryan Scott+copyright: (c) 2012-2018 Simon Hengel,+ (c) 2014-2018 João Cristóvão,+ (c) 2015-2018 Ryan Scott author: Simon Hengel <sol@typeful.net>, João Cristóvão <jmacristovao@gmail.com>, Ryan Scott <ryan.gl.scott@gmail.com>@@ -18,9 +18,9 @@ description: Provides functions available in later versions of @base@ to a wider range of compilers, without requiring you to use CPP pragmas in your code. See the- <https://github.com/haskell-compat/base-compat#readme README>+ <https://github.com/haskell-compat/base-compat/blob/master/base-compat/README.markdown README> for what is covered. Also see the- <https://github.com/haskell-compat/base-compat/blob/master/CHANGES.markdown changelog>+ <https://github.com/haskell-compat/base-compat/blob/master/base-compat/CHANGES.markdown changelog> for recent changes. . Note that @base-compat@ does not add any orphan instances.@@ -28,10 +28,21 @@ @<http://hackage.haskell.org/package/base-orphans base-orphans>@, for that. .- In addition, `base-compat` does not backport any data types+ In addition, @base-compat@ does not backport any data types or type classes. See- @<https://github.com/haskell-compat/base-compat#data-types-and-type-classes this section of the README>@+ @<https://github.com/haskell-compat/base-compat/blob/master/base-compat/README.markdown#data-types-and-type-classes this section of the README>@ for more info.+ .+ @base-compat@ is designed to have zero dependencies. For a+ version of @base-compat@ that depends on compatibility+ libraries for a wider support window, see the+ @<http://hackage.haskell.org/package/base-compat-batteries base-compat-batteries>@+ package. Most of the modules in this library have the same+ names as in @base-compat-batteries@ to make it easier to+ switch between the two. There also exist versions of each+ module with the suffix @.Repl@, which are distinct from+ anything in @base-compat-batteries@, to allow for easier+ use in GHCi. tested-with: GHC == 7.0.1, GHC == 7.0.2, GHC == 7.0.3, GHC == 7.0.4 , GHC == 7.2.1, GHC == 7.2.2 , GHC == 7.4.1, GHC == 7.4.2@@ -39,12 +50,14 @@ , GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4 , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3 , GHC == 8.0.1, GHC == 8.0.2- , GHC == 8.2.1+ , GHC == 8.2.1, GHC == 8.2.2+ , GHC == 8.4.1 extra-source-files: CHANGES.markdown, README.markdown source-repository head type: git location: https://github.com/haskell-compat/base-compat+ subdir: base-compat library ghc-options:@@ -63,8 +76,13 @@ Control.Concurrent.Compat Control.Concurrent.MVar.Compat Control.Monad.Compat+ Control.Monad.Fail.Compat+ Control.Monad.IO.Class.Compat Control.Monad.ST.Lazy.Unsafe.Compat Control.Monad.ST.Unsafe.Compat+ Data.Bifoldable.Compat+ Data.Bifunctor.Compat+ Data.Bitraversable.Compat Data.Bits.Compat Data.Bool.Compat Data.Complex.Compat@@ -72,16 +90,22 @@ Data.Foldable.Compat Data.Function.Compat Data.Functor.Compat+ Data.Functor.Compose.Compat Data.Functor.Const.Compat+ Data.Functor.Identity.Compat+ Data.Functor.Product.Compat+ Data.Functor.Sum.Compat Data.IORef.Compat Data.List.Compat Data.Monoid.Compat Data.Proxy.Compat Data.Ratio.Compat+ Data.Semigroup.Compat Data.STRef.Compat Data.String.Compat Data.Type.Coercion.Compat Data.Version.Compat+ Data.Void.Compat Data.Word.Compat Debug.Trace.Compat Foreign.Compat@@ -95,42 +119,64 @@ Foreign.Marshal.Unsafe.Compat Foreign.Marshal.Utils.Compat Numeric.Compat+ Numeric.Natural.Compat Prelude.Compat System.Environment.Compat System.Exit.Compat System.IO.Unsafe.Compat Text.Read.Compat+ Type.Reflection.Compat -test-suite spec- type:- exitcode-stdio-1.0- ghc-options:- -Wall- hs-source-dirs:- test- main-is:- Spec.hs- other-modules:- Control.Monad.CompatSpec- Data.Bits.CompatSpec- Data.Bool.CompatSpec- Data.Either.CompatSpec- Data.Foldable.CompatSpec- Data.Function.CompatSpec- Data.Functor.CompatSpec- Data.IORef.CompatSpec- Data.List.CompatSpec- Data.Monoid.CompatSpec- Data.STRef.CompatSpec- Data.Version.CompatSpec- Data.Word.CompatSpec- Foreign.Marshal.Alloc.CompatSpec- Foreign.Marshal.Utils.CompatSpec- Numeric.CompatSpec- System.Environment.CompatSpec- Text.Read.CompatSpec- build-depends:- base >= 4.3 && < 5- , base-compat- , hspec >= 1.8- , QuickCheck+ Control.Concurrent.Compat.Repl+ Control.Concurrent.MVar.Compat.Repl+ Control.Monad.Compat.Repl+ Control.Monad.Fail.Compat.Repl+ Control.Monad.IO.Class.Compat.Repl+ Control.Monad.ST.Lazy.Unsafe.Compat.Repl+ Control.Monad.ST.Unsafe.Compat.Repl+ Data.Bifoldable.Compat.Repl+ Data.Bifunctor.Compat.Repl+ Data.Bitraversable.Compat.Repl+ Data.Bits.Compat.Repl+ Data.Bool.Compat.Repl+ Data.Complex.Compat.Repl+ Data.Either.Compat.Repl+ Data.Foldable.Compat.Repl+ Data.Function.Compat.Repl+ Data.Functor.Compat.Repl+ Data.Functor.Compose.Compat.Repl+ Data.Functor.Const.Compat.Repl+ Data.Functor.Identity.Compat.Repl+ Data.Functor.Product.Compat.Repl+ Data.Functor.Sum.Compat.Repl+ Data.IORef.Compat.Repl+ Data.List.Compat.Repl+ Data.Monoid.Compat.Repl+ Data.Proxy.Compat.Repl+ Data.Ratio.Compat.Repl+ Data.Semigroup.Compat.Repl+ Data.STRef.Compat.Repl+ Data.String.Compat.Repl+ Data.Type.Coercion.Compat.Repl+ Data.Version.Compat.Repl+ Data.Void.Compat.Repl+ Data.Word.Compat.Repl+ Debug.Trace.Compat.Repl+ Foreign.Compat.Repl+ Foreign.ForeignPtr.Compat.Repl+ Foreign.ForeignPtr.Safe.Compat.Repl+ Foreign.ForeignPtr.Unsafe.Compat.Repl+ Foreign.Marshal.Alloc.Compat.Repl+ Foreign.Marshal.Array.Compat.Repl+ Foreign.Marshal.Compat.Repl+ Foreign.Marshal.Safe.Compat.Repl+ Foreign.Marshal.Unsafe.Compat.Repl+ Foreign.Marshal.Utils.Compat.Repl+ Numeric.Compat.Repl+ Numeric.Natural.Compat.Repl+ Prelude.Compat.Repl+ System.Environment.Compat.Repl+ System.Exit.Compat.Repl+ System.IO.Unsafe.Compat.Repl+ Text.Read.Compat.Repl+ Type.Reflection.Compat.Repl
+ src/Control/Concurrent/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Concurrent.Compat"+-- from a globally unique namespace.+module Control.Concurrent.Compat.Repl (+ module Control.Concurrent.Compat+) where+import "this" Control.Concurrent.Compat
+ src/Control/Concurrent/MVar/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Concurrent.MVar.Compat"+-- from a globally unique namespace.+module Control.Concurrent.MVar.Compat.Repl (+ module Control.Concurrent.MVar.Compat+) where+import "this" Control.Concurrent.MVar.Compat
+ src/Control/Monad/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Monad.Compat"+-- from a globally unique namespace.+module Control.Monad.Compat.Repl (+ module Control.Monad.Compat+) where+import "this" Control.Monad.Compat
+ src/Control/Monad/Fail/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Control.Monad.Fail.Compat (+#if MIN_VERSION_base(4,9,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,9,0)+import Control.Monad.Fail as Base+#endif
+ src/Control/Monad/Fail/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Monad.Fail.Compat"+-- from a globally unique namespace.+module Control.Monad.Fail.Compat.Repl (+ module Control.Monad.Fail.Compat+) where+import "this" Control.Monad.Fail.Compat
+ src/Control/Monad/IO/Class/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Control.Monad.IO.Class.Compat (+#if MIN_VERSION_base(4,9,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,9,0)+import Control.Monad.IO.Class as Base+#endif
+ src/Control/Monad/IO/Class/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Monad.IO.Class.Compat"+-- from a globally unique namespace.+module Control.Monad.IO.Class.Compat.Repl (+ module Control.Monad.IO.Class.Compat+) where+import "this" Control.Monad.IO.Class.Compat
+ src/Control/Monad/ST/Lazy/Unsafe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Monad.ST.Lazy.Unsafe.Compat"+-- from a globally unique namespace.+module Control.Monad.ST.Lazy.Unsafe.Compat.Repl (+ module Control.Monad.ST.Lazy.Unsafe.Compat+) where+import "this" Control.Monad.ST.Lazy.Unsafe.Compat
+ src/Control/Monad/ST/Unsafe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Control.Monad.ST.Unsafe.Compat"+-- from a globally unique namespace.+module Control.Monad.ST.Unsafe.Compat.Repl (+ module Control.Monad.ST.Unsafe.Compat+) where+import "this" Control.Monad.ST.Unsafe.Compat
+ src/Data/Bifoldable/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Bifoldable.Compat (+#if MIN_VERSION_base(4,10,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,10,0)+import Data.Bifoldable as Base+#endif
+ src/Data/Bifoldable/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bifoldable.Compat"+-- from a globally unique namespace.+module Data.Bifoldable.Compat.Repl (+ module Data.Bifoldable.Compat+) where+import "this" Data.Bifoldable.Compat
+ src/Data/Bifunctor/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Bifunctor.Compat (+#if MIN_VERSION_base(4,8,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,8,0)+import Data.Bifunctor as Base+#endif
+ src/Data/Bifunctor/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bifunctor.Compat"+-- from a globally unique namespace.+module Data.Bifunctor.Compat.Repl (+ module Data.Bifunctor.Compat+) where+import "this" Data.Bifunctor.Compat
+ src/Data/Bitraversable/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Bitraversable.Compat (+#if MIN_VERSION_base(4,10,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,10,0)+import Data.Bitraversable as Base+#endif
+ src/Data/Bitraversable/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bitraversable.Compat"+-- from a globally unique namespace.+module Data.Bitraversable.Compat.Repl (+ module Data.Bitraversable.Compat+) where+import "this" Data.Bitraversable.Compat
+ src/Data/Bits/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bits.Compat"+-- from a globally unique namespace.+module Data.Bits.Compat.Repl (+ module Data.Bits.Compat+) where+import "this" Data.Bits.Compat
+ src/Data/Bool/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Bool.Compat"+-- from a globally unique namespace.+module Data.Bool.Compat.Repl (+ module Data.Bool.Compat+) where+import "this" Data.Bool.Compat
+ src/Data/Complex/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Complex.Compat"+-- from a globally unique namespace.+module Data.Complex.Compat.Repl (+ module Data.Complex.Compat+) where+import "this" Data.Complex.Compat
+ src/Data/Either/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Either.Compat"+-- from a globally unique namespace.+module Data.Either.Compat.Repl (+ module Data.Either.Compat+) where+import "this" Data.Either.Compat
+ src/Data/Foldable/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Foldable.Compat"+-- from a globally unique namespace.+module Data.Foldable.Compat.Repl (+ module Data.Foldable.Compat+) where+import "this" Data.Foldable.Compat
+ src/Data/Function/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Function.Compat"+-- from a globally unique namespace.+module Data.Function.Compat.Repl (+ module Data.Function.Compat+) where+import "this" Data.Function.Compat
src/Data/Functor/Compat.hs view
@@ -4,13 +4,16 @@ , Functor(..) , ($>) , void+, (<&>) ) where import Data.Functor as Base #if !(MIN_VERSION_base(4,7,0)) import Control.Monad.Compat (void) import Data.Function (flip)+#endif +#if !(MIN_VERSION_base(4,7,0)) infixl 4 $> -- | Flipped version of '$>'.@@ -18,5 +21,31 @@ -- /Since: 4.7.0.0/ ($>) :: Functor f => f a -> b -> f b ($>) = flip (<$)+#endif +#if !(MIN_VERSION_base(4,11,0))+-- | Flipped version of '<$>'.+--+-- @+-- ('<&>') = 'flip' 'fmap'+-- @+--+-- /Since: 4.11.0.0/+--+-- ==== __Examples__+-- Apply @(+1)@ to a list, a 'Data.Maybe.Just' and a 'Data.Either.Right':+--+-- >>> Just 2 <&> (+1)+-- Just 3+--+-- >>> [1,2,3] <&> (+1)+-- [2,3,4]+--+-- >>> Right 3 <&> (+1)+-- Right 4+--+(<&>) :: Functor f => f a -> (a -> b) -> f b+as <&> f = f <$> as++infixl 1 <&> #endif
+ src/Data/Functor/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Compat"+-- from a globally unique namespace.+module Data.Functor.Compat.Repl (+ module Data.Functor.Compat+) where+import "this" Data.Functor.Compat
+ src/Data/Functor/Compose/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Functor.Compose.Compat (+#if MIN_VERSION_base(4,9,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,9,0)+import Data.Functor.Compose as Base+#endif
+ src/Data/Functor/Compose/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Compose.Compat"+-- from a globally unique namespace.+module Data.Functor.Compose.Compat.Repl (+ module Data.Functor.Compose.Compat+) where+import "this" Data.Functor.Compose.Compat
+ src/Data/Functor/Const/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Const.Compat"+-- from a globally unique namespace.+module Data.Functor.Const.Compat.Repl (+ module Data.Functor.Const.Compat+) where+import "this" Data.Functor.Const.Compat
+ src/Data/Functor/Identity/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Functor.Identity.Compat (+#if MIN_VERSION_base(4,8,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,8,0)+import Data.Functor.Identity as Base+#endif
+ src/Data/Functor/Identity/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Identity.Compat"+-- from a globally unique namespace.+module Data.Functor.Identity.Compat.Repl (+ module Data.Functor.Identity.Compat+) where+import "this" Data.Functor.Identity.Compat
+ src/Data/Functor/Product/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Functor.Product.Compat (+#if MIN_VERSION_base(4,9,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,9,0)+import Data.Functor.Product as Base+#endif
+ src/Data/Functor/Product/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Product.Compat"+-- from a globally unique namespace.+module Data.Functor.Product.Compat.Repl (+ module Data.Functor.Product.Compat+) where+import "this" Data.Functor.Product.Compat
+ src/Data/Functor/Sum/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Functor.Sum.Compat (+#if MIN_VERSION_base(4,9,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,9,0)+import Data.Functor.Sum as Base+#endif
+ src/Data/Functor/Sum/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Functor.Sum.Compat"+-- from a globally unique namespace.+module Data.Functor.Sum.Compat.Repl (+ module Data.Functor.Sum.Compat+) where+import "this" Data.Functor.Sum.Compat
+ src/Data/IORef/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.IORef.Compat"+-- from a globally unique namespace.+module Data.IORef.Compat.Repl (+ module Data.IORef.Compat+) where+import "this" Data.IORef.Compat
src/Data/List/Compat.hs view
@@ -2,6 +2,10 @@ {-# LANGUAGE BangPatterns #-} module Data.List.Compat ( module Base+#if !(MIN_VERSION_base(4,11,0))+, iterate'+#endif+ #if !(MIN_VERSION_base(4,8,0)) , all , and@@ -78,10 +82,14 @@ ) import Data.Foldable.Compat import Data.Traversable-import Prelude.Compat hiding (foldr, null) import Data.Ord (comparing) #endif +#if !(MIN_VERSION_base(4,11,0))+import GHC.Exts (build)+import Prelude.Compat hiding (foldr, null)+#endif+ #if !(MIN_VERSION_base(4,5,0)) -- | The 'dropWhileEnd' function drops the largest suffix of a list -- in which the given predicate holds for all elements. For example:@@ -199,4 +207,28 @@ -- | The 'unionBy' function is the non-overloaded version of 'union'. unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs+#endif++#if !(MIN_VERSION_base(4,11,0))+-- | 'iterate\'' is the strict version of 'iterate'.+--+-- It ensures that the result of each application of force to weak head normal+-- form before proceeding.+{-# NOINLINE [1] iterate' #-}+iterate' :: (a -> a) -> a -> [a]+iterate' f x =+ let x' = f x+ in x' `seq` (x : iterate' f x')++{-# INLINE [0] iterate'FB #-} -- See Note [Inline FB functions]+iterate'FB :: (a -> b -> b) -> (a -> a) -> a -> b+iterate'FB c f x0 = go x0+ where go x =+ let x' = f x+ in x' `seq` (x `c` go x')++{-# RULES+"iterate'" [~1] forall f x. iterate' f x = build (\c _n -> iterate'FB c f x)+"iterate'FB" [1] iterate'FB (:) = iterate'+ #-} #endif
+ src/Data/List/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.List.Compat"+-- from a globally unique namespace.+module Data.List.Compat.Repl (+ module Data.List.Compat+) where+import "this" Data.List.Compat
+ src/Data/Monoid/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Monoid.Compat"+-- from a globally unique namespace.+module Data.Monoid.Compat.Repl (+ module Data.Monoid.Compat+) where+import "this" Data.Monoid.Compat
+ src/Data/Proxy/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Proxy.Compat"+-- from a globally unique namespace.+module Data.Proxy.Compat.Repl (+ module Data.Proxy.Compat+) where+import "this" Data.Proxy.Compat
+ src/Data/Ratio/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Ratio.Compat"+-- from a globally unique namespace.+module Data.Ratio.Compat.Repl (+ module Data.Ratio.Compat+) where+import "this" Data.Ratio.Compat
+ src/Data/STRef/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.STRef.Compat"+-- from a globally unique namespace.+module Data.STRef.Compat.Repl (+ module Data.STRef.Compat+) where+import "this" Data.STRef.Compat
+ src/Data/Semigroup/Compat.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+-- | This backports the modern "Data.Semigroup" interface back to+-- @base-4.9@/GHC 8.0.+module Data.Semigroup.Compat (+#if MIN_VERSION_base(4,9,0)+ Semigroup(..)+ , stimesMonoid+ , stimesIdempotent+ , stimesIdempotentMonoid+ , mtimesDefault+ -- * Semigroups+ , Min(..)+ , Max(..)+ , First(..)+ , Last(..)+ , WrappedMonoid(..)+ -- * Re-exported monoids from Data.Monoid+ , Dual(..)+ , Endo(..)+ , All(..)+ , Any(..)+ , Sum(..)+ , Product(..)+ -- * A better monoid for Maybe+ , Option(..)+ , option+ -- * Difference lists of a semigroup+ , diff+ , cycle1+ -- * ArgMin, ArgMax+ , Arg(..)+ , ArgMin+ , ArgMax+#endif+ ) where++#if MIN_VERSION_base(4,9,0)+import Data.Semigroup+#endif
+ src/Data/Semigroup/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Semigroup.Compat"+-- from a globally unique namespace.+module Data.Semigroup.Compat.Repl (+ module Data.Semigroup.Compat+) where+import "this" Data.Semigroup.Compat
+ src/Data/String/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.String.Compat"+-- from a globally unique namespace.+module Data.String.Compat.Repl (+ module Data.String.Compat+) where+import "this" Data.String.Compat
+ src/Data/Type/Coercion/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Type.Coercion.Compat"+-- from a globally unique namespace.+module Data.Type.Coercion.Compat.Repl (+ module Data.Type.Coercion.Compat+) where+import "this" Data.Type.Coercion.Compat
+ src/Data/Version/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Version.Compat"+-- from a globally unique namespace.+module Data.Version.Compat.Repl (+ module Data.Version.Compat+) where+import "this" Data.Version.Compat
+ src/Data/Void/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Data.Void.Compat (+#if MIN_VERSION_base(4,8,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,8,0)+import Data.Void as Base+#endif
+ src/Data/Void/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Void.Compat"+-- from a globally unique namespace.+module Data.Void.Compat.Repl (+ module Data.Void.Compat+) where+import "this" Data.Void.Compat
+ src/Data/Word/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Data.Word.Compat"+-- from a globally unique namespace.+module Data.Word.Compat.Repl (+ module Data.Word.Compat+) where+import "this" Data.Word.Compat
+ src/Debug/Trace/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Debug.Trace.Compat"+-- from a globally unique namespace.+module Debug.Trace.Compat.Repl (+ module Debug.Trace.Compat+) where+import "this" Debug.Trace.Compat
+ src/Foreign/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Compat"+-- from a globally unique namespace.+module Foreign.Compat.Repl (+ module Foreign.Compat+) where+import "this" Foreign.Compat
+ src/Foreign/ForeignPtr/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.ForeignPtr.Compat"+-- from a globally unique namespace.+module Foreign.ForeignPtr.Compat.Repl (+ module Foreign.ForeignPtr.Compat+) where+import "this" Foreign.ForeignPtr.Compat
+ src/Foreign/ForeignPtr/Safe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.ForeignPtr.Safe.Compat"+-- from a globally unique namespace.+module Foreign.ForeignPtr.Safe.Compat.Repl (+ module Foreign.ForeignPtr.Safe.Compat+) where+import "this" Foreign.ForeignPtr.Safe.Compat
+ src/Foreign/ForeignPtr/Unsafe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.ForeignPtr.Unsafe.Compat"+-- from a globally unique namespace.+module Foreign.ForeignPtr.Unsafe.Compat.Repl (+ module Foreign.ForeignPtr.Unsafe.Compat+) where+import "this" Foreign.ForeignPtr.Unsafe.Compat
+ src/Foreign/Marshal/Alloc/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Alloc.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Alloc.Compat.Repl (+ module Foreign.Marshal.Alloc.Compat+) where+import "this" Foreign.Marshal.Alloc.Compat
+ src/Foreign/Marshal/Array/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Array.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Array.Compat.Repl (+ module Foreign.Marshal.Array.Compat+) where+import "this" Foreign.Marshal.Array.Compat
+ src/Foreign/Marshal/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Compat.Repl (+ module Foreign.Marshal.Compat+) where+import "this" Foreign.Marshal.Compat
+ src/Foreign/Marshal/Safe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Safe.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Safe.Compat.Repl (+ module Foreign.Marshal.Safe.Compat+) where+import "this" Foreign.Marshal.Safe.Compat
+ src/Foreign/Marshal/Unsafe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Unsafe.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Unsafe.Compat.Repl (+ module Foreign.Marshal.Unsafe.Compat+) where+import "this" Foreign.Marshal.Unsafe.Compat
+ src/Foreign/Marshal/Utils/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Foreign.Marshal.Utils.Compat"+-- from a globally unique namespace.+module Foreign.Marshal.Utils.Compat.Repl (+ module Foreign.Marshal.Utils.Compat+) where+import "this" Foreign.Marshal.Utils.Compat
src/Numeric/Compat.hs view
@@ -3,6 +3,7 @@ module Base , showFFloatAlt , showGFloatAlt+, showHFloat ) where import Numeric as Base@@ -10,8 +11,13 @@ #if !(MIN_VERSION_base(4,7,0)) import Data.Char (intToDigit) import GHC.Float+#endif++#if !(MIN_VERSION_base(4,11,0)) import Prelude+#endif +#if !(MIN_VERSION_base(4,7,0)) -- | Show a signed 'RealFloat' value -- using standard decimal notation (e.g. @245000@, @0.0015@). --@@ -96,4 +102,52 @@ d:ds' = map intToDigit (if ei > 0 then is' else 0:is') in d : (if null ds' && not alt then "" else '.':ds')+#endif++#if !(MIN_VERSION_base(4,11,0))+{- | Show a floating-point value in the hexadecimal format,+similar to the @%a@ specifier in C's printf.++ >>> showHFloat (212.21 :: Double) ""+ "0x1.a86b851eb851fp7"+ >>> showHFloat (-12.76 :: Float) ""+ "-0x1.9851ecp3"+ >>> showHFloat (-0 :: Double) ""+ "-0x0p+0"+-}+showHFloat :: RealFloat a => a -> ShowS+showHFloat = showString . fmt+ where+ fmt x+ | isNaN x = "NaN"+ | isInfinite x = (if x < 0 then "-" else "") ++ "Infinity"+ | x < 0 || isNegativeZero x = '-' : cvt (-x)+ | otherwise = cvt x++ cvt x+ | x == 0 = "0x0p+0"+ | otherwise =+ case floatToDigits 2 x of+ r@([], _) -> error $ "Impossible happened: showHFloat: " ++ show r+ (d:ds, e) -> "0x" ++ show d ++ frac ds ++ "p" ++ show (e-1)++ -- Given binary digits, convert them to hex in blocks of 4+ -- Special case: If all 0's, just drop it.+ frac digits+ | allZ digits = ""+ | otherwise = "." ++ hex digits+ where+ hex ds =+ case ds of+ [] -> ""+ [a] -> hexDigit a 0 0 0 ""+ [a,b] -> hexDigit a b 0 0 ""+ [a,b,c] -> hexDigit a b c 0 ""+ a : b : c : d : r -> hexDigit a b c d (hex r)++ hexDigit a b c d = showHex (8*a + 4*b + 2*c + d)++ allZ xs = case xs of+ x : more -> x == 0 && allZ more+ [] -> True #endif
+ src/Numeric/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Numeric.Compat"+-- from a globally unique namespace.+module Numeric.Compat.Repl (+ module Numeric.Compat+) where+import "this" Numeric.Compat
+ src/Numeric/Natural/Compat.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+module Numeric.Natural.Compat (+#if MIN_VERSION_base(4,8,0)+ module Base+#endif+) where++#if MIN_VERSION_base(4,8,0)+import Numeric.Natural as Base+#endif
+ src/Numeric/Natural/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Numeric.Natural.Compat"+-- from a globally unique namespace.+module Numeric.Natural.Compat.Repl (+ module Numeric.Natural.Compat+) where+import "this" Numeric.Natural.Compat
src/Prelude/Compat.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE CPP, NoImplicitPrelude #-} module Prelude.Compat (-#if MIN_VERSION_base(4,9,0)+#if MIN_VERSION_base(4,11,0) module Base #else either@@ -134,6 +134,9 @@ , mappend , mconcat , mempty+# if MIN_VERSION_base(4,9,0)+, (<>)+# endif , maxBound , minBound , enumFrom@@ -231,6 +234,9 @@ , Real , RealFloat , RealFrac+# if MIN_VERSION_base(4,9,0)+, Semigroup+# endif , Show , Traversable @@ -299,6 +305,10 @@ import Data.Monoid import Data.Word # endif+#endif++#if MIN_VERSION_base(4,9,0) && !(MIN_VERSION_base(4,11,0))+import Data.Semigroup as Base (Semigroup((<>))) #endif #if !(MIN_VERSION_base(4,9,0))
+ src/Prelude/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Prelude.Compat"+-- from a globally unique namespace.+module Prelude.Compat.Repl (+ module Prelude.Compat+) where+import "this" Prelude.Compat
+ src/System/Environment/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "System.Environment.Compat"+-- from a globally unique namespace.+module System.Environment.Compat.Repl (+ module System.Environment.Compat+) where+import "this" System.Environment.Compat
+ src/System/Exit/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "System.Exit.Compat"+-- from a globally unique namespace.+module System.Exit.Compat.Repl (+ module System.Exit.Compat+) where+import "this" System.Exit.Compat
+ src/System/IO/Unsafe/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "System.IO.Unsafe.Compat"+-- from a globally unique namespace.+module System.IO.Unsafe.Compat.Repl (+ module System.IO.Unsafe.Compat+) where+import "this" System.IO.Unsafe.Compat
+ src/Text/Read/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Text.Read.Compat"+-- from a globally unique namespace.+module Text.Read.Compat.Repl (+ module Text.Read.Compat+) where+import "this" Text.Read.Compat
+ src/Type/Reflection/Compat.hs view
@@ -0,0 +1,34 @@+{-# LANGUAGE CPP, NoImplicitPrelude #-}+#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,11,0))+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeInType #-}+#endif+module Type.Reflection.Compat (+#if MIN_VERSION_base(4,10,0)+ module Base+, withTypeable+#endif+) where++#if MIN_VERSION_base(4,11,0)+import Type.Reflection as Base+#elif MIN_VERSION_base(4,10,0)+import Type.Reflection as Base hiding (withTypeable)+#endif++#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,11,0))+import GHC.Exts (TYPE)+import Type.Reflection (Typeable, TypeRep)+import Unsafe.Coerce (unsafeCoerce)++-- | Use a 'TypeRep' as 'Typeable' evidence.+withTypeable :: forall (a :: k) (r :: TYPE rep). ()+ => TypeRep a -> (Typeable a => r) -> r+withTypeable rep k = unsafeCoerce k' rep+ where k' :: Gift a r+ k' = Gift k++-- | A helper to satisfy the type checker in 'withTypeable'.+newtype Gift a (r :: TYPE rep) = Gift (Typeable a => r)+#endif
+ src/Type/Reflection/Compat/Repl.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE PackageImports #-}+{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}+-- | Reexports "Type.Reflection.Compat"+-- from a globally unique namespace.+module Type.Reflection.Compat.Repl (+ module Type.Reflection.Compat+) where+import "this" Type.Reflection.Compat
− test/Control/Monad/CompatSpec.hs
@@ -1,16 +0,0 @@-module Control.Monad.CompatSpec (main, spec) where--import Test.Hspec--import Control.Monad.Compat-import Prelude ()-import Prelude.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "(<$!>)" $ do- it "is a strict version of (<$>)" $ do- not <$!> [True, False] `shouldBe` not <$> [True, False]
− test/Data/Bits/CompatSpec.hs
@@ -1,34 +0,0 @@-{-# LANGUAGE CPP #-}-module Data.Bits.CompatSpec (main, spec) where--import Test.Hspec-import Data.Bits.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "bitDefault" $- it "sets the ith bit with all other bits clear" $ do- bitDefault 0 `shouldBe` (1 :: Int)- bitDefault 1 `shouldBe` (2 :: Int)- bitDefault 2 `shouldBe` (4 :: Int)- bitDefault 3 `shouldBe` (8 :: Int)- describe "testBitDefault" $- it "returns True if the nth bit of the argument is 1" $ do- testBitDefault (10 :: Int) 0 `shouldBe` False- testBitDefault (10 :: Int) 1 `shouldBe` True- testBitDefault (10 :: Int) 2 `shouldBe` False- testBitDefault (10 :: Int) 3 `shouldBe` True- describe "popCountDefault" $- it "returns the number of set bits in the argument" $ do- popCountDefault (0 :: Int) `shouldBe` 0- popCountDefault (1 :: Int) `shouldBe` 1- popCountDefault (10 :: Int) `shouldBe` 2-#if MIN_VERSION_base(4,7,0)- describe "toIntegralSized" $- it "converts an Integral type to another as measured by bitSizeMaybe" $ do- toIntegralSized (42 :: Integer) `shouldBe` (Just 42 :: Maybe Int)- toIntegralSized (12345678901234567890 :: Integer) `shouldBe` (Nothing :: Maybe Int)-#endif
− test/Data/Bool/CompatSpec.hs
@@ -1,18 +0,0 @@-module Data.Bool.CompatSpec (main, spec) where--import Test.Hspec--import Data.Bool.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "bool" $ do- it "evaluates to first parameter if condition is False" $ do- bool "KO" "OK" False `shouldBe` "KO"-- it "evaluates to second parameter if condition is True" $ do- bool "KO" "OK" True `shouldBe` "OK"-
− test/Data/Either/CompatSpec.hs
@@ -1,25 +0,0 @@-module Data.Either.CompatSpec (main, spec) where--import Test.Hspec--import Data.Either.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "isLeft" $ do- it "returns True for a Left value" $ do- isLeft (Left "23" :: Either String String) `shouldBe` True-- it "returns False for a Right value" $ do- isLeft (Right "23" :: Either String String) `shouldBe` False-- describe "isRight" $ do- it "returns False for a Left value" $ do- isRight (Left "23" :: Either String String) `shouldBe` False-- it "returns True for a Right value" $ do- isRight (Right "23" :: Either String String) `shouldBe` True-
− test/Data/Foldable/CompatSpec.hs
@@ -1,13 +0,0 @@-module Data.Foldable.CompatSpec (main, spec) where--import Test.Hspec-import Data.Foldable.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "maximumBy" $ do- it "runs in constant space" $ do- maximumBy compare [1..10000] `shouldBe` (10000 :: Int)
− test/Data/Function/CompatSpec.hs
@@ -1,13 +0,0 @@-module Data.Function.CompatSpec (main, spec) where--import Test.Hspec-import Data.Function.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "&" $ do- it "reverses function application" $ do- (False & not) `shouldBe` True
− test/Data/Functor/CompatSpec.hs
@@ -1,17 +0,0 @@-module Data.Functor.CompatSpec (main, spec) where--import Test.Hspec-import Data.Functor.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "void" $ do- it "discards computation result" $ do- void (return 1 :: IO Int) `shouldReturn` ()-- describe "$>" $ do- it "is the same as flipped <$" $ do- (Just 5 :: Maybe Int) $> 6 `shouldBe` (Just 6 :: Maybe Int)
− test/Data/IORef/CompatSpec.hs
@@ -1,22 +0,0 @@-module Data.IORef.CompatSpec (main, spec) where--import Test.Hspec--import Control.Monad-import Data.IORef.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "modifyIORef'" $- it "mutates the contents of an IORef strictly" $ do- ref <- newIORef 0- replicateM_ 1000000 $ modifyIORef' ref (+1)- readIORef ref `shouldReturn` (1000000 :: Int)- describe "atomicModifyIORef'" $- it "atomically modifies the contents of an IORef strictly" $ do- ref <- newIORef 0- replicateM_ 1000000 . atomicModifyIORef' ref $ \n -> (n+1, ())- readIORef ref `shouldReturn` (1000000 :: Int)
− test/Data/List/CompatSpec.hs
@@ -1,43 +0,0 @@-module Data.List.CompatSpec (main, spec) where--import Test.Hspec-import Data.List.Compat--data Asymmetric = A | B deriving Show--instance Eq Asymmetric where- A == _ = True- B == _ = False--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "dropWhileEnd" $ do- it "drops the largest suffix of a list in which a predicate holds for all elements" $ do- dropWhileEnd (== ' ') "foo " `shouldBe` "foo"- dropWhileEnd (== ' ') "foo bar" `shouldBe` "foo bar"- describe "isSubsequenceOf" $ do- it "returns True if the first list is a subsequence of the second list" $ do- isSubsequenceOf "GHC" "The Glorious Haskell Compiler" `shouldBe` True- isSubsequenceOf "JHC" "The Glorious Haskell Compiler" `shouldBe` False- describe "nub" $- it "preserves the order of arguments to (==)" $- nub [A, B] `shouldBe` [A]- describe "nubBy" $- it "preserves the order of arguments to the equality function" $- nubBy (<) "12" `shouldBe` "1"- describe "sortOn" $ do- it "sorts a list by comparing the results of a key function applied to each element" $ do- sortOn (>='b') "cba" `shouldBe` "acb"- describe "uncons" $ do- it "decomposes a list into its head and tail" $ do- uncons "" `shouldBe` Nothing- uncons "12" `shouldBe` Just ('1', "2")- describe "union" $- it "nubs arguments in the same order as (==)" $ do- union [A] [A, B] `shouldBe` [A]- describe "unionBy" $- it "nubs arguments in the same order as nubBy's equality function" $ do- unionBy (<) "1" "21" `shouldBe` "11"
− test/Data/Monoid/CompatSpec.hs
@@ -1,16 +0,0 @@-module Data.Monoid.CompatSpec (main, spec) where--import Test.Hspec-import Test.QuickCheck--import Data.Monoid.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "<>" $ do- it "is an infix synonym for mappend" $ do- property $ \xs ys -> do- xs <> ys `shouldBe` (mappend xs ys :: String)
− test/Data/STRef/CompatSpec.hs
@@ -1,19 +0,0 @@-module Data.STRef.CompatSpec (main, spec) where--import Test.Hspec--import Control.Monad-import Control.Monad.ST-import Data.STRef.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec =- describe "modifySTRef'" $- it "should mutate the contents of an STRef strictly" $- shouldBe (1000000 :: Int) $ runST $ do- ref <- newSTRef 0- replicateM_ 1000000 $ modifySTRef' ref (+1)- readSTRef ref
− test/Data/Version/CompatSpec.hs
@@ -1,10 +0,0 @@-module Data.Version.CompatSpec (spec) where--import Test.Hspec-import Data.Version.Compat--spec :: Spec-spec = do- describe "makeVersion" $- it "constructs a tagless Version" $- makeVersion [1,2,3] `shouldBe` Version [1,2,3] []
− test/Data/Word/CompatSpec.hs
@@ -1,22 +0,0 @@-module Data.Word.CompatSpec (main, spec) where--import Test.Hspec-import Data.Word.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "byteSwap16" $- it "reverses the order of bytes in a Word16 value" $ do- byteSwap16 0x1100 `shouldBe` 0x0011- byteSwap16 0x1010 `shouldBe` 0x1010- describe "byteSwap32" $- it "reverses the order of bytes in a Word32 value" $ do- byteSwap32 0x11001010 `shouldBe` 0x10100011- byteSwap32 0x10101111 `shouldBe` 0x11111010- describe "byteSwap64" $- it "reverses the order of bytes in a Word64 value" $ do- byteSwap64 0x1010111110101111 `shouldBe` 0x1111101011111010- byteSwap64 0x1100000000000011 `shouldBe` 0x1100000000000011
− test/Foreign/Marshal/Alloc/CompatSpec.hs
@@ -1,17 +0,0 @@-module Foreign.Marshal.Alloc.CompatSpec (main, spec) where--import Test.Hspec--import Control.Exception-import Foreign.Marshal.Alloc.Compat-import Foreign.Storable--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "calloc" $- it "allocates memory with bytes of value zero" $ do- bracket calloc free $ \ptr -> do- peek ptr `shouldReturn` (0 :: Int)
− test/Foreign/Marshal/Utils/CompatSpec.hs
@@ -1,20 +0,0 @@-module Foreign.Marshal.Utils.CompatSpec (main, spec) where--import Test.Hspec--import Foreign.Marshal.Alloc-import Foreign.Marshal.Utils.Compat-import Foreign.Ptr-import Foreign.Storable--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "fillBytes" $- it "fills a given number of bytes in memory area with a byte value" $ do- alloca $ \ptr -> do- let _ = ptr :: Ptr Int- fillBytes ptr 0 $ sizeOf ptr- peek ptr `shouldReturn` 0
− test/Numeric/CompatSpec.hs
@@ -1,24 +0,0 @@-module Numeric.CompatSpec (main, spec) where--import Test.Hspec-import Numeric.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "showFFloatAlt" $ do- it "shows a RealFloat value, always using decimal notation" $- showFFloatAlt Nothing (12 :: Double) "" `shouldBe` "12.0"- it "allows to specify the number of decimal places" $- showFFloatAlt (Just 4) (12 :: Double) "" `shouldBe` "12.0000"- describe "showGFloatAlt" $ do- it "shows a RealFloat value, using decimal notation if the absolute value lies between 0.1 and 9,999,999" $- showGFloatAlt Nothing (12 :: Double) "" `shouldBe` "12.0"- it "shows a RealFloat value, using decimal notation and specifying the number of decimal places" $- showGFloatAlt (Just 4) (12 :: Double) "" `shouldBe` "12.0000"- it "shows a RealFloat value, using scientific notation if the absolute value falls outside of the range" $- showGFloatAlt Nothing (1234567890 :: Double) "" `shouldBe` "1.23456789e9"- it "shows a RealFloat value, using scientific notation and specifying the number of decimal places" $- showGFloatAlt (Just 4) (1234567890 :: Double) "" `shouldBe` "1.2346e9"
− test/Spec.hs
@@ -1,1 +0,0 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
− test/System/Environment/CompatSpec.hs
@@ -1,120 +0,0 @@-{-# LANGUAGE CPP #-}-module System.Environment.CompatSpec (main, spec) where--import Test.Hspec-import Test.QuickCheck--import qualified Control.Exception as E-import GHC.IO.Exception (IOErrorType (InvalidArgument))-import System.Environment.Compat-import System.IO.Error--main :: IO ()-main = hspec spec--withEnv :: String -> String -> IO a -> IO a-withEnv k v action = E.bracket save restore $ \_ -> do- setEnv k v >> action- where- save = lookupEnv k- restore = maybe (unsetEnv k) (setEnv k)--withoutEnv :: String -> IO a -> IO a-withoutEnv k action = E.bracket save restore $ \_ -> do- unsetEnv k >> action- where- save = lookupEnv k- restore = maybe (unsetEnv k) (setEnv k)--spec :: Spec-spec = do- describe "lookupEnv" $ do- it "returns specified environment variable" $ do- withEnv "FOOBAR" "23" $ do- lookupEnv "FOOBAR" `shouldReturn` Just "23"-- it "returns Nothing if specified environment variable is not set" $ do- withoutEnv "FOOBAR" $ do- lookupEnv "FOOBAR" `shouldReturn` Nothing-- describe "unsetEnv" $ do- it "removes specified environment variable" $ do- setEnv "FOO" "foo"- unsetEnv "FOO"- getEnv "FOO" `shouldThrow` isDoesNotExistError-- it "does nothing if specified environment variable is not set" $ do- unsetEnv "BAR"- unsetEnv "BAR"- getEnv "BAR" `shouldThrow` isDoesNotExistError-- it "throws an exception if key is the empty string" $ do- unsetEnv "" `shouldThrow` (== InvalidArgument) . ioeGetErrorType-- it "throws an exception if key contains '='" $ do- unsetEnv "some=key" `shouldThrow` (== InvalidArgument) . ioeGetErrorType-- it "works for arbitrary keys" $- property $ \k -> ('\NUL' `notElem` k && '=' `notElem` k && (not . null) k) ==> do- setEnv k "foo"- unsetEnv k- getEnv k `shouldThrow` isDoesNotExistError-- describe "setEnv" $ do- it "sets specified environment variable to given value" $ do- unsetEnv "FOO"- setEnv "FOO" "foo"- getEnv "FOO" `shouldReturn` "foo"-- it "resets specified environment variable, if it is already set" $ do- unsetEnv "FOO"- setEnv "FOO" "foo"- setEnv "FOO" "bar"- getEnv "FOO" `shouldReturn` "bar"-- it "removes specified environment variable when value is the empty string" $ do- setEnv "FOO" "foo"- setEnv "FOO" ""- getEnv "FOO" `shouldThrow` isDoesNotExistError-- it "removes specified environment variable when first character of value is NUL" $ do- setEnv "FOO" "foo"- setEnv "FOO" "\NULfoo"- getEnv "FOO" `shouldThrow` isDoesNotExistError-- it "truncates value at NUL character" $ do- unsetEnv "FOO"- setEnv "FOO" "foo\NULbar"- getEnv "FOO" `shouldReturn` "foo"-- it "truncates key at NUL character" $ do- unsetEnv "FOO"- setEnv "FOO\NULBAR" "foo"- getEnv "FOO" `shouldReturn` "foo"--#if __GLASGOW_HASKELL__ >= 702- it "works for unicode" $ do- unsetEnv "FOO"- setEnv "FOO" "foo-\955-bar"- getEnv "FOO" `shouldReturn` "foo-\955-bar"-#endif-- it "works for arbitrary values" $- property $ \v -> ('\NUL' `notElem` v && (not . null) v) ==> do- setEnv "FOO" v- getEnv "FOO" `shouldReturn` v-- it "works for unicode keys" $ do- setEnv "foo-\955-bar" "foo"- getEnv "foo-\955-bar" `shouldReturn` "foo"-- it "throws an exception if key is the empty string" $ do- setEnv "" "foo" `shouldThrow` (== InvalidArgument) . ioeGetErrorType-- it "throws an exception if key contains '='" $ do- setEnv "some=key" "foo" `shouldThrow` (== InvalidArgument) . ioeGetErrorType-- it "works for arbitrary keys" $- property $ \k -> ('\NUL' `notElem` k && '=' `notElem` k && (not . null) k) ==> do- setEnv k "foo"- getEnv k `shouldReturn` "foo"
− test/Text/Read/CompatSpec.hs
@@ -1,24 +0,0 @@-module Text.Read.CompatSpec (main, spec) where--import Test.Hspec--import Text.Read.Compat--main :: IO ()-main = hspec spec--spec :: Spec-spec = do- describe "readMaybe" $ do- it "parses a value" $ do- readMaybe "23" `shouldBe` (Just 23 :: Maybe Int)-- it "returns Nothing if parsing fails" $ do- readMaybe "xx" `shouldBe` (Nothing :: Maybe Int)-- describe "readEither" $ do- it "parses a value" $ do- readEither "23" `shouldBe` (Right 23 :: Either String Int)-- it "returns Left if parsing fails" $ do- readEither "xx" `shouldBe` (Left "Prelude.read: no parse" :: Either String Int)