title: combine map and list of vectors and lists
body: <p>I have two datastructures:</p>
  
  <pre><code>(def epics {"ARP-37" 8.0, "ARP-24" 5.0, "ARP-22" 13.0, "ARP-6" 21.0, "ARP-1" 8.0})
  (def releases '(["Release one" '("ARP-37" "ARP-22" "ARP-6")]))
  ; gets the sum of a list of epics (maps epic keys to its corresponding story points)
  (defn get-max-sp [epic-list] (reduce + (map #(get epics %) epic-list)))
  (def initial-sp (get-max-sp '("ARP-37" "ARP-22" "ARP-6")))
  </code></pre>
  
  <p>Some might recognize this as JIRA data. However, I want to combine these two structures to look like this:</p>
  
  <pre><code>; where (now) is a function from clj-time returning the current date
  (def result [{x: (now), y: initial-sp }
               {x: (+ now (get epics "ARP-37")), y: (- initial-sp (get epics "ARP-37))}
               {x: (+ now (get epics "ARP-37") (get epics "ARP-22")), 
                    y: (- initial-sp (get epics "ARP-37") (get epics "ARP-22"))}
               {x: (+ now (get epics "ARP-37") (get epics "ARP-22")
                       (get epics "ARP-6")), 
                    y: (- initial-sp (get epics "ARP-37") (get epics "ARP-22")
                         (get epics "ARP-6") )}
              ])
  </code></pre>
  
  <p>So, after executing the functions I want the result to look like this:</p>
  
  <pre><code>[{x: 2014-02-18, y: 42}
   {x: 2014-02-26, y: 34}
   {x: 2014-03-11, y: 21}
   {x: 2014-04-01, y: 0}
   ]
  </code></pre>
  
  <p>I have trouble combining and mapping the two structures to get my result and I would love to get some hints on how to approach that problem in clojure :-)</p>
  
  <p>Thanks,
  Sven</p>
  
  <p><strong>Update:</strong> As it seems to be unclear what x and y should be i will try to explain them a bit more.
  <em>x</em> is supposed to be a date with an initial value of today and on every iteration step the storypoint of an epic will be added to it "ARP-37" is the epic and 8.0 its storypoint. 
  <em>y</em> is something similar as it starts with the some of all the story points of the epic list and then goes down on every iteration step the number of story points of its epic.
  The iteration will be over the list of epics.</p>