Data map phonebook | Haskell

September 27th, 2021 12:39:29 PM

					
import qualified Data.Map as Map phoneBook = Map.fromList [(1234, "Erik"), (5678, "Patrik")] main = do print phoneBook print $ Map.lookup 1234 phoneBook print $ (Map.empty :: Map.Map Int Int) print $ Map.singleton 3 5 print $ Map.insert 1 "abc" Map.empty print $ Map.null phoneBook print $ Map.size phoneBook print $ Map.toList phoneBook print $ Map.keys phoneBook print $ Map.elems phoneBook

Featured Posts