Created
March 4, 2012 19:59
-
-
Save nietaki/1974568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pairLEQ :: (Ord i) => (i, e) -> (i, e) -> Bool | |
pairGT :: (Ord i) => (i, e) -> (i, e) -> Bool | |
pairLEQ (i1, e1) (i2, e2) = i1 <= i2 | |
--pairGT a b = not (pairLEQ a b) | |
pairGT a = not . (pairLEQ a) | |
-- z wykładu 2 | |
pairQS :: (Ord i) => [(i, e)] -> [(i, e)] | |
pairQS [] = [] | |
pairQS (x:xs) = (pairQS (filter (flip pairLEQ x) xs)) | |
++ [x] | |
++ (pairQS (filter (flip pairGT x) xs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment