summaryrefslogtreecommitdiff
path: root/testsuite/tests/ado
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ado')
-rw-r--r--testsuite/tests/ado/ado004.hs18
-rw-r--r--testsuite/tests/ado/ado004.stderr8
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/ado/ado004.hs b/testsuite/tests/ado/ado004.hs
index fa3c7231de..e7166c008e 100644
--- a/testsuite/tests/ado/ado004.hs
+++ b/testsuite/tests/ado/ado004.hs
@@ -16,6 +16,19 @@ test1a f = do
y <- f 4
return $ x + y
+-- When one of the statements is a BodyStmt
+test1b :: Applicative f => (Int -> f Int) -> f Int
+test1b f = do
+ x <- f 3
+ f 4
+ return x
+
+test1c :: Applicative f => (Int -> f Int) -> f Int
+test1c f = do
+ f 3
+ x <- f 4
+ return x
+
-- Test we can also infer the Applicative version of the type
test2 f = do
x <- f 3
@@ -32,6 +45,11 @@ test2c f = do
x <- f 3
return $ x + 1
+-- with a BodyStmt
+test2d f = do
+ f 3
+ return 4
+
-- Test for just one statement
test2b f = do
return (f 3)
diff --git a/testsuite/tests/ado/ado004.stderr b/testsuite/tests/ado/ado004.stderr
index 9b95e3bd3d..a3ef9e9158 100644
--- a/testsuite/tests/ado/ado004.stderr
+++ b/testsuite/tests/ado/ado004.stderr
@@ -3,6 +3,10 @@ TYPE SIGNATURES
forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int
test1a ::
forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int
+ test1b ::
+ forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int
+ test1c ::
+ forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int
test2 ::
forall (f :: * -> *) t b.
(Num b, Num t, Applicative f) =>
@@ -17,6 +21,10 @@ TYPE SIGNATURES
forall (f :: * -> *) t b.
(Num b, Num t, Functor f) =>
(t -> f b) -> f b
+ test2d ::
+ forall (f :: * -> *) t1 b t2.
+ (Num b, Num t1, Functor f) =>
+ (t1 -> f t2) -> f b
test3 ::
forall (m :: * -> *) t1 t2 a.
(Num t1, Monad m) =>