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

{-# OPTIONS_GHC -XTransformListComp #-}

module Main where

import GHC.Exts(the,groupWith)

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 using groupWith ]