]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MaximumBy.scl
Fixed all line endings of the repository
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / MaximumBy.scl
index c70c9dae820ac9f10bbe82c9e7119448b5078410..abf2f42db90a86bfffe38b33bfe9ee1010b16875 100644 (file)
@@ -1,10 +1,10 @@
-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]  
+--
 9
\ No newline at end of file