summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run/mc02.hs
blob: 77adf26c37bba966457e969e20bb4b2f2730b82d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- Transformation stress test

{-# OPTIONS_GHC -XMonadComprehensions -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 ]