summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile/mc09.hs
blob: 1e1f2819b58e10881645b45f84f47b708d834dc8 (plain)
1
2
3
4
5
6
7
8
9
10
{-# LANGUAGE MonadComprehensions, TransformListComp #-}

-- Test performed for TransformListComp and should work for monad comp as well:
-- GHC 7.0.1 failed because the renamer didn't attach
-- all the used variables to the TransformListComp constructor

module List where

intersectFront :: Ord a => [a] -> [a] -> [a]
intersectFront xs ys = [x | (x,y) <- zip xs ys, then takeWhile by x == y]