Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. maxValue :: Map String Integer -> String                                      
  2. maxValue m                                                                      
  3.     | null m    = ""                                                                
  4.     | otherwise = name                                                              
  5.         where (name, _) = Map.foldrWithKey step first m                          
  6.               step k v (mk, mv) = if v > mv then (k, v) else (mk, mv)            
  7.               first = head $ Map.toList m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement