Skip to content

Instantly share code, notes, and snippets.

@argv0
Created January 24, 2013 23:55
Show Gist options
  • Save argv0/4629885 to your computer and use it in GitHub Desktop.
Save argv0/4629885 to your computer and use it in GitHub Desktop.
import Data.List
myalist = [("foo", (1, 2))]
getFirst :: String -> [(String, (Int, Int))] -> Maybe Int
getFirst key alist = fmap fst $ lookup key alist
-- shouldn't this work?
getFirst' :: String -> [(String, (Int, Int))] -> Maybe Int
getFirst' key = fmap fst $ lookup key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment