summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run/mc08.hs
blob: 24dd3beb4ce18520257edd53d550a44385d887d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Tests grouping WITH a by clause but WITHOUT a using clause

{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}

module Main where

import GHC.Exts(the)

main = putStrLn (show output)
  where
    output = [ (the dept, sum salary, name) 
             | (dept, salary, name) <- [("A", 1, "Bob"), ("B", 2, "Fred"), ("A", 5, "Jim"), ("A", 9, "Jim")]
             , then group by dept ]