diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-21 23:22:19 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-21 23:28:31 +0200 |
commit | b8f583928fa6cb5371a872fc73080d2002dd87d9 (patch) | |
tree | 9982e3cc06cec45a30e956cffbe4a6151a897cc8 /testsuite/tests | |
parent | 1f7f46f94a95ab7fc6f3101da7c02529e1964f24 (diff) | |
download | haskell-b8f583928fa6cb5371a872fc73080d2002dd87d9.tar.gz |
Export `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from Prelude
This finally exposes also the methods of these 3 classes in the Prelude
in order to allow to define basic class instances w/o needing imports.
This almost completes the primary goal of #9586
NOTE: `fold`, `foldl'`, `foldr'`, and `toList` are not exposed yet,
as they require upstream fixes for at least `containers` and
`bytestring`, and are not required for defining basic instances.
Reviewed By: ekmett, austin
Differential Revision: https://phabricator.haskell.org/D236
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghci.debugger/mdo.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/break018.stdout | 8 | ||||
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/dynbrk004.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T4175.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T7627.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci011.stdout | 7 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci020.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/mdo/should_run/mdorun002.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/quasiquotation/T7918.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/DfltProb1.hs | 1 |
10 files changed, 22 insertions, 10 deletions
diff --git a/testsuite/tests/ghci.debugger/mdo.hs b/testsuite/tests/ghci.debugger/mdo.hs index 761c056658..bc5d8dd9ea 100644 --- a/testsuite/tests/ghci.debugger/mdo.hs +++ b/testsuite/tests/ghci.debugger/mdo.hs @@ -1,5 +1,6 @@ import Control.Monad.Fix import Data.IORef +import Prelude hiding (traverse) data N a = N (IORef Bool, N a, a, N a) @@ -34,4 +35,4 @@ l2dll' :: N a -> [a] -> IO (N a, N a) l2dll' p [] = return (p, p) l2dll' p (x:xs) = mdo c <- newNode p x f (f, l) <- l2dll' c xs - return (c, l)
\ No newline at end of file + return (c, l) diff --git a/testsuite/tests/ghci.debugger/scripts/break018.stdout b/testsuite/tests/ghci.debugger/scripts/break018.stdout index a495e7903a..a12e119a42 100644 --- a/testsuite/tests/ghci.debugger/scripts/break018.stdout +++ b/testsuite/tests/ghci.debugger/scripts/break018.stdout @@ -1,13 +1,13 @@ -Stopped at ../mdo.hs:(29,1)-(31,27) +Stopped at ../mdo.hs:(30,1)-(32,27) _result :: IO (N a) = _ -Stopped at ../mdo.hs:(29,16)-(31,27) +Stopped at ../mdo.hs:(30,16)-(32,27) _result :: IO (N Char) = _ x :: Char = 'h' xs :: [Char] = _ -Stopped at ../mdo.hs:29:30-42 +Stopped at ../mdo.hs:30:30-42 _result :: IO (N Char) = _ f :: N Char = _ l :: N Char = _ x :: Char = 'h' -Stopped at ../mdo.hs:(7,1)-(8,42) +Stopped at ../mdo.hs:(8,1)-(9,42) _result :: IO (N a) = _ diff --git a/testsuite/tests/ghci.debugger/scripts/dynbrk004.stdout b/testsuite/tests/ghci.debugger/scripts/dynbrk004.stdout index ed7fb990a4..dfdfc45a6b 100644 --- a/testsuite/tests/ghci.debugger/scripts/dynbrk004.stdout +++ b/testsuite/tests/ghci.debugger/scripts/dynbrk004.stdout @@ -1,4 +1,4 @@ Breakpoint 0 activated at ../mdo.hs:13:16-30 Breakpoint 1 activated at ../mdo.hs:12:16-30 Breakpoint 2 activated at ../mdo.hs:11:16-30 -Breakpoint 3 activated at ../mdo.hs:14:10-18 +Breakpoint 3 activated at ../mdo.hs:14:16-30 diff --git a/testsuite/tests/ghci/scripts/T4175.stdout b/testsuite/tests/ghci/scripts/T4175.stdout index e439528965..7c063a6481 100644 --- a/testsuite/tests/ghci/scripts/T4175.stdout +++ b/testsuite/tests/ghci/scripts/T4175.stdout @@ -25,6 +25,7 @@ instance Eq () -- Defined in ‘GHC.Classes’ instance Ord () -- Defined in ‘GHC.Classes’ instance Read () -- Defined in ‘GHC.Read’ instance Show () -- Defined in ‘GHC.Show’ +instance Monoid () -- Defined in ‘GHC.Base’ type instance D () () = Bool -- Defined at T4175.hs:22:5 type instance D Int () = String -- Defined at T4175.hs:19:5 data instance B () = MkB -- Defined at T4175.hs:13:15 @@ -38,6 +39,7 @@ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Applicative Maybe -- Defined in ‘GHC.Base’ instance Foldable Maybe -- Defined in ‘Data.Foldable’ instance Traversable Maybe -- Defined in ‘Data.Traversable’ +instance Monoid a => Monoid (Maybe a) -- Defined in ‘GHC.Base’ type instance A (Maybe a) a = a -- Defined at T4175.hs:9:1 data Int = I# Int# -- Defined in ‘GHC.Types’ instance C Int -- Defined at T4175.hs:18:10 diff --git a/testsuite/tests/ghci/scripts/T7627.stdout b/testsuite/tests/ghci/scripts/T7627.stdout index 451c7051df..27135662d4 100644 --- a/testsuite/tests/ghci/scripts/T7627.stdout +++ b/testsuite/tests/ghci/scripts/T7627.stdout @@ -5,6 +5,7 @@ instance Eq () -- Defined in ‘GHC.Classes’ instance Ord () -- Defined in ‘GHC.Classes’ instance Read () -- Defined in ‘GHC.Read’ instance Show () -- Defined in ‘GHC.Show’ +instance Monoid () -- Defined in ‘GHC.Base’ data (##) = (##) -- Defined in ‘GHC.Prim’ () :: () (##) :: (# #) @@ -18,10 +19,11 @@ instance Functor ((,) a) -- Defined in ‘GHC.Base’ instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’ instance (Read a, Read b) => Read (a, b) -- Defined in ‘GHC.Read’ instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’ -instance GHC.Base.Monoid a => Applicative ((,) a) - -- Defined in ‘GHC.Base’ +instance Monoid a => Applicative ((,) a) -- Defined in ‘GHC.Base’ instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ instance Traversable ((,) a) -- Defined in ‘Data.Traversable’ +instance (Monoid a, Monoid b) => Monoid (a, b) + -- Defined in ‘GHC.Base’ data (#,#) (a :: OpenKind) (b :: OpenKind) = (#,#) a b -- Defined in ‘GHC.Prim’ (,) :: a -> b -> (a, b) diff --git a/testsuite/tests/ghci/scripts/ghci011.stdout b/testsuite/tests/ghci/scripts/ghci011.stdout index 0563b83e66..a608f079b5 100644 --- a/testsuite/tests/ghci/scripts/ghci011.stdout +++ b/testsuite/tests/ghci/scripts/ghci011.stdout @@ -8,6 +8,7 @@ instance Show a => Show [a] -- Defined in ‘GHC.Show’ instance Applicative [] -- Defined in ‘GHC.Base’ instance Foldable [] -- Defined in ‘Data.Foldable’ instance Traversable [] -- Defined in ‘Data.Traversable’ +instance Monoid [a] -- Defined in ‘GHC.Base’ data () = () -- Defined in ‘GHC.Tuple’ instance Bounded () -- Defined in ‘GHC.Enum’ instance Enum () -- Defined in ‘GHC.Enum’ @@ -15,6 +16,7 @@ instance Eq () -- Defined in ‘GHC.Classes’ instance Ord () -- Defined in ‘GHC.Classes’ instance Read () -- Defined in ‘GHC.Read’ instance Show () -- Defined in ‘GHC.Show’ +instance Monoid () -- Defined in ‘GHC.Base’ data (,) a b = (,) a b -- Defined in ‘GHC.Tuple’ instance (Bounded a, Bounded b) => Bounded (a, b) -- Defined in ‘GHC.Enum’ @@ -23,7 +25,8 @@ instance Functor ((,) a) -- Defined in ‘GHC.Base’ instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’ instance (Read a, Read b) => Read (a, b) -- Defined in ‘GHC.Read’ instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’ -instance GHC.Base.Monoid a => Applicative ((,) a) - -- Defined in ‘GHC.Base’ +instance Monoid a => Applicative ((,) a) -- Defined in ‘GHC.Base’ instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ instance Traversable ((,) a) -- Defined in ‘Data.Traversable’ +instance (Monoid a, Monoid b) => Monoid (a, b) + -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/scripts/ghci020.stdout b/testsuite/tests/ghci/scripts/ghci020.stdout index bd3a045871..749a244f1f 100644 --- a/testsuite/tests/ghci/scripts/ghci020.stdout +++ b/testsuite/tests/ghci/scripts/ghci020.stdout @@ -2,3 +2,4 @@ data (->) a b -- Defined in ‘GHC.Prim’ instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Functor ((->) r) -- Defined in ‘GHC.Base’ instance Applicative ((->) a) -- Defined in ‘GHC.Base’ +instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/mdo/should_run/mdorun002.hs b/testsuite/tests/mdo/should_run/mdorun002.hs index 191e40039d..0a09451324 100644 --- a/testsuite/tests/mdo/should_run/mdorun002.hs +++ b/testsuite/tests/mdo/should_run/mdorun002.hs @@ -5,6 +5,7 @@ module Main(main) where import Control.Monad.Fix import Control.Monad.ST import Data.STRef +import Prelude hiding (traverse) newtype Node s a = N (STRef s Bool, Node s a, a, Node s a) diff --git a/testsuite/tests/quasiquotation/T7918.hs b/testsuite/tests/quasiquotation/T7918.hs index 7126cb166e..d549671b31 100644 --- a/testsuite/tests/quasiquotation/T7918.hs +++ b/testsuite/tests/quasiquotation/T7918.hs @@ -15,6 +15,7 @@ import Control.Monad import Control.Monad.Trans.State import Data.List import Data.Ord +import Prelude hiding (traverse) type Traverse a = State (SrcSpan, [(Name, SrcSpan)]) a diff --git a/testsuite/tests/typecheck/should_compile/DfltProb1.hs b/testsuite/tests/typecheck/should_compile/DfltProb1.hs index 822a5caac6..397e41e96d 100644 --- a/testsuite/tests/typecheck/should_compile/DfltProb1.hs +++ b/testsuite/tests/typecheck/should_compile/DfltProb1.hs @@ -2,6 +2,7 @@ module DfltProb1 where import Control.Monad.ST +import Prelude hiding (traverse) traverse :: a -> ST s [a] traverse = undefined |