   ([mv]
    {:pre [(maybe? mv)]}
    (when (just? mv)
-     (proto/extract mv)))
+     (p/extract mv)))
   ([mv default]
    {:pre [(maybe? mv)]}
    (if (just? mv)
-     (proto/extract mv)
+     (p/extract mv)
      default)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  "The maybe transformer constructor."
  [inner-monad]
  (reify
    proto/Functor
    (fmap [_ f fv]
      (proto/fmap inner-monad
                  #(proto/fmap maybe-monad f %)
                  fv))

    proto/Monad
    (mreturn [m v]
      (proto/mreturn inner-monad (just v)))

    (mbind [_ mv f]
      (proto/mbind inner-monad
                   mv
                   (fn [maybe-v]
                     (if (just? maybe-v)
                       (f (from-maybe maybe-v))
                       (proto/mreturn inner-monad (nothing))))))

    proto/MonadZero
    (mzero [_]
      (proto/mreturn inner-monad (nothing)))

    proto/MonadPlus
    (mplus [_ mv mv']
      (proto/mbind inner-monad
                   mv
                   (fn [maybe-v]
                     (if (just? maybe-v)
                       (proto/mreturn inner-monad maybe-v)
                       mv'))))

    proto/MonadTrans
    (base [_]
      maybe-monad)


        mv
        (f (from-maybe mv))))

    p/MonadZero
    (mzero [_]
      (nothing))

    p/MonadPlus
    (mplus [_ mv mv']
      (if (just? mv)
        mv
        mv'))

    p/Foldable
    (foldl [_ f z mv]
      (if (just? mv)
        (m/with-monad (p/get-context mv)
          (f z (p/extract mv)))
        z))

    (foldr [_ f z mv]
      (if (just? mv)
        (m/with-monad (p/get-context mv)
          (f (p/extract mv) z))
        z))))

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