diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-05 16:37:13 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-11-05 16:37:13 +0100 |
commit | abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec (patch) | |
tree | a8e53f479fd7e75fb89648f44a2baabe79e435f0 /ws2015/FFP | |
parent | 753e45b3d5f5e3ad2bd083ee753f72973e74502f (diff) | |
download | uni-abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec.tar uni-abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec.tar.gz uni-abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec.tar.bz2 uni-abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec.tar.xz uni-abb5d050e3c4175dde65a96e5f8cf7c822d5e2ec.zip |
saving boilerplate
Diffstat (limited to 'ws2015/FFP')
-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 | ||