mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
6 ex2
This commit is contained in:
+11
-4
@@ -25,10 +25,17 @@ instance Eq Country where
|
|||||||
-- Remember minimal complete definitions!
|
-- Remember minimal complete definitions!
|
||||||
|
|
||||||
instance Ord Country where
|
instance Ord Country where
|
||||||
compare = todo -- implement me?
|
compare Finland Norway = LT
|
||||||
(<=) = todo -- and me?
|
compare Finland Switzerland = LT
|
||||||
min = todo -- and me?
|
compare Norway Switzerland = LT
|
||||||
max = todo -- and me?
|
compare Finland Finland = EQ
|
||||||
|
compare Norway Norway = EQ
|
||||||
|
compare Switzerland Switzerland = EQ
|
||||||
|
compare _ _ = GT
|
||||||
|
|
||||||
|
--(<=) = todo -- and me?
|
||||||
|
--min = todo -- and me?
|
||||||
|
--max = todo -- and me?
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
-- Ex 3: Implement an Eq instance for the type Name which contains a String.
|
-- Ex 3: Implement an Eq instance for the type Name which contains a String.
|
||||||
|
|||||||
Reference in New Issue
Block a user