diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-03-26 09:16:52 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-03-26 09:16:52 +0100 |
commit | 6eb9500b3f0ad70db9d2f0bf7fc1a1fb9a2f8cf9 (patch) | |
tree | 10991a48daef3840264664ae4f2881b28c3b7031 | |
parent | 528aba0bf9a233864970804b5d72d01a0bcf9adb (diff) | |
parent | 429183f24c73b20a6489e5452427b612305b9675 (diff) | |
download | haskell-6eb9500b3f0ad70db9d2f0bf7fc1a1fb9a2f8cf9.tar.gz |
Merge branch 'master' of http://darcs.haskell.org//testsuite
15 files changed, 56 insertions, 40 deletions
diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 008c664786..38f125e43a 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -41,6 +41,7 @@ expectedGhcOnlyExtensions = ["ParallelArrays", "TraditionalRecordSyntax", "DataKinds", "PolyKinds", + "ExplicitNamespaces", "InstanceSigs", "CApiFFI"] diff --git a/testsuite/tests/ghci/scripts/T2766.script b/testsuite/tests/ghci/scripts/T2766.script index 87e9bb3918..84b83461b7 100644 --- a/testsuite/tests/ghci/scripts/T2766.script +++ b/testsuite/tests/ghci/scripts/T2766.script @@ -1,4 +1,6 @@ -- Test Trac #2766 :set -XTypeOperators :m Control.Arrow -:t first :: Arrow (~>) => b~>c -> (b, d)~>(c, d) +:t first :: Arrow to => b `to` c -> (b, d) `to` (c, d) +type a ~> b = a -> b +:t first :: b~>c -> (b, d)~>(c, d) diff --git a/testsuite/tests/ghci/scripts/T2766.stdout b/testsuite/tests/ghci/scripts/T2766.stdout index abe1ca2c95..f8ee42ff6a 100644 --- a/testsuite/tests/ghci/scripts/T2766.stdout +++ b/testsuite/tests/ghci/scripts/T2766.stdout @@ -1,2 +1,3 @@ -first :: Arrow (~>) => b~>c -> (b, d)~>(c, d)
- :: Arrow (~>) => (~>) b c -> (~>) (b, d) (c, d)
+first :: Arrow to => b `to` c -> (b, d) `to` (c, d) + :: Arrow to => to b c -> to (b, d) (c, d) +first :: b~>c -> (b, d)~>(c, d) :: (b ~> c) -> (b, d) ~> (c, d) diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.hs b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.hs index 2f4b7c1bcb..ff88ec70b2 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.hs +++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.hs @@ -1,5 +1,7 @@ module ShouldCompile where +data a <--> b = Mk a b + test :: [a] -- ^ doc1 -> a <--> b -> [a] -- ^ blabla diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.stderr index d74422461e..6d9a8b2181 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.stderr +++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA028.stderr @@ -1,6 +1,7 @@ ==================== Parser ==================== module ShouldCompile where +data (<-->) a b = Mk a b test :: [a] <document comment> -> (a <--> (b -> [a])) <document comment> test xs ys = xs diff --git a/testsuite/tests/haddock/should_compile_noflag_haddock/haddockC028.hs b/testsuite/tests/haddock/should_compile_noflag_haddock/haddockC028.hs index 3f8abc19d3..bbf649d357 100644 --- a/testsuite/tests/haddock/should_compile_noflag_haddock/haddockC028.hs +++ b/testsuite/tests/haddock/should_compile_noflag_haddock/haddockC028.hs @@ -1,5 +1,7 @@ module ShouldCompile where +data a <--> b = Mk a b + test :: [a] -- ^ doc1 -> a <--> b -> [a] -- ^ doc3 diff --git a/testsuite/tests/module/mod89.stderr b/testsuite/tests/module/mod89.stderr index ddf38b0d13..c4eb78e428 100644 --- a/testsuite/tests/module/mod89.stderr +++ b/testsuite/tests/module/mod89.stderr @@ -1,2 +1,2 @@ -mod89.hs:3:19: parse error on input `(' +mod89.hs:3:16: Module `Prelude' does not export `map(..)' diff --git a/testsuite/tests/polykinds/MonoidsFD.hs b/testsuite/tests/polykinds/MonoidsFD.hs index 8bfb1637c1..7cf9a599dd 100644 --- a/testsuite/tests/polykinds/MonoidsFD.hs +++ b/testsuite/tests/polykinds/MonoidsFD.hs @@ -18,9 +18,9 @@ import Data.Monoid (Monoid(..)) -- First we define the type class Monoidy: -class Monoidy (~>) comp id m | m (~>) → comp id where - munit :: id ~> m - mjoin :: m `comp` m ~> m +class Monoidy to comp id m | m to → comp id where + munit :: id `to` m + mjoin :: (m `comp` m) `to` m -- We use functional dependencies to help the typechecker understand that -- m and ~> uniquely determine comp (times) and id. diff --git a/testsuite/tests/polykinds/MonoidsTF.hs b/testsuite/tests/polykinds/MonoidsTF.hs index f0dc2be536..f289912ec6 100644 --- a/testsuite/tests/polykinds/MonoidsTF.hs +++ b/testsuite/tests/polykinds/MonoidsTF.hs @@ -17,11 +17,11 @@ import Data.Monoid (Monoid(..)) -- First we define the type class Monoidy: -class Monoidy ((~>) :: k0 -> k1 -> *) (m :: k1) where - type MComp (~>) m :: k1 -> k1 -> k0 - type MId (~>) m :: k0 - munit :: MId (~>) m ~> m - mjoin :: MComp (~>) m m m ~> m +class Monoidy (to :: k0 -> k1 -> *) (m :: k1) where + type MComp to m :: k1 -> k1 -> k0 + type MId to m :: k0 + munit :: MId to m `to` m + mjoin :: MComp to m m m `to` m -- We use functional dependencies to help the typechecker understand that -- m and ~> uniquely determine comp (times) and id. diff --git a/testsuite/tests/rename/should_compile/T4239.stdout b/testsuite/tests/rename/should_compile/T4239.stdout index a60e8a4efe..25623f0174 100644 --- a/testsuite/tests/rename/should_compile/T4239.stdout +++ b/testsuite/tests/rename/should_compile/T4239.stdout @@ -1 +1 @@ -import T4239A ( (:+++)((:+++), (:---), X) ) +import T4239A ( type (:+++)((:+++), (:---), X) ) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index ce6f95e56f..76708bb30b 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -352,6 +352,7 @@ test('tc257', normal, compile, ['']) test('tc258', normal, compile, ['']) test('tc259', normal, compile, ['']) test('tc260', normal, compile, ['']) +test('tc261', normal, compile, ['']) test('GivenOverlapping', normal, compile, ['']) test('SilentParametersOverlapping', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/tc192.hs b/testsuite/tests/typecheck/should_compile/tc192.hs index 3337954ade..5af64f344d 100644 --- a/testsuite/tests/typecheck/should_compile/tc192.hs +++ b/testsuite/tests/typecheck/should_compile/tc192.hs @@ -15,7 +15,7 @@ import Control.Arrow -- comp1 :: Arrow (-=>) => b-=>c -> c-=>d -> b-=>d -comp1 :: Arrow (~>) => b~>c -> c~>d -> b~>d +comp1 :: Arrow to => b `to` c -> c `to` d -> b `to` d comp1 f g = proc x -> do b <- f -< x g -< b @@ -23,26 +23,26 @@ comp1 f g = proc x -> do -- arrowp produces -- comp1 f g = (f >>> g) -comp :: Arrow (~>) => (b~>c, c~>d)~>(b~>d) +comp :: Arrow to => (b `to` c, c `to` d) `to` (b `to` d) comp = arr (uncurry (>>>)) --- app :: Arrow (~>) => (b c, b)~>c +-- app :: Arrow to => (b c, b) `to` c type R = Float type I = Int -z1,z2 :: Arrow (~>) => I~>(R~>R) +z1,z2 :: Arrow to => I `to` (R `to` R) z1 = undefined z2 = z1 -z3 :: Arrow (~>) => (I,I)~>(R~>R,R~>R) +z3 :: Arrow to => (I,I) `to` (R `to` R,R `to` R) z3 = z1 *** z2 -z4 :: Arrow (~>) => (I,I)~>(R~>R) +z4 :: Arrow to => (I,I) `to` (R `to` R) z4 = z3 >>> comp -comp4,comp5 :: Arrow (~>) => - b~>(c~>d) -> e~>(d~>f) -> (b,e)~>(c~>f) +comp4,comp5 :: Arrow to => + b `to` (c `to` d) -> e `to` (d `to` f) -> (b,e) `to` (c `to` f) comp4 g f = proc (b,e) -> do g' <- g -< b @@ -51,7 +51,7 @@ comp4 g f = proc (b,e) -> do comp5 g f = (g *** f) >>> comp -lam,lam2 :: Arrow (~>) => (e,b)~>c -> e~>(b~>c) +lam,lam2 :: Arrow to => (e,b) `to` c -> e `to` (b `to` c) lam f = arr $ \ e -> arr (pair e) >>> f @@ -65,7 +65,7 @@ lam2 f = proc e -> returnA -< c) -- I desugared with the arrows preprocessor, removed extra parens and --- renamed "arr" (~>) "pure", (~>) get +-- renamed "arr" to "pure", to get -- -- lam f = pure (\ e -> pure (\ b -> (e, b)) >>> f) @@ -85,27 +85,27 @@ curry4 f = \ e -> f . (pair e) -comp6 :: Arrow (~>) => b~>(c~>d) -> e~>(d~>f) - -> b~>(e~>(c~>f)) +comp6 :: Arrow to => b `to` (c `to` d) -> e `to` (d `to` f) + -> b `to` (e `to` (c `to` f)) comp6 g f = lam $ comp5 g f -- What about uncurrying? --- uncurryA :: Arrow (~>) => b~>(c~>d) --- -> (b,c)~>d +-- uncurryA :: Arrow to => b `to` (c `to` d) +-- -> (b,c) `to` d -- uncurryA f = proc (b,c) -> do -- f' <- f -< b -- returnA -< f' c -- Why "lam" instead of "curryA" (good name also): so I can use Arrows --- lambda notation, similar (~>) +-- lambda notation, similar to compF g f = \ b e -> g b . f e --- But I haven't figured out how (~>). +-- But I haven't figured out how to. --- comp7 :: Arrow (~>) => b~>(c~>d) -> e~>(d~>f) --- -> b~>(e~>(c~>f)) +-- comp7 :: Arrow to => b `to` (c `to` d) -> e `to` (d `to` f) +-- -> b `to` (e `to` (c `to` f)) -- comp7 g f = proc b -> proc e -> do -- g' <- g -< b -- f' <- f -< e @@ -117,29 +117,29 @@ compF g f = \ b e -> g b . f e -- (| lam (\ b -> undefined) |) -- Oh! The arrow syntax allows bindings with *infix* operators. And I --- don't know how (~>) finish comp7. +-- don't know how to finish comp7. -- Uncurried forms: -comp8 :: Arrow (~>) => (b,c)~>d -> (e,d)~>k -> (b,c,e)~>k +comp8 :: Arrow to => (b,c) `to` d -> (e,d) `to` k -> (b,c,e) `to` k comp8 g f = proc (b,c,e) -> do d <- g -< (b,c) f -< (e,d) --- This looks like straightforward~>translation. With insertions of --- curry & uncurry operators, it'd probably be easy (~>) handle curried +-- This looks like straightforward `to` translation. With insertions of +-- curry & uncurry operators, it'd probably be easy to handle curried -- definitions as well. -- Simpler example, for experimentation -comp9 :: Arrow (~>) => (c,d)~>e -> b~>d -> (b,c)~>e +comp9 :: Arrow to => (c,d) `to` e -> b `to` d -> (b,c) `to` e comp9 g f = proc (b,c) -> do d <- f -< b g -< (c,d) -- Desugared: -comp9' :: Arrow (~>) => (c,d)~>e -> b~>d -> (b,c)~>e +comp9' :: Arrow to => (c,d) `to` e -> b `to` d -> (b,c) `to` e comp9' g f = first f >>> arr (\ (d,c) -> (c,d)) >>> g diff --git a/testsuite/tests/typecheck/should_compile/tc261.hs b/testsuite/tests/typecheck/should_compile/tc261.hs new file mode 100644 index 0000000000..3269c7ea82 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/tc261.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeOperators #-} +module TcOK where + +newtype (f <.> g) a = Compose (f (g a)) diff --git a/testsuite/tests/typecheck/should_fail/tcfail094.stderr b/testsuite/tests/typecheck/should_fail/tcfail094.stderr index 8cd67b632b..c5dcc172d5 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail094.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail094.stderr @@ -1,2 +1,3 @@ -tcfail094.hs:7:14: parse error on input `1' +tcfail094.hs:7:14: + Illegal literal in type (use -XDataKinds to enable): 1 diff --git a/testsuite/tests/typecheck/should_fail/tcfail173.stderr b/testsuite/tests/typecheck/should_fail/tcfail173.stderr index ee8f59b525..4bda7d5c4c 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail173.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail173.stderr @@ -1,3 +1,4 @@ -tcfail173.hs:5:10: - Malformed head of type or class declaration: (f <.> g) a +tcfail173.hs:5:12: + Illegal declaration of a type or class operator `<.>' + Use -XTypeOperators to declare operators in type and declarations |