File tree 1 file changed +7
-5
lines changed 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,26 @@ import Test.QuickCheck
7
7
import Test.QuickCheck.Functions
8
8
import Test.QuickCheck.Classes
9
9
10
+ type Ty = Maybe Number
11
+
10
12
main = do
11
13
12
14
let ty = Just 0
13
15
14
16
trace " test equality"
15
17
check1 $ \n -> Just n == Just n
16
- assert $ Nothing == Nothing :: Maybe Number
18
+ assert $ Nothing == Nothing :: Ty
17
19
18
20
trace " test inequality"
19
- check1 $ \n -> not $ Just n = = Nothing
20
- check1 $ \n -> not $ Nothing = = Just n
21
- check1 $ \n -> not $ Just n = = Just (n + 1 )
21
+ check1 $ \n -> Just n / = Nothing
22
+ check1 $ \n -> Nothing / = Just n
23
+ check1 $ \n -> Just n / = Just (n + 1 )
22
24
23
25
trace " test order"
24
26
check2 $ \x y -> compare (Just x) (Just y) == compare x y
25
27
check1 $ \x -> compare Nothing (Just x) == LT
26
28
check1 $ \x -> compare (Just x) Nothing == GT
27
- check1 $ \x -> compare Nothing (Nothing :: Maybe Number ) == EQ
29
+ check1 $ \x -> compare Nothing (Nothing :: Ty ) == EQ
28
30
29
31
trace " maybe should transform a value wrapped in a Just"
30
32
check1 $ \n -> maybe 0 negate (Just n) == -n
You can’t perform that action at this time.
0 commit comments