 (ns text-stream.edits
   (:gen-class))
-
-(defn perform
-  "Performs the `edits` (in the manner defined by the `consolidate` function)
-  on the provided `source-map`."
-  [edits source-map]
-  ((consolidate edits) source-map))
 
 (defn consolidate
   "Takes a seq of edits and composes them into a single function. Applies from

  the current cursor position."
  [text-insertion]
  (fn [source-map]
    (println "insert into:" source-map)
    (let [old-text (:text source-map)
          cursor (:pos source-map)
          new-text (str

  with `cons`."
  [edits]
  (apply comp edits))

(defn perform
  "Performs the `edits` (in the manner defined by the `consolidate` function)
  on the provided `source-map`."
  [edits source-map]
  ((consolidate edits) source-map))

(defn cursor
  "Produces an edit function which moves the cursor to index `position-index`
