Created
November 17, 2011 14:14
-
-
Save qrilka/1373226 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
numberedParams :: [(String, String)] -> [String] | |
numberedParams params = map snd $ filter fst $ zipWith check "123456789" sorted | |
where | |
check ch ('$':[ch2], v) = (ch==ch2, v) | |
check ch (_, v) = (False, v) | |
sorted = sortBy (comparing fst) numbered | |
numbered = filter (\(a,b) -> a =~ ("\\$[1-9]" :: String) :: Bool) params |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment