diff options
Diffstat (limited to 'week2/mart/StdT.icl')
-rw-r--r-- | week2/mart/StdT.icl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/week2/mart/StdT.icl b/week2/mart/StdT.icl index e49da8a..01bee7d 100644 --- a/week2/mart/StdT.icl +++ b/week2/mart/StdT.icl @@ -7,7 +7,7 @@ import StdEnv instance == T where
== a b = a.m == b.m && a.s == b.s
instance < T where
- < a b = a.m < b.m || a.s < b.s
+ < a b = a.m < b.m || a.s == b.s && a.s < b.s
instance zero T where
zero = {m=zero, s=zero}
@@ -31,8 +31,5 @@ instance toString T where instance fromString T where
fromString a
- | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 3, size a))}
+ | a.[size a - 3] == ':' = {m = toInt (a % (0, (size a) - 4)), s = toInt (a % ((size a) - 2, size a))}
| otherwise = zero
-
-Start :: T
-Start = fromString "12:34"
|