 ;3.10
 ;mine
 (defn fold-left [xs z f]
-  (loop [[x & others] xs acc z]
-    (if (nil? others)
-      (f x acc)
-      (recur others (f x acc)))))
+  (loop [[x & others :as original] xs acc z]
+    (if (nil? original)
+      acc
+      (recur others (f acc x)))))                           ;here it was (f x acc) thus
+;my fold-r-via-fold-l-1 didn't work :)
+;after swapping to (f acc x) it worked :)
 ;
 ;fpins
 ;relies on @tailrec scala annotation

(defn my-reverse [xs]
  (fold-left xs '() cons))
(defn my-reverse2 [xs]
  (fold-right xs [] #(conj %2 %)))                           ;This is
;way to do it with fold-right as list does not support adding at the end
;fpins
;It is done via f-l as in my first attempt
;-----------------------------------------------------------------------
; case Nil => z
; case Cons (h, t) => foldLeft (t, f (z, h)) (f)
; }
; Actually - nope mine is not really equiv because below fold-r-via-fold-l-1 fails
;this should be better:
(defn fold-left-fpins [l z f]
  (let [[h & t :as original] l]
    (if (nil? original)
      z
      (fold-left-fpins t (f z h) f))))
;-----------------------------------------------------------------------

;3.11
