Commit a07c8a4f authored by dreixel's avatar dreixel
Browse files

Adapting the testsuite for the new generic deriving mechanism.

parent 67840816
......@@ -61,8 +61,11 @@ foo xss = Main.concatMap (\xs -> Main.map (+1) xs) xss
instance StreamableSequence [] where
stream = listToStream
unstream = streamToList
-- These inline pragmas are useless (see #5084)
{-
{-# INLINE stream #-}
{-# INLINE unstream #-}
-}
listToStream :: [a] -> Stream a
listToStream xs = Stream next xs
......@@ -104,8 +107,11 @@ class StreamableSequence seq where
unstream :: Stream a -> seq a
-- axiom: stream . unstream = id
-- These inline pragmas are useless (see #5084)
{-
{-# INLINE stream #-}
{-# INLINE unstream #-}
-}
{-
--version that does not require the sequence type
......
{-# LANGUAGE Generics, TypeOperators #-}
-- Trac #2573
module ShouldCompile where
import GHC.Base
class Tag a where
nCons :: a -> Int
nCons {| a :*: b |} _ = 1
nCons {| a :+: b |} _ = 1
nCons {| Unit |} _ = 1
......@@ -296,7 +296,6 @@ test('LoopOfTheDay3', normal, compile, [''])
test('T1470', normal, compile, [''])
test('T2572', normal, compile, [''])
test('T2573', normal, compile, [''])
test('T2735', normal, compile, [''])
test('T2799', normal, compile, [''])
test('T3219', normal, compile, [''])
......@@ -342,4 +341,4 @@ test('T4912', extra_clean(['T4912a.hi', 'T4912a.o']),
test('T4952', normal, compile, [''])
test('T4969', normal, compile, [''])
test('T5120', normal, compile, [''])
\ No newline at end of file
test('T5120', normal, compile, [''])
......@@ -150,7 +150,6 @@ test('tcfail159', normal, compile_fail, [''])
test('tcfail160', normal, compile_fail, [''])
test('tcfail161', normal, compile_fail, [''])
test('tcfail162', normal, compile_fail, [''])
test('tcfail163', normal, compile_fail, [''])
test('tcfail164', normal, compile_fail, [''])
test('tcfail165', normal, compile_fail, [''])
test('tcfail166', normal, compile_fail, [''])
......
{-# LANGUAGE ConstrainedClassMethods, Generics, Rank2Types, TypeOperators #-}
-- Derivable type class with a higher-rank method
-- Currently this does not work, but it crashed GHC 6.5, so
-- this tests that the error message is civilised.
module Foo where
import GHC.Base
class ChurchEncode k where
match :: k
-> z
-> (forall a b z. a -> b -> z) {- product -}
-> (forall a z. a -> z) {- left -}
-> (forall a z. a -> z) {- right -}
-> z
match {| Unit |} Unit unit prod left right = unit
match {| a :*: b |} (x :*: y) unit prod left right = prod x y
match {| a :+: b |} (Inl l) unit prod left right = left l
match {| a :+: b |} (Inr r) unit prod left right = right r
instance ChurchEncode Bool
tcfail163.hs:12:1:
Generic method type is too complex
match :: forall k.
ChurchEncode k =>
forall z.
k
-> z
-> (forall a b z. a -> b -> z)
-> (forall a z. a -> z)
-> (forall a z. a -> z)
-> z
You can only use type variables, arrows, lists, and tuples
When checking the class method:
match :: k
-> z
-> (forall a b z. a -> b -> z)
-> (forall a z. a -> z)
-> (forall a z. a -> z)
-> z
In the class declaration for `ChurchEncode'
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