Created
January 24, 2013 23:55
-
-
Save argv0/4629885 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
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