Commit c409b6f3 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Remove redundant constraints from libraries, discovered by -fwarn-redundant-constraints

This patch affects libraries, and requires a submodule update.

Some other libraries, maintained by others, have redundant constraints,
namely:
           containers
           haskeline
           transformers
           binary

I have suppressed the redundant-constraint warnings by settings in
           validate-settings.mk
(in this commit)
parent 39337a6d
Subproject commit 4baaf0b6d1e7498f529e41eaa3a065cfa84b078c Subproject commit e69fab76b5b15d7e7f413edb936faab30d05b8a0
...@@ -1064,7 +1064,7 @@ ratioConstr = mkConstr ratioDataType ":%" [] Infix ...@@ -1064,7 +1064,7 @@ ratioConstr = mkConstr ratioDataType ":%" [] Infix
ratioDataType :: DataType ratioDataType :: DataType
ratioDataType = mkDataType "GHC.Real.Ratio" [ratioConstr] ratioDataType = mkDataType "GHC.Real.Ratio" [ratioConstr]
instance (Data a, Integral a) => Data (Ratio a) where instance Data a => Data (Ratio a) where
gfoldl k z (a :% b) = z (:%) `k` a `k` b gfoldl k z (a :% b) = z (:%) `k` a `k` b
toConstr _ = ratioConstr toConstr _ = ratioConstr
gunfold k z c | constrIndex c == 1 = k (k (z (:%))) gunfold k z c | constrIndex c == 1 = k (k (z (:%)))
...@@ -1303,7 +1303,7 @@ instance (Data a, Data b, Data c, Data d, Data e, Data f, Data g) ...@@ -1303,7 +1303,7 @@ instance (Data a, Data b, Data c, Data d, Data e, Data f, Data g)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
instance (Data a, Typeable a) => Data (Ptr a) where instance Data a => Data (Ptr a) where
toConstr _ = error "Data.Data.toConstr(Ptr)" toConstr _ = error "Data.Data.toConstr(Ptr)"
gunfold _ _ = error "Data.Data.gunfold(Ptr)" gunfold _ _ = error "Data.Data.gunfold(Ptr)"
dataTypeOf _ = mkNoRepType "GHC.Ptr.Ptr" dataTypeOf _ = mkNoRepType "GHC.Ptr.Ptr"
...@@ -1311,7 +1311,7 @@ instance (Data a, Typeable a) => Data (Ptr a) where ...@@ -1311,7 +1311,7 @@ instance (Data a, Typeable a) => Data (Ptr a) where
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
instance (Data a, Typeable a) => Data (ForeignPtr a) where instance Data a => Data (ForeignPtr a) where
toConstr _ = error "Data.Data.toConstr(ForeignPtr)" toConstr _ = error "Data.Data.toConstr(ForeignPtr)"
gunfold _ _ = error "Data.Data.gunfold(ForeignPtr)" gunfold _ _ = error "Data.Data.gunfold(ForeignPtr)"
dataTypeOf _ = mkNoRepType "GHC.ForeignPtr.ForeignPtr" dataTypeOf _ = mkNoRepType "GHC.ForeignPtr.ForeignPtr"
...@@ -1320,7 +1320,7 @@ instance (Data a, Typeable a) => Data (ForeignPtr a) where ...@@ -1320,7 +1320,7 @@ instance (Data a, Typeable a) => Data (ForeignPtr a) where
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- The Data instance for Array preserves data abstraction at the cost of -- The Data instance for Array preserves data abstraction at the cost of
-- inefficiency. We omit reflection services for the sake of data abstraction. -- inefficiency. We omit reflection services for the sake of data abstraction.
instance (Typeable a, Data a, Data b, Ix a) => Data (Array a b) instance (Data a, Data b, Ix a) => Data (Array a b)
where where
gfoldl f z a = z (listArray (bounds a)) `f` (elems a) gfoldl f z a = z (listArray (bounds a)) `f` (elems a)
toConstr _ = error "Data.Data.toConstr(Array)" toConstr _ = error "Data.Data.toConstr(Array)"
......
...@@ -56,7 +56,7 @@ import Data.Monoid ...@@ -56,7 +56,7 @@ import Data.Monoid
import Data.Ord import Data.Ord
import Data.Proxy import Data.Proxy
import GHC.Arr ( Array(..), Ix(..), elems, numElements, import GHC.Arr ( Array(..), elems, numElements,
foldlElems, foldrElems, foldlElems, foldrElems,
foldlElems', foldrElems', foldlElems', foldrElems',
foldl1Elems, foldr1Elems) foldl1Elems, foldr1Elems)
...@@ -254,7 +254,7 @@ instance Foldable ((,) a) where ...@@ -254,7 +254,7 @@ instance Foldable ((,) a) where
foldr f z (_, y) = f y z foldr f z (_, y) = f y z
instance Ix i => Foldable (Array i) where instance Foldable (Array i) where
foldr = foldrElems foldr = foldrElems
foldl = foldlElems foldl = foldlElems
foldl' = foldlElems' foldl' = foldlElems'
......
...@@ -450,7 +450,7 @@ unsafeArray :: Ix i => (i,i) -> [(Int, e)] -> Array i e ...@@ -450,7 +450,7 @@ unsafeArray :: Ix i => (i,i) -> [(Int, e)] -> Array i e
unsafeArray b ies = unsafeArray' b (rangeSize b) ies unsafeArray b ies = unsafeArray' b (rangeSize b) ies
{-# INLINE unsafeArray' #-} {-# INLINE unsafeArray' #-}
unsafeArray' :: Ix i => (i,i) -> Int -> [(Int, e)] -> Array i e unsafeArray' :: (i,i) -> Int -> [(Int, e)] -> Array i e
unsafeArray' (l,u) n@(I# n#) ies = runST (ST $ \s1# -> unsafeArray' (l,u) n@(I# n#) ies = runST (ST $ \s1# ->
case newArray# n# arrEleBottom s1# of case newArray# n# arrEleBottom s1# of
(# s2#, marr# #) -> (# s2#, marr# #) ->
...@@ -465,7 +465,7 @@ fill marr# (I# i#, e) next ...@@ -465,7 +465,7 @@ fill marr# (I# i#, e) next
s2# -> next s2# s2# -> next s2#
{-# INLINE done #-} {-# INLINE done #-}
done :: Ix i => i -> i -> Int -> MutableArray# s e -> STRep s (Array i e) done :: i -> i -> Int -> MutableArray# s e -> STRep s (Array i e)
-- See NB on 'fill' -- See NB on 'fill'
-- Make sure it is strict in 'n' -- Make sure it is strict in 'n'
done l u n@(I# _) marr# done l u n@(I# _) marr#
...@@ -535,18 +535,18 @@ badSafeIndex i' n = error ("Error in array index; " ++ show i' ++ ...@@ -535,18 +535,18 @@ badSafeIndex i' n = error ("Error in array index; " ++ show i' ++
" not in range [0.." ++ show n ++ ")") " not in range [0.." ++ show n ++ ")")
{-# INLINE unsafeAt #-} {-# INLINE unsafeAt #-}
unsafeAt :: Ix i => Array i e -> Int -> e unsafeAt :: Array i e -> Int -> e
unsafeAt (Array _ _ _ arr#) (I# i#) = unsafeAt (Array _ _ _ arr#) (I# i#) =
case indexArray# arr# i# of (# e #) -> e case indexArray# arr# i# of (# e #) -> e
-- | The bounds with which an array was constructed. -- | The bounds with which an array was constructed.
{-# INLINE bounds #-} {-# INLINE bounds #-}
bounds :: Ix i => Array i e -> (i,i) bounds :: Array i e -> (i,i)
bounds (Array l u _ _) = (l,u) bounds (Array l u _ _) = (l,u)
-- | The number of elements in the array. -- | The number of elements in the array.
{-# INLINE numElements #-} {-# INLINE numElements #-}
numElements :: Ix i => Array i e -> Int numElements :: Array i e -> Int
numElements (Array _ _ n _) = n numElements (Array _ _ n _) = n
-- | The list of indices of an array in ascending order. -- | The list of indices of an array in ascending order.
...@@ -556,13 +556,13 @@ indices (Array l u _ _) = range (l,u) ...@@ -556,13 +556,13 @@ indices (Array l u _ _) = range (l,u)
-- | The list of elements of an array in index order. -- | The list of elements of an array in index order.
{-# INLINE elems #-} {-# INLINE elems #-}
elems :: Ix i => Array i e -> [e] elems :: Array i e -> [e]
elems arr@(Array _ _ n _) = elems arr@(Array _ _ n _) =
[unsafeAt arr i | i <- [0 .. n - 1]] [unsafeAt arr i | i <- [0 .. n - 1]]
-- | A right fold over the elements -- | A right fold over the elements
{-# INLINABLE foldrElems #-} {-# INLINABLE foldrElems #-}
foldrElems :: Ix i => (a -> b -> b) -> b -> Array i a -> b foldrElems :: (a -> b -> b) -> b -> Array i a -> b
foldrElems f b0 = \ arr@(Array _ _ n _) -> foldrElems f b0 = \ arr@(Array _ _ n _) ->
let let
go i | i == n = b0 go i | i == n = b0
...@@ -571,7 +571,7 @@ foldrElems f b0 = \ arr@(Array _ _ n _) -> ...@@ -571,7 +571,7 @@ foldrElems f b0 = \ arr@(Array _ _ n _) ->
-- | A left fold over the elements -- | A left fold over the elements
{-# INLINABLE foldlElems #-} {-# INLINABLE foldlElems #-}
foldlElems :: Ix i => (b -> a -> b) -> b -> Array i a -> b foldlElems :: (b -> a -> b) -> b -> Array i a -> b
foldlElems f b0 = \ arr@(Array _ _ n _) -> foldlElems f b0 = \ arr@(Array _ _ n _) ->
let let
go i | i == (-1) = b0 go i | i == (-1) = b0
...@@ -580,7 +580,7 @@ foldlElems f b0 = \ arr@(Array _ _ n _) -> ...@@ -580,7 +580,7 @@ foldlElems f b0 = \ arr@(Array _ _ n _) ->
-- | A strict right fold over the elements -- | A strict right fold over the elements
{-# INLINABLE foldrElems' #-} {-# INLINABLE foldrElems' #-}
foldrElems' :: Ix i => (a -> b -> b) -> b -> Array i a -> b foldrElems' :: (a -> b -> b) -> b -> Array i a -> b
foldrElems' f b0 = \ arr@(Array _ _ n _) -> foldrElems' f b0 = \ arr@(Array _ _ n _) ->
let let
go i a | i == (-1) = a go i a | i == (-1) = a
...@@ -589,7 +589,7 @@ foldrElems' f b0 = \ arr@(Array _ _ n _) -> ...@@ -589,7 +589,7 @@ foldrElems' f b0 = \ arr@(Array _ _ n _) ->
-- | A strict left fold over the elements -- | A strict left fold over the elements
{-# INLINABLE foldlElems' #-} {-# INLINABLE foldlElems' #-}
foldlElems' :: Ix i => (b -> a -> b) -> b -> Array i a -> b foldlElems' :: (b -> a -> b) -> b -> Array i a -> b
foldlElems' f b0 = \ arr@(Array _ _ n _) -> foldlElems' f b0 = \ arr@(Array _ _ n _) ->
let let
go i a | i == n = a go i a | i == n = a
...@@ -598,7 +598,7 @@ foldlElems' f b0 = \ arr@(Array _ _ n _) -> ...@@ -598,7 +598,7 @@ foldlElems' f b0 = \ arr@(Array _ _ n _) ->
-- | A left fold over the elements with no starting value -- | A left fold over the elements with no starting value
{-# INLINABLE foldl1Elems #-} {-# INLINABLE foldl1Elems #-}
foldl1Elems :: Ix i => (a -> a -> a) -> Array i a -> a foldl1Elems :: (a -> a -> a) -> Array i a -> a
foldl1Elems f = \ arr@(Array _ _ n _) -> foldl1Elems f = \ arr@(Array _ _ n _) ->
let let
go i | i == 0 = unsafeAt arr 0 go i | i == 0 = unsafeAt arr 0
...@@ -608,7 +608,7 @@ foldl1Elems f = \ arr@(Array _ _ n _) -> ...@@ -608,7 +608,7 @@ foldl1Elems f = \ arr@(Array _ _ n _) ->
-- | A right fold over the elements with no starting value -- | A right fold over the elements with no starting value
{-# INLINABLE foldr1Elems #-} {-# INLINABLE foldr1Elems #-}
foldr1Elems :: Ix i => (a -> a -> a) -> Array i a -> a foldr1Elems :: (a -> a -> a) -> Array i a -> a
foldr1Elems f = \ arr@(Array _ _ n _) -> foldr1Elems f = \ arr@(Array _ _ n _) ->
let let
go i | i == n-1 = unsafeAt arr i go i | i == n-1 = unsafeAt arr i
...@@ -653,7 +653,7 @@ unsafeAccumArray :: Ix i => (e -> a -> e) -> e -> (i,i) -> [(Int, a)] -> Array i ...@@ -653,7 +653,7 @@ unsafeAccumArray :: Ix i => (e -> a -> e) -> e -> (i,i) -> [(Int, a)] -> Array i
unsafeAccumArray f initial b ies = unsafeAccumArray' f initial b (rangeSize b) ies unsafeAccumArray f initial b ies = unsafeAccumArray' f initial b (rangeSize b) ies
{-# INLINE unsafeAccumArray' #-} {-# INLINE unsafeAccumArray' #-}
unsafeAccumArray' :: Ix i => (e -> a -> e) -> e -> (i,i) -> Int -> [(Int, a)] -> Array i e unsafeAccumArray' :: (e -> a -> e) -> e -> (i,i) -> Int -> [(Int, a)] -> Array i e
unsafeAccumArray' f initial (l,u) n@(I# n#) ies = runST (ST $ \s1# -> unsafeAccumArray' f initial (l,u) n@(I# n#) ies = runST (ST $ \s1# ->
case newArray# n# initial s1# of { (# s2#, marr# #) -> case newArray# n# initial s1# of { (# s2#, marr# #) ->
foldr (adjust f marr#) (done l u n marr#) ies s2# }) foldr (adjust f marr#) (done l u n marr#) ies s2# })
...@@ -684,7 +684,7 @@ arr@(Array l u n _) // ies = ...@@ -684,7 +684,7 @@ arr@(Array l u n _) // ies =
unsafeReplace arr [(safeIndex (l,u) n i, e) | (i, e) <- ies] unsafeReplace arr [(safeIndex (l,u) n i, e) | (i, e) <- ies]
{-# INLINE unsafeReplace #-} {-# INLINE unsafeReplace #-}
unsafeReplace :: Ix i => Array i e -> [(Int, e)] -> Array i e unsafeReplace :: Array i e -> [(Int, e)] -> Array i e
unsafeReplace arr ies = runST (do unsafeReplace arr ies = runST (do
STArray l u n marr# <- thawSTArray arr STArray l u n marr# <- thawSTArray arr
ST (foldr (fill marr#) (done l u n marr#) ies)) ST (foldr (fill marr#) (done l u n marr#) ies))
...@@ -701,13 +701,13 @@ accum f arr@(Array l u n _) ies = ...@@ -701,13 +701,13 @@ accum f arr@(Array l u n _) ies =
unsafeAccum f arr [(safeIndex (l,u) n i, e) | (i, e) <- ies] unsafeAccum f arr [(safeIndex (l,u) n i, e) | (i, e) <- ies]
{-# INLINE unsafeAccum #-} {-# INLINE unsafeAccum #-}
unsafeAccum :: Ix i => (e -> a -> e) -> Array i e -> [(Int, a)] -> Array i e unsafeAccum :: (e -> a -> e) -> Array i e -> [(Int, a)] -> Array i e
unsafeAccum f arr ies = runST (do unsafeAccum f arr ies = runST (do
STArray l u n marr# <- thawSTArray arr STArray l u n marr# <- thawSTArray arr
ST (foldr (adjust f marr#) (done l u n marr#) ies)) ST (foldr (adjust f marr#) (done l u n marr#) ies))
{-# INLINE [1] amap #-} {-# INLINE [1] amap #-}
amap :: Ix i => (a -> b) -> Array i a -> Array i b amap :: (a -> b) -> Array i a -> Array i b
amap f arr@(Array l u n@(I# n#) _) = runST (ST $ \s1# -> amap f arr@(Array l u n@(I# n#) _) = runST (ST $ \s1# ->
case newArray# n# arrEleBottom s1# of case newArray# n# arrEleBottom s1# of
(# s2#, marr# #) -> (# s2#, marr# #) ->
...@@ -786,7 +786,7 @@ cmpIntArray arr1@(Array l1 u1 n1 _) arr2@(Array l2 u2 n2 _) = ...@@ -786,7 +786,7 @@ cmpIntArray arr1@(Array l1 u1 n1 _) arr2@(Array l2 u2 n2 _) =
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- Array instances -- Array instances
instance Ix i => Functor (Array i) where instance Functor (Array i) where
fmap = amap fmap = amap
instance (Ix i, Eq e) => Eq (Array i e) where instance (Ix i, Eq e) => Eq (Array i e) where
...@@ -845,7 +845,7 @@ readSTArray marr@(STArray l u n _) i = ...@@ -845,7 +845,7 @@ readSTArray marr@(STArray l u n _) i =
unsafeReadSTArray marr (safeIndex (l,u) n i) unsafeReadSTArray marr (safeIndex (l,u) n i)
{-# INLINE unsafeReadSTArray #-} {-# INLINE unsafeReadSTArray #-}
unsafeReadSTArray :: Ix i => STArray s i e -> Int -> ST s e unsafeReadSTArray :: STArray s i e -> Int -> ST s e
unsafeReadSTArray (STArray _ _ _ marr#) (I# i#) unsafeReadSTArray (STArray _ _ _ marr#) (I# i#)
= ST $ \s1# -> readArray# marr# i# s1# = ST $ \s1# -> readArray# marr# i# s1#
...@@ -855,7 +855,7 @@ writeSTArray marr@(STArray l u n _) i e = ...@@ -855,7 +855,7 @@ writeSTArray marr@(STArray l u n _) i e =
unsafeWriteSTArray marr (safeIndex (l,u) n i) e unsafeWriteSTArray marr (safeIndex (l,u) n i) e
{-# INLINE unsafeWriteSTArray #-} {-# INLINE unsafeWriteSTArray #-}
unsafeWriteSTArray :: Ix i => STArray s i e -> Int -> e -> ST s () unsafeWriteSTArray :: STArray s i e -> Int -> e -> ST s ()
unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# -> unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# ->
case writeArray# marr# i# e s1# of case writeArray# marr# i# e s1# of
s2# -> (# s2#, () #) s2# -> (# s2#, () #)
...@@ -863,7 +863,7 @@ unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# -> ...@@ -863,7 +863,7 @@ unsafeWriteSTArray (STArray _ _ _ marr#) (I# i#) e = ST $ \s1# ->
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- Moving between mutable and immutable -- Moving between mutable and immutable
freezeSTArray :: Ix i => STArray s i e -> ST s (Array i e) freezeSTArray :: STArray s i e -> ST s (Array i e)
freezeSTArray (STArray l u n@(I# n#) marr#) = ST $ \s1# -> freezeSTArray (STArray l u n@(I# n#) marr#) = ST $ \s1# ->
case newArray# n# arrEleBottom s1# of { (# s2#, marr'# #) -> case newArray# n# arrEleBottom s1# of { (# s2#, marr'# #) ->
let copy i# s3# | isTrue# (i# ==# n#) = s3# let copy i# s3# | isTrue# (i# ==# n#) = s3#
...@@ -876,12 +876,12 @@ freezeSTArray (STArray l u n@(I# n#) marr#) = ST $ \s1# -> ...@@ -876,12 +876,12 @@ freezeSTArray (STArray l u n@(I# n#) marr#) = ST $ \s1# ->
(# s4#, Array l u n arr# #) }}} (# s4#, Array l u n arr# #) }}}
{-# INLINE unsafeFreezeSTArray #-} {-# INLINE unsafeFreezeSTArray #-}
unsafeFreezeSTArray :: Ix i => STArray s i e -> ST s (Array i e) unsafeFreezeSTArray :: STArray s i e -> ST s (Array i e)
unsafeFreezeSTArray (STArray l u n marr#) = ST $ \s1# -> unsafeFreezeSTArray (STArray l u n marr#) = ST $ \s1# ->
case unsafeFreezeArray# marr# s1# of { (# s2#, arr# #) -> case unsafeFreezeArray# marr# s1# of { (# s2#, arr# #) ->
(# s2#, Array l u n arr# #) } (# s2#, Array l u n arr# #) }
thawSTArray :: Ix i => Array i e -> ST s (STArray s i e) thawSTArray :: Array i e -> ST s (STArray s i e)
thawSTArray (Array l u n@(I# n#) arr#) = ST $ \s1# -> thawSTArray (Array l u n@(I# n#) arr#) = ST $ \s1# ->
case newArray# n# arrEleBottom s1# of { (# s2#, marr# #) -> case newArray# n# arrEleBottom s1# of { (# s2#, marr# #) ->
let copy i# s3# | isTrue# (i# ==# n#) = s3# let copy i# s3# | isTrue# (i# ==# n#) = s3#
...@@ -893,7 +893,7 @@ thawSTArray (Array l u n@(I# n#) arr#) = ST $ \s1# -> ...@@ -893,7 +893,7 @@ thawSTArray (Array l u n@(I# n#) arr#) = ST $ \s1# ->
(# s3#, STArray l u n marr# #) }} (# s3#, STArray l u n marr# #) }}
{-# INLINE unsafeThawSTArray #-} {-# INLINE unsafeThawSTArray #-}
unsafeThawSTArray :: Ix i => Array i e -> ST s (STArray s i e) unsafeThawSTArray :: Array i e -> ST s (STArray s i e)
unsafeThawSTArray (Array l u n arr#) = ST $ \s1# -> unsafeThawSTArray (Array l u n arr#) = ST $ \s1# ->
case unsafeThawArray# arr# s1# of { (# s2#, marr# #) -> case unsafeThawArray# arr# s1# of { (# s2#, marr# #) ->
(# s2#, STArray l u n marr# #) } (# s2#, STArray l u n marr# #) }
...@@ -132,7 +132,7 @@ unsafeWrite' (AC es _ cap) ix a = do ...@@ -132,7 +132,7 @@ unsafeWrite' (AC es _ cap) ix a = do
withForeignPtr es $ \p -> withForeignPtr es $ \p ->
pokeElemOff p ix a pokeElemOff p ix a
unsafeLoad :: Storable a => Array a -> (Ptr a -> Int -> IO Int) -> IO Int unsafeLoad :: Array a -> (Ptr a -> Int -> IO Int) -> IO Int
unsafeLoad (Array ref) load = do unsafeLoad (Array ref) load = do
AC es _ cap <- readIORef ref AC es _ cap <- readIORef ref
len' <- withForeignPtr es $ \p -> load p cap len' <- withForeignPtr es $ \p -> load p cap
...@@ -170,7 +170,7 @@ snoc (Array ref) e = do ...@@ -170,7 +170,7 @@ snoc (Array ref) e = do
unsafeWrite' ac' len e unsafeWrite' ac' len e
writeIORef ref (AC es len' cap) writeIORef ref (AC es len' cap)
clear :: Storable a => Array a -> IO () clear :: Array a -> IO ()
clear (Array ref) = do clear (Array ref) = do
atomicModifyIORef' ref $ \(AC es _ cap) -> atomicModifyIORef' ref $ \(AC es _ cap) ->
(AC es 0 cap, ()) (AC es 0 cap, ())
......
...@@ -54,12 +54,12 @@ newIOArray :: Ix i => (i,i) -> e -> IO (IOArray i e) ...@@ -54,12 +54,12 @@ newIOArray :: Ix i => (i,i) -> e -> IO (IOArray i e)
newIOArray lu initial = stToIO $ do {marr <- newSTArray lu initial; return (IOArray marr)} newIOArray lu initial = stToIO $ do {marr <- newSTArray lu initial; return (IOArray marr)}
-- | Read a value from an 'IOArray' -- | Read a value from an 'IOArray'
unsafeReadIOArray :: Ix i => IOArray i e -> Int -> IO e unsafeReadIOArray :: IOArray i e -> Int -> IO e
{-# INLINE unsafeReadIOArray #-} {-# INLINE unsafeReadIOArray #-}
unsafeReadIOArray (IOArray marr) i = stToIO (unsafeReadSTArray marr i) unsafeReadIOArray (IOArray marr) i = stToIO (unsafeReadSTArray marr i)
-- | Write a new value into an 'IOArray' -- | Write a new value into an 'IOArray'
unsafeWriteIOArray :: Ix i => IOArray i e -> Int -> e -> IO () unsafeWriteIOArray :: IOArray i e -> Int -> e -> IO ()
{-# INLINE unsafeWriteIOArray #-} {-# INLINE unsafeWriteIOArray #-}
unsafeWriteIOArray (IOArray marr) i e = stToIO (unsafeWriteSTArray marr i e) unsafeWriteIOArray (IOArray marr) i e = stToIO (unsafeWriteSTArray marr i e)
......
...@@ -103,12 +103,12 @@ notANumber = 0 :% 0 ...@@ -103,12 +103,12 @@ notANumber = 0 :% 0
-- | Extract the numerator of the ratio in reduced form: -- | Extract the numerator of the ratio in reduced form:
-- the numerator and denominator have no common factor and the denominator -- the numerator and denominator have no common factor and the denominator
-- is positive. -- is positive.
numerator :: (Integral a) => Ratio a -> a numerator :: Ratio a -> a
-- | Extract the denominator of the ratio in reduced form: -- | Extract the denominator of the ratio in reduced form:
-- the numerator and denominator have no common factor and the denominator -- the numerator and denominator have no common factor and the denominator
-- is positive. -- is positive.
denominator :: (Integral a) => Ratio a -> a denominator :: Ratio a -> a
-- | 'reduce' is a subsidiary function used only in this module. -- | 'reduce' is a subsidiary function used only in this module.
...@@ -410,7 +410,7 @@ instance (Integral a) => RealFrac (Ratio a) where ...@@ -410,7 +410,7 @@ instance (Integral a) => RealFrac (Ratio a) where
properFraction (x:%y) = (fromInteger (toInteger q), r:%y) properFraction (x:%y) = (fromInteger (toInteger q), r:%y)
where (q,r) = quotRem x y where (q,r) = quotRem x y
instance (Integral a, Show a) => Show (Ratio a) where instance (Show a) => Show (Ratio a) where
{-# SPECIALIZE instance Show Rational #-} {-# SPECIALIZE instance Show Rational #-}
showsPrec p (x:%y) = showParen (p > ratioPrec) $ showsPrec p (x:%y) = showParen (p > ratioPrec) $
showsPrec ratioPrec1 x . showsPrec ratioPrec1 x .
......
...@@ -461,7 +461,7 @@ intModifierMap = [ ...@@ -461,7 +461,7 @@ intModifierMap = [
("ll", toInteger (minBound :: Int64)), ("ll", toInteger (minBound :: Int64)),
("L", toInteger (minBound :: Int64)) ] ("L", toInteger (minBound :: Int64)) ]
parseIntFormat :: Integral a => a -> String -> FormatParse parseIntFormat :: a -> String -> FormatParse
parseIntFormat _ s = parseIntFormat _ s =
case foldr matchPrefix Nothing intModifierMap of case foldr matchPrefix Nothing intModifierMap of
Just m -> m Just m -> m
......
Subproject commit a79bee5f5da25353b88759cf5ed8d0df2b59946c Subproject commit de1bc894de1ffdd34e6eb8be4fb9e057198060c6
Subproject commit d39ddd928e0d691ee571768a613fd10f6f951a40 Subproject commit b38e92f67cabfa0d0ed12ac93c2d431f2391de70
Subproject commit 5b86f00553688195ea3496d9b7052ec1a9a9c2fe Subproject commit e4e4228ba94178cf31b97fe81b94bff3de6fce03
...@@ -104,6 +104,7 @@ utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-deprecations ...@@ -104,6 +104,7 @@ utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-deprecations
# containers uses bitSize at the moment # containers uses bitSize at the moment
libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints
# On Windows, there are also some unused import warnings # On Windows, there are also some unused import warnings
ifeq "$(HostOS_CPP)" "mingw32" ifeq "$(HostOS_CPP)" "mingw32"
...@@ -113,6 +114,7 @@ endif ...@@ -113,6 +114,7 @@ endif
# haskeline has warnings about deprecated use of block/unblock # haskeline has warnings about deprecated use of block/unblock
libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations
libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports
libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints
# binary upstream has some warnings, so don't use -Werror for it # binary upstream has some warnings, so don't use -Werror for it
libraries/binary_dist-boot_EXTRA_HC_OPTS += -Wwarn libraries/binary_dist-boot_EXTRA_HC_OPTS += -Wwarn
...@@ -143,6 +145,7 @@ libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn ...@@ -143,6 +145,7 @@ libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn
# transformers has unused function parameters warnings # transformers has unused function parameters warnings
libraries/transformers_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports libraries/transformers_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports
libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports
libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints
# Turn of trustworthy-safe warning # Turn of trustworthy-safe warning
libraries/base_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe libraries/base_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment