diff options
| -rw-r--r-- | ws2015/FFP/blaetter/03/FFP_U03_Funktoren.hs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/ws2015/FFP/blaetter/03/FFP_U03_Funktoren.hs b/ws2015/FFP/blaetter/03/FFP_U03_Funktoren.hs index df5de5a..88ee00f 100644 --- a/ws2015/FFP/blaetter/03/FFP_U03_Funktoren.hs +++ b/ws2015/FFP/blaetter/03/FFP_U03_Funktoren.hs | |||
| @@ -182,20 +182,10 @@ check l x = (map length . groupBy ((==) `on` length)) (take x l) | |||
| 182 | 182 | ||
| 183 | instance Eq a => Eq (Options a) where | 183 | instance Eq a => Eq (Options a) where |
| 184 | None == None = True | 184 | None == None = True |
| 185 | None == _ = False | ||
| 186 | One a == One a' = a == a' | 185 | One a == One a' = a == a' |
| 187 | One _ == _ = False | ||
| 188 | Two a b == Two a' b' = a == a' && b == b' | 186 | Two a b == Two a' b' = a == a' && b == b' |
| 189 | Two _ _ == _ = False | ||
| 190 | Three a b c == Three a' b' c' = a == a' && b == b' && c == c' | 187 | Three a b c == Three a' b' c' = a == a' && b == b' && c == c' |
| 191 | Three _ _ _ == _ = False | 188 | _ == _ = False |
| 192 | 189 | ||
| 193 | instance Ord a => Ord (Tree a) where | 190 | instance Ord a => Ord (Tree a) where |
| 194 | compare (Node x xs) (Node x' xs') = compare x x' `mappend` compare xs xs' | 191 | compare (Node x xs) (Node x' xs') = compare x x' `mappend` compare xs xs' |
| 195 | where | ||
| 196 | -- Siehe Data.Monoid | ||
| 197 | mappend LT _ = LT | ||
| 198 | mappend EQ EQ = EQ | ||
| 199 | mappend EQ LT = LT | ||
| 200 | mappend EQ GT = GT | ||
| 201 | mappend GT _ = GT | ||
