 
 (deftype FirstStructurePath [])
 
-(extend-protocol StructurePath
+(extend-protocol p/StructurePath
   FirstStructurePath
   (select* [this structure next-fn]
     (next-fn (first structure)))

        optimized performance. Instead, you should extend the protocols via an
        explicit extend-protocol call. \n" obj))

(defn find-protocol-impl! [prot obj]
  (let [ret (find-protocol-impl prot obj)]
    (if (= ret obj)
      (throw-illegal (no-prot-error-str obj))
      ret
      )))

(defn- seq-contains? [aseq val]
  (->> aseq
       (filter (partial = val))
       empty?
       not))

#?(
:clj


(deftype ViewPath [view-fn])

(extend-protocol p/StructurePath
  ViewPath
  (select* [^ViewPath this structure next-fn]
    (->> structure ((field this 'view-fn)) next-fn))
  (transform* [^ViewPath this structure next-fn]
    (->> structure ((field this 'view-fn)) next-fn)
    ))

(deftype PutValCollector [val])

(extend-protocol p/Collector
  PutValCollector
  (collect-val [^PutValCollector this structure]
    (field this 'val)
    ))


(extend-protocol p/StructurePath
  nil
  (select* [this structure next-fn]
    (next-fn structure))
