Skip to content

Instantly share code, notes, and snippets.

@cosmo0920
Created July 18, 2015 13:54
Show Gist options
  • Save cosmo0920/fde0ff9b30eaa008a51b to your computer and use it in GitHub Desktop.
Save cosmo0920/fde0ff9b30eaa008a51b to your computer and use it in GitHub Desktop.
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import Data.Map
Prelude Data.Map> let t = insert 5 "e" $ singleton 4 "d"
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Prelude Data.Map> t
fromList [(4,"d"),(5,"e")]
Prelude Data.Map> insert 3 "c" $ t
fromList [(3,"c"),(4,"d"),(5,"e")]
Prelude Data.Map> t
fromList [(4,"d"),(5,"e")]
Prelude Data.Map> delete 4 t
fromList [(5,"e")]
Prelude Data.Map> t
fromList [(4,"d"),(5,"e")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment