diff options
Diffstat (limited to 'testsuite/tests/deSugar/should_run/dsrun021.hs')
-rw-r--r-- | testsuite/tests/deSugar/should_run/dsrun021.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/dsrun021.hs b/testsuite/tests/deSugar/should_run/dsrun021.hs new file mode 100644 index 0000000000..7489f77a4a --- /dev/null +++ b/testsuite/tests/deSugar/should_run/dsrun021.hs @@ -0,0 +1,22 @@ +-- Transformation stress test
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module Main where
+
+import Data.List(takeWhile)
+import GHC.Exts(sortWith)
+
+employees = [ ("Simon", "MS", 80)
+ , ("Erik", "MS", 100)
+ , ("Phil", "Ed", 40)
+ , ("Gordon", "Ed", 45)
+ , ("Paul", "Yale", 60)]
+
+main = putStrLn (show output)
+ where
+ output = [ (dept, salary)
+ | (name, dept, salary) <- employees
+ , then sortWith by salary
+ , then filter by salary > 50
+ , then take 1 ]
\ No newline at end of file |