Verified Commit daff4dc8 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl Committed by Camil Staps

add strictness annotations to instances of == and < for tuples

parent c0895b83
......@@ -56,11 +56,11 @@ snd3 tuple :== t2 where (_, t2, _) = tuple
*/
thd3 tuple :== t3 where (_, _, t3) = tuple
instance == (a,b) | Eq a & Eq b
instance == (a,b,c) | Eq a & Eq b & Eq c
instance == (a,b) | Eq a & Eq b :: !(!a,b) !(!a,b) -> Bool | Eq a & Eq b
instance == (a,b,c) | Eq a & Eq b & Eq c :: !(!a,b,c) !(!a,b,c) -> Bool | Eq a & Eq b & Eq c
instance < (a,b) | Ord a & Ord b
instance < (a,b,c) | Ord a & Ord b & Ord c
instance < (a,b) | Ord a & Ord b :: !(!a,b) !(!a,b) -> Bool | Ord a & Ord b
instance < (a,b,c) | Ord a & Ord b & Ord c :: !(!a,b,c) !(!a,b,c) -> Bool | Ord a & Ord b & Ord c
/**
* Apply functions to both elements of a two-tuple.
......
......@@ -23,17 +23,17 @@ thd3 tuple :== t3 where (_, _, t3) = tuple
instance == (a,b) | Eq a & Eq b
where
(==) ::!(a,b) !(a,b) -> Bool | Eq a & Eq b
(==) ::!(!a,b) !(!a,b) -> Bool | Eq a & Eq b
(==) (x1,y1) (x2,y2) = x1==x2 && y1==y2
instance == (a,b,c) | Eq a & Eq b & Eq c
where
(==) ::!(a,b,c) !(a,b,c) -> Bool | Eq a & Eq b & Eq c
(==) ::!(!a,b,c) !(!a,b,c) -> Bool | Eq a & Eq b & Eq c
(==) (x1,y1,z1) (x2,y2,z2) = x1==x2 && y1==y2 && z1==z2
instance < (a,b) | Ord a & Ord b
where
(<) ::!(a,b) !(a,b) -> Bool | Ord a & Ord b
(<) ::!(!a,b) !(!a,b) -> Bool | Ord a & Ord b
(<) (x1,y1) (x2,y2)
| x1<x2
= True
......@@ -44,7 +44,7 @@ instance < (a,b) | Ord a & Ord b
instance < (a,b,c) | Ord a & Ord b & Ord c
where
(<) ::!(a,b,c) !(a,b,c) -> Bool | Ord a & Ord b & Ord c
(<) ::!(!a,b,c) !(!a,b,c) -> Bool | Ord a & Ord b & Ord c
(<) (x1,y1,z1) (x2,y2,z2)
| x1<x2
= True
......
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