title: An example of using Data.Map in Haskell
body: <p>I'm new in Haskell and I need to define an empty Data.map and assigning a "list of integers" (e.g. [1,2,3]) to its keys by using insert function and also updating the values. Then looking up the key values. </p>
  
  <p>What I have tried so far is :</p>
  
  <pre><code>import qualified Data.Map
  
  foo num =
      let
          my_map  = Data.Map.empty
  
          new_map = bar my_map  num 1
  
      in
          Data.Map.lookup 1 new_map
  
  
  bar my_map num c =
      if c &gt; num then my_map
      else
          Data.Map.insert  c  [c] my_map
          bar my_map  num  c+1
  </code></pre>
  
  <p>This code doesn't work.</p>
  
  <p>Could you have a simple example please?</p>