diff options
Diffstat (limited to 'testsuite/tests/deSugar/should_run/mc01.hs')
-rw-r--r-- | testsuite/tests/deSugar/should_run/mc01.hs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/mc01.hs b/testsuite/tests/deSugar/should_run/mc01.hs new file mode 100644 index 0000000000..cf5ca1a0e9 --- /dev/null +++ b/testsuite/tests/deSugar/should_run/mc01.hs @@ -0,0 +1,26 @@ +-- Transformation and grouping stress test + +{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-} + +module Main where + +import GHC.Exts(sortWith, the) + +employees = [ ("Simon", "MS", 80) + , ("Erik", "MS", 100) + , ("Phil", "Ed", 40) + , ("Gordon", "Ed", 45) + , ("Paul", "Yale", 60) ] + +main = putStrLn (show can_still_use_group_function) >> putStrLn (show output) + where + output = [ (the dept, map sum salary, (show x) ++ " and " ++ (show y)) + | (name, dept, salary) <- employees + , then group by dept + , x <- [1, 2, 3] + , y <- [4, 5, 6] + , then sortWith by sum salary + , then take 4 + , then group using replicate 2 ] + group = const "my group function called!" + can_still_use_group_function = group "Mississippi" |