summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer/ListComprehensions.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/printer/ListComprehensions.hs')
-rw-r--r--testsuite/tests/printer/ListComprehensions.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/printer/ListComprehensions.hs b/testsuite/tests/printer/ListComprehensions.hs
new file mode 100644
index 0000000000..0738da5173
--- /dev/null
+++ b/testsuite/tests/printer/ListComprehensions.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE ParallelListComp,
+ TransformListComp,
+ RecordWildCards #-}
+-- MonadComprehensions,
+
+module ListComprehensions where
+
+
+
+import GHC.Exts
+import qualified Data.Map as M
+import Data.Ord (comparing)
+import Data.List (sortBy)
+
+-- Let’s look at a simple, normal list comprehension to start:
+
+parallelListComp :: [Int]
+parallelListComp = [ x + y * z
+ | x <- [0..10]
+ | y <- [10..20]
+ | z <- [20..30]
+ ]
+
+oldest :: [Int] -> [String]
+oldest tbl = [ "str"
+ | n <- tbl
+ , then id
+ ]