-import "Prelude" hiding (maximumBy)\r
-\r
-maximumBy :: Ord b => (a -> b) -> [a] -> a\r
-maximumBy f = snd . foldl1 maxF . map (\x -> (f x, x))\r
- where\r
- maxF (a @ (aV,_)) (b @ (bV,_)) = if aV >= bV then a else b\r
- \r
-main = maximumBy (`mod` 10) [1::Integer, 14, 23, 9, 14, 67] \r
---\r
+import "Prelude" hiding (maximumBy)
+
+maximumBy :: Ord b => (a -> b) -> [a] -> a
+maximumBy f = snd . foldl1 maxF . map (\x -> (f x, x))
+ where
+ maxF (a @ (aV,_)) (b @ (bV,_)) = if aV >= bV then a else b
+
+main = maximumBy (`mod` 10) [1::Integer, 14, 23, 9, 14, 67]
+--