summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/printer')
-rw-r--r--testsuite/tests/printer/Ppr020.hs8
-rw-r--r--testsuite/tests/printer/PprArrowLambdaCase.hs8
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/printer/Ppr020.hs b/testsuite/tests/printer/Ppr020.hs
index f567f726a1..d930a73ac3 100644
--- a/testsuite/tests/printer/Ppr020.hs
+++ b/testsuite/tests/printer/Ppr020.hs
@@ -4,6 +4,14 @@ foo = f >>= \case
Just h -> loadTestDB (h ++ "/.testdb")
Nothing -> fmap S.Right initTestDB
+foo = f >>= \cases
+ x (Just h) -> loadTestDB (h ++ "/.testdb")
+ _ Nothing -> fmap S.Right initTestDB
+
+foo = f >>= \cases
+ | a -> loadTestDB (h ++ "/.testdb")
+ | b -> fmap S.Right initTestDB
+
{-| Is the alarm set - i.e. will it go off at some point in the future even if
`setAlarm` is not called? -}
isAlarmSetSTM :: AlarmClock -> STM Bool
diff --git a/testsuite/tests/printer/PprArrowLambdaCase.hs b/testsuite/tests/printer/PprArrowLambdaCase.hs
index c678339890..9760d1372e 100644
--- a/testsuite/tests/printer/PprArrowLambdaCase.hs
+++ b/testsuite/tests/printer/PprArrowLambdaCase.hs
@@ -16,3 +16,11 @@ foo = proc x ->
| otherwise -> returnA -< "small " ++ show x
Nothing -> returnA -< "none")
|) x
+
+foo :: ArrowChoice p => p (Maybe Int) String
+foo = proc x ->
+ (| id (\cases
+ y (Just x) | x > 100 -> returnA -< "big " ++ show x
+ | otherwise -> returnA -< "small " ++ show x
+ _ Nothing -> returnA -< "none")
+ |) 1 x