   also works for strings, arrays, regex Matchers and Lists, and,
   in O(n) time, for sequences."
   ([coll n]
-     (-nth coll (.floor js/Math n)))
+     (if (indexed? coll)
+       (-nth coll (.floor js/Math n))
+       (if (seqable? coll)
+         (if-let [xs (nthnext coll n)]
+           (first xs)
+           (throw (js/Error. "Index out of bounds"))))))
   ([coll n not-found]
-     (-nth coll (.floor js/Math n) not-found)))
+     (if (indexed? coll)
+       (-nth coll (.floor js/Math n) not-found)
+       (if (seqable? coll)
+         (if-let [xs (nthnext coll n)]
+           (first xs)
+           not-found)))))
 
 (defn get
   "Returns the value mapped to key, not-found or nil if key not present."

    (if (and xs (pos? n))
      (recur (dec n) (next xs))
      xs)))

(extend-type default
  IIndexed
  (-nth
   ([coll n]
      (if-let [xs (nthnext coll n)]
        (first xs)
        (throw (js/Error. "Index out of bounds"))))
   ([coll n not-found]
      (if-let [xs (nthnext coll n)]
        (first xs)
        not-found))))


;;;;;;;;;;;;;;;;;;;;;;;;;; basics ;;;;;;;;;;;;;;;;;;


      (if coll
        (recur (f val (first coll)) (next coll))
        val))))

(deftype Reduced [val]
  IDeref
