 ;; ========================================================
 ;; composition
 
-;; a critical feture of lenses are that they compose
+;; a critical future of lenses are that they compose
 ;; you can do this with the lens/comp-lenses
-;; this function takse a seq of lenses and combines them
+;; this function takes a seq of lenses and combines them
 
 (def user2
   {:first-name "tobias"
    :last-name "funke"
    :address {:city "bluethwill"
-             :address_line "sudden valy street 23"
+             :address_line "sudden vale street 23"
              :postcode "56321"}})
 
 (def user-city (lens/comp-lenses [:address :city]))

(= (lens/write user first-name  "Newname")
   (lens/write user first-name2 "Newname"))

;; since using keywords to reference fields in maps is so commen
;; you can use them directly as lenses

(= (lens/write user first-name  "Newname")

(= (lens/view user2 [:address :postcode])
   "56321")

;; so basically you can use lenses just like you use
;; the clojure *-in functions

(= (get-in user2 [:address :city])
   (lens/view user2 [:address :city]))
