base-compat 0.5.0 → 0.6.0
raw patch · 6 files changed
+288/−11 lines, 6 filesdep −errorcall-eq-instancePVP ok
version bump matches the API change (PVP)
Dependencies removed: errorcall-eq-instance
API changes (from Hackage documentation)
- Control.Applicative.Compat: instance Monad m => Monad (WrappedMonad m)
- Control.Applicative.Compat: instance Monoid a => Monoid (Const a b)
- Control.Exception.Compat: instance Ord ErrorCall
- Data.Foldable.Compat: instance Foldable ((,) a)
- Data.Foldable.Compat: instance Foldable (Const m)
- Data.Foldable.Compat: instance Foldable (Either a)
- Data.Traversable.Compat: instance Traversable ((,) a)
- Data.Traversable.Compat: instance Traversable (Const m)
- Data.Traversable.Compat: instance Traversable (Either a)
+ 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: (=<<) :: 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 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 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 :: [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: 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 :: 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]
- Data.Foldable.Compat: foldl :: Foldable t => (a -> b -> a) -> a -> t b -> a
+ Data.Foldable.Compat: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Data.Foldable.Compat: foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a
+ Data.Foldable.Compat: foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
Files
- LICENSE +1/−1
- base-compat.cabal +2/−3
- src/Control/Exception/Compat.hs +1/−1
- src/Prelude/Compat.hs +278/−2
- src/System/Environment/Compat.hs +1/−0
- src/System/Exit/Compat.hs +5/−4
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2012 Simon Hengel <sol@typeful.net>+Copyright (c) 2012-2015 Simon Hengel <sol@typeful.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
base-compat.cabal view
@@ -1,8 +1,8 @@ name: base-compat-version: 0.5.0+version: 0.6.0 license: MIT license-file: LICENSE-copyright: (c) 2012-2014 Simon Hengel,+copyright: (c) 2012-2015 Simon Hengel, (c) 2014 João Cristóvão author: Simon Hengel <sol@typeful.net>, João Cristóvão <jmacristovao@gmail.com> maintainer: Simon Hengel <sol@typeful.net>, João Cristóvão <jmacristovao@gmail.com>@@ -22,7 +22,6 @@ -Wall build-depends: base == 4.*- , errorcall-eq-instance , setenv extensions: CPP
src/Control/Exception/Compat.hs view
@@ -5,9 +5,9 @@ ) where import Control.Exception as Base-import Control.Exception.ErrorCall.EqInstance () #if __GLASGOW_HASKELL__ <= 706 import Prelude deriving instance Ord ErrorCall+deriving instance Eq ErrorCall #endif
src/Prelude/Compat.hs view
@@ -1,8 +1,284 @@ module Prelude.Compat (+#if MIN_VERSION_base(4,8,0) module Base+#else+ either+, Data.Foldable.all+, Data.Foldable.and+, Data.Foldable.any+, Data.Foldable.concat+, Data.Foldable.concatMap+, Data.Foldable.mapM_+, Data.Foldable.notElem+, Data.Foldable.or+, Data.Foldable.sequence_+, (<$>)+, maybe+, lines+, unlines+, unwords+, words+, curry+, fst+, snd+, uncurry+, ($!)+, (++)+, (.)+, (=<<)+, asTypeOf+, const+, flip+, id+, map+, otherwise+, until+, ioError+, userError+, (!!)+, break+, cycle+, drop+, dropWhile+, filter+, head+, init+, iterate+, last+, lookup+, repeat+, replicate+, reverse+, scanl+, scanl1+, scanr+, scanr1+, span+, splitAt+, tail+, take+, takeWhile+, unzip+, unzip3+, zip+, zip3+, zipWith+, zipWith3+, subtract+, lex+, readParen+, (^)+, (^^)++, even+, fromIntegral+, gcd+, lcm+, odd+, realToFrac+, showChar+, showParen+, showString+, shows+, appendFile+, getChar+, getContents+, getLine+, interact+, print+, putChar+, putStr+, putStrLn+, readFile+, readIO+, readLn+, writeFile+, read+, reads+, (&&)+, not+, (||)+, ($)+, error+, undefined+, seq++, Data.Foldable.elem+, foldMap+, Data.Foldable.foldl+, Data.Foldable.foldl1+, foldr+, Data.Foldable.foldr1+, length+, Data.Foldable.maximum+, Data.Foldable.minimum+, null+, Data.Foldable.product+, Data.Foldable.sum+, mapM+, sequence+, sequenceA+, traverse+, (*>)+, (<*)+, (<*>)+, pure+, (<$)+, fmap+, (>>)+, (>>=)+, fail+, return+, mappend+, mconcat+, mempty+, maxBound+, minBound+, enumFrom+, enumFromThen+, enumFromThenTo+, enumFromTo+, fromEnum+, pred+, succ+, toEnum+, (**)+, acos+, acosh+, asin+, asinh+, atan+, atanh+, cos+, cosh+, exp+, log+, logBase+, pi+, sin+, sinh+, sqrt+, tan+, tanh+, atan2+, decodeFloat+, encodeFloat+, exponent+, floatDigits+, floatRadix+, floatRange+, isDenormalized+, isIEEE+, isInfinite+, isNaN+, isNegativeZero+, scaleFloat+, significand+, (*)+, (+)+, (-)+, abs+, negate+, signum+, readList+, readsPrec+, (/)+, fromRational+, recip+, div+, divMod+, mod+, quot+, quotRem+, rem+, toInteger+, toRational+, ceiling+, floor+, properFraction+, round+, truncate+, show+, showList+, showsPrec+, (/=)+, (==)+, (<)+, (<=)+, (>)+, (>=)+, compare+, max+, min++-- classes+, Applicative+, Bounded+, Enum+, Eq+, Floating+, Foldable+, Fractional+, Functor+, Integral+, Monad+, Monoid+, Num (fromInteger)+, Ord+, Read+, Real+, RealFloat+, RealFrac+, Show+, Traversable++-- data types+, IO+, Char+, Double+, Float+, Int+, Integer+, Word+, Bool (True, False)+, Either(Left, Right)+, Maybe(Just, Nothing)+, Ordering (EQ, GT, LT)++-- type synonyms+, FilePath+, IOError+, Rational+, ReadS+, ShowS+, String+#endif ) where-#if MIN_VERSION_base(4,6,0)+++#if MIN_VERSION_base(4,8,0)+ import Prelude as Base+ #else-import Prelude as Base hiding (catch)++import Prelude hiding (length, null, foldr, mapM, sequence)++import Data.Word+import Data.Foldable+import Data.Traversable.Compat+import Data.Monoid+import Control.Applicative++-- | Test whether the structure is empty. The default implementation is+-- optimized for structures that are similar to cons-lists, because there+-- is no general way to do better.+null :: Foldable t => t a -> Bool+null = foldr (\_ _ -> False) True++-- | Returns the size/length of a finite structure as an 'Int'. The+-- default implementation is optimized for structures that are similar to+-- cons-lists, because there is no general way to do better.+length :: Foldable t => t a -> Int+length = foldl' (\c _ -> c+1) 0 #endif
src/System/Environment/Compat.hs view
@@ -1,3 +1,4 @@+-- | Miscellaneous information about the system environment. module System.Environment.Compat ( getArgs , getProgName
src/System/Exit/Compat.hs view
@@ -7,15 +7,16 @@ , die ) where +import System.Exit++#if !MIN_VERSION_base(4,8,0)+ import Prelude import System.IO -import System.Exit--#if !MIN_VERSION_base(4,7,1) -- | Write given error message to `stderr` and terminate with `exitFailure`. ----- /Since: 4.7.1.0/+-- @since 4.8.0.0 die :: String -> IO a die err = hPutStrLn stderr err >> exitFailure #endif