 
           :else
           (try
-            (next-fn (nth structure this))
+            (next-fn (nth structure (.-value this)))
             (catch IndexOutOfBoundsException ex
               (next-fn nil)))))
   (transform* [kw structure next-fn] (boom! "structural-typing does not use transform")))
+
+(defmethod clojure.core/print-method IntegerVariantType [o, ^java.io.Writer w]
+  (.write w (str (.-value o))))
+
+
 
 
                                  ;;; ALL, RANGE

                        (surround-with-index-collector elt))
                  :indexed-path)

           :else
           (recur remainder (conj specter-path elt) path-type))))


            [structural-typing.assist.oopsie :as oopsie]
            [structural-typing.guts.preds.wrap :as wrap]))


;; NOTE: I don't know why Specter requires `extend-type/extend-protocol` instead of
;; defining the protocol functions in the deftype. But it does.

(deftype KeywordVariantType [keyword])

(extend-type KeywordVariantType
  sp/StructurePath
  (select* [this structure next-fn]
    (cond (map? structure)
          (next-fn (get structure (.-keyword this)))

          (nil? structure)
          (next-fn nil)

          :else
          (boom! "%s is not a map" structure)))
  (transform* [this structure next-fn] (boom! "structural-typing does not use transform")))

(defmethod clojure.core/print-method KeywordVariantType [o, ^java.io.Writer w]
  (.write w (str (.-keyword o))))


(deftype IntegerVariantType [value])
  
(extend-type IntegerVariantType
  sp/StructurePath
  (select* [this structure next-fn]
    (cond (nil? structure)
          (next-fn nil)
          
