Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4a14e8e0
Commit
4a14e8e0
authored
May 27, 2002
by
simonpj
Browse files
[project @ 2002-05-27 15:56:11 by simonpj]
Add pattern-match negation test
parent
d5ea9996
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/typecheck/should_run/all.T
View file @
4a14e8e0
...
...
@@ -26,3 +26,4 @@ test "tcrun018" { vtr("", "", "") }
test
"
tcrun019
"
{
vtr
("",
"",
"")
}
test
"
tcrun020
"
{
vtr
("",
"",
"")
}
test
"
tcrun021
"
{
vtr
("
-package data
",
"",
"")
}
test
"
tcrun022
"
{
vtr
("",
"",
"")
}
testsuite/tests/ghc-regress/typecheck/should_run/tcrun022.hs
0 → 100644
View file @
4a14e8e0
-- Test the implementation of negative patterns.
-- We should get a call to 'negate'.
module
Main
where
main
=
print
(
minusTwo
,
trueOrFalse
)
minusTwo
=
-
2
::
N
trueOrFalse
=
case
minusTwo
of
-
2
->
True
_
->
False
data
N
=
Negate
N
|
FromInteger
Integer
deriving
(
Eq
,
Show
)
instance
Num
N
where
negate
=
Negate
fromInteger
=
FromInteger
testsuite/tests/ghc-regress/typecheck/should_run/tcrun022.stdout
0 → 100644
View file @
4a14e8e0
\ No newline at end of file
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