 (def ^{:no-doc true}
   validation-applicative
   (reify
-    proto/Semigroup
+    p/Semigroup
     (mappend [_ sv sv']
       (cond
         (and (fail? sv) (fail? sv')) (fail (m/mappend (m/extract sv)

         (with-out-str (print [v])))])

  #?@(:cljs
       [cljs.core/IEquiv
        (-equiv [_ other]
                (if (instance? Ok other)
                  (= v (.-v other))
                  false))]))

(deftype Fail [v]
  proto/Context
  (get-context [_] validation-applicative)

  proto/Extract
  (extract [_] v)

  #?(:clj clojure.lang.IDeref

  "Return true in case of `v` is instance
  of the Validation applicative."
  [v]
  (if (satisfies? p/Context v)
    (identical? (p/get-context v) validation-applicative)
    false))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
