Commit 4a14e8e0 authored by simonpj's avatar simonpj
Browse files

[project @ 2002-05-27 15:56:11 by simonpj]

Add pattern-match negation test
parent d5ea9996
......@@ -26,3 +26,4 @@ test "tcrun018" { vtr("", "", "") }
test "tcrun019" { vtr("", "", "") }
test "tcrun020" { vtr("", "", "") }
test "tcrun021" { vtr("-package data", "", "") }
test "tcrun022" { vtr("", "", "") }
-- 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment