Skip to content

Instantly share code, notes, and snippets.

@qaisjp
Forked from Fasand/tut2 ex4
Last active October 9, 2016 14:58
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save qaisjp/558694530883cce88a4c3911d85556ad to your computer and use it in GitHub Desktop.
lookUp :: Char -> [(Char, Char)] -> Char
lookUp needle xs = if (null selected) then needle else snd $ selected !! 0
where
selected = [x | x <- xs, fst x == needle]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment