Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
43e7140a
Commit
43e7140a
authored
Nov 17, 2011
by
Simon Peyton Jones
Browse files
Update test suite following the removal of the default grouping
clause from the SQLlike comprehension notation
parent
ad357819
Changes
15
Hide whitespace changes
Inline
Sidebyside
testsuite/tests/deSugar/should_run/dsrun017.hs
View file @
43e7140a
 Tests grouping WITH a by clause
but WITHOUT a using clause
 Tests grouping WITH a by clause
{# OPTIONS_GHC XTransformListComp #}
module
Main
where
import
GHC.Exts
(
the
)
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
]
\ No newline at end of file
,
then
group
by
dept
using
groupWith
]
\ No newline at end of file
testsuite/tests/deSugar/should_run/dsrun022.hs
View file @
43e7140a
...
...
@@ 4,7 +4,7 @@
module
Main
where
import
GHC.Exts
(
sortWith
,
the
)
import
GHC.Exts
(
sortWith
,
the
,
groupWith
)
employees
=
[
(
"Simon"
,
"MS"
,
80
)
,
(
"Erik"
,
"MS"
,
100
)
...
...
@@ 16,7 +16,7 @@ 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
,
then
group
by
dept
using
groupWith
,
x
<
[
1
,
2
,
3
]
,
y
<
[
4
,
5
,
6
]
,
then
sortWith
by
sum
salary
...
...
testsuite/tests/deSugar/should_run/mc01.hs
View file @
43e7140a
...
...
@@ 4,7 +4,7 @@
module
Main
where
import
GHC.Exts
(
sortWith
,
the
)
import
GHC.Exts
(
sortWith
,
the
,
groupWith
)
employees
=
[
(
"Simon"
,
"MS"
,
80
)
,
(
"Erik"
,
"MS"
,
100
)
...
...
@@ 16,7 +16,7 @@ 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
,
then
group
by
dept
using
groupWith
,
x
<
[
1
,
2
,
3
]
,
y
<
[
4
,
5
,
6
]
,
then
sortWith
by
sum
salary
...
...
testsuite/tests/deSugar/should_run/mc08.hs
View file @
43e7140a
 Tests grouping WITH a by clause
but WITHOUT a using clause
 Tests grouping WITH a by clause
{# OPTIONS_GHC XMonadComprehensions XTransformListComp #}
module
Main
where
import
GHC.Exts
(
the
)
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
]
,
then
group
by
dept
using
groupWith
]
testsuite/tests/parser/should_compile/mc16.hs
View file @
43e7140a
...
...
@@ 9,7 +9,7 @@ foo = [ ()

x
<
[
1
..
10
]
,
then
take
5
,
then
sortWith
by
x
,
then
group
by
x
,
then
group
by
x
using
groupWith
,
then
group
using
inits
,
then
group
by
x
using
groupWith
]
...
...
testsuite/tests/parser/should_compile/read062.hs
View file @
43e7140a
...
...
@@ 9,7 +9,7 @@ foo = [ ()

x
<
[
1
..
10
]
,
then
take
5
,
then
sortWith
by
x
,
then
group
by
x
,
then
group
by
x
using
groupWith
,
then
group
using
inits
,
then
group
by
x
using
groupWith
]
...
...
testsuite/tests/parser/should_fail/readFail043.hs
View file @
43e7140a
...
...
@@ 7,7 +7,7 @@ import GHC.Exts
foo
=
[
()

x
<
[
1
..
10
]
,
then
group
by
x
,
then
group
by
x
using
groupWith
,
then
group
by
x
using
groupWith
,
then
group
using
inits
]
...
...
testsuite/tests/parser/should_fail/readFail043.stderr
View file @
43e7140a
...
...
@@ 7,6 +7,8 @@ readFail043.hs:10:20: Not in scope: `by'
readFail043.hs:10:23: Not in scope: `x'
readFail043.hs:10:25: Not in scope: `using'
readFail043.hs:11:9:
Unexpected transform statement in a list comprehension
Use XTransformListComp
...
...
testsuite/tests/rename/should_compile/T3901.hs
View file @
43e7140a
...
...
@@ 2,13 +2,15 @@
module
T3901
where
import
GHC.Exts
(
groupWith
)
data
Rec
=
Rec
{
a
::
Int
}
deriving
(
Show
)
recs1
=
[
a

Rec
{
a
=
a
}
<
[
Rec
1
],
then
group
by
a
]
recs1
=
[
a

Rec
{
a
=
a
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs2
=
[
a

Rec
{
a
}
<
[
Rec
1
],
then
group
by
a
]
recs2
=
[
a

Rec
{
a
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs3
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
]
recs3
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs4
::
[[
Int
]]
recs4
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
]
recs4
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
testsuite/tests/rename/should_compile/mc11.hs
View file @
43e7140a
...
...
@@ 2,13 +2,15 @@
module
T3901
where
import
GHC.Exts
(
groupWith
)
data
Rec
=
Rec
{
a
::
Int
}
deriving
(
Show
)
recs1
=
[
a

Rec
{
a
=
a
}
<
[
Rec
1
],
then
group
by
a
]
recs1
=
[
a

Rec
{
a
=
a
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs2
=
[
a

Rec
{
a
}
<
[
Rec
1
],
then
group
by
a
]
recs2
=
[
a

Rec
{
a
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs3
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
]
recs3
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
recs4
::
[[
Int
]]
recs4
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
]
recs4
=
[
a

Rec
{
..
}
<
[
Rec
1
],
then
group
by
a
using
groupWith
]
testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs
View file @
43e7140a
...
...
@@ 27,7 +27,6 @@ import Control.Exception.Base
import
Control.Monad
import
Control.Monad.Fix
import
Control.Monad.Group
import
Control.Monad.Instances
import
Control.Monad.Zip
...
...
testsuite/tests/typecheck/should_fail/mc20.hs
View file @
43e7140a
 Checks that the ordering constraint on the
implicit
groupWith is respected
 Checks that the ordering constraint on the groupWith
function
is respected
{# OPTIONS_GHC XMonadComprehensions XTransformListComp #}
module
ShouldFail
where
import
GHC.Exts
(
groupWith
)
data
Unorderable
=
Gnorf

Pinky

Brain
foo
=
[
()

x
<
[
Gnorf
,
Brain
]
,
then
group
by
x
,
then
group
by
x
using
groupWith
]
testsuite/tests/typecheck/should_fail/mc20.stderr
View file @
43e7140a
mc20.hs:1
2:9
:
mc20.hs:1
4:31
:
No instance for (Ord Unorderable)
arising from a use of `
Control.Monad.Group.m
groupWith'
arising from a use of `groupWith'
Possible fix: add an instance declaration for (Ord Unorderable)
In the expression: Control.Monad.Group.mgroupWith
In a stmt of a monad comprehension: then group by x
In the expression: [()  x < [Gnorf, Brain], then group by x]
In the expression: groupWith
In a stmt of a monad comprehension: then group by x using groupWith
In the expression:
[()  x < [Gnorf, Brain], then group by x using groupWith]
testsuite/tests/typecheck/should_fail/tcfail190.hs
View file @
43e7140a
 Checks that the ordering constraint on the
implicit
groupWith is respected
 Checks that the ordering constraint on the groupWith
function
is respected
{# OPTIONS_GHC XTransformListComp #}
module
ShouldFail
where
import
GHC.Exts
(
groupWith
)
data
Unorderable
=
Gnorf

Pinky

Brain
foo
=
[
()

x
<
[
Gnorf
,
Brain
]
,
then
group
by
x
,
then
group
by
x
using
groupWith
]
testsuite/tests/typecheck/should_fail/tcfail190.stderr
View file @
43e7140a
tcfail190.hs:1
2:9
:
tcfail190.hs:1
4:31
:
No instance for (Ord Unorderable)
arising from a use of `
Control.Monad.Group.m
groupWith'
arising from a use of `groupWith'
Possible fix: add an instance declaration for (Ord Unorderable)
In the expression: Control.Monad.Group.mgroupWith
In a stmt of a list comprehension: then group by x
In the expression: [()  x < [Gnorf, Brain], then group by x]
In the expression: groupWith
In a stmt of a list comprehension: then group by x using groupWith
In the expression:
[()  x < [Gnorf, Brain], then group by x using groupWith]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment