Skip to content

Instantly share code, notes, and snippets.

@qrilka
Created November 17, 2011 14:14
Show Gist options
  • Save qrilka/1373226 to your computer and use it in GitHub Desktop.
Save qrilka/1373226 to your computer and use it in GitHub Desktop.
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