Skip to content

Instantly share code, notes, and snippets.

@diegoeche
Created October 30, 2009 03:06
Show Gist options
  • Save diegoeche/222076 to your computer and use it in GitHub Desktop.
Save diegoeche/222076 to your computer and use it in GitHub Desktop.
import Control.Arrow
import Data.List
import Data.Ord
import Text.Regex.Posix
articles = ["Crimen y castigo",
"Humillados y ofendidos",
"Fin de la Eternidad",
"Siberiada"]
matches :: String -> String -> Int
matches x = (=~x)
sortArticles x = map snd
. sortBy (comparing fst)
. map (matches x &&& id) $ articles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment