Commit de790860 authored by Mart Lubbers's avatar Mart Lubbers

add instance for zero to Timespec

parent 3f52e4ad
......@@ -97,3 +97,4 @@ timestampToSpec :: !Timestamp -> Timespec
instance < Timespec
instance + Timespec
instance - Timespec
instance zero Timespec
......@@ -203,3 +203,6 @@ where
| tv_nsec < 0
= {tv_sec = t1.tv_sec - t2.tv_sec - 1, tv_nsec = 1000000000 - tv_nsec}
= {tv_sec = t1.tv_sec - t2.tv_sec - 1, tv_nsec = tv_nsec}
instance zero Timespec
where zero = {tv_sec=0, tv_nsec=0}
......@@ -102,3 +102,4 @@ timestampToSpec :: !Timestamp -> Timespec
instance < Timespec
instance + Timespec
instance - Timespec
instance zero Timespec
......@@ -207,3 +207,6 @@ where
| tv_nsec < 0
= {tv_sec = t1.tv_sec - t2.tv_sec - 1, tv_nsec = 1000000000 - tv_nsec}
= {tv_sec = t1.tv_sec - t2.tv_sec - 1, tv_nsec = tv_nsec}
instance zero Timespec
where zero = {tv_sec=0, tv_nsec=0}
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