title: Can't convert MappedProjection to ProvenShape due to ambiguous implicit
body: <p>Could you please explain to me how I can convert <code>MappedProjection</code> to <code>ProvenShape</code> which currently fails due to ambiguous implicit?</p>
  
  <p>I use <a href="https://github.com/tminglei/slick-pg" rel="noreferrer">slick-pg</a> for support of <code>jsonb</code> types in Postgres DB.</p>
  
  <p>I have simple case class that I want to store as json and there is ID column with value from case class.</p>
  
  <pre><code>case class Topic(id: String, title: String)
  
  class TopicRow(tag: Tag) extends Table[(String, Topic)](tag, Topic.tableName) {
  
    def id = column[String]("id", O.PrimaryKey)
    def json = column[Topic]("json")
  
    def * = (id, json)
  }
  </code></pre>
  
  <p>earlier in the code I have conversion between json and case class</p>
  
  <pre><code>import spray.json._
  implicit val TopicColumnType = MappedColumnType.base[Topic, JsValue ](
    { obj =&gt; obj.toJson }, { json =&gt; json.convertTo[Topic] }
  )
  </code></pre>
  
  <p>What I don't like about <code>TopicRow</code> is that it maps to tuple. I'd like it to be something like this</p>
  
  <pre><code>class TopicRow(tag: Tag) extends Table[Topic](tag, Topic.tableName) {
  
    def id = column[String]("id", O.PrimaryKey)
    def json = column[Topic]("json")
  
    val tupled: ((String, Topic)) =&gt; (Topic) = tu =&gt; tu._2
    val unapply: (Topic) =&gt; Option[(String, Topic)] = t =&gt; Option((t.id, t))
    def * = (id, json) &lt;&gt; (tupled, unapply)
  }
  </code></pre>
  
  <p>It fails to compile with error</p>
  
  <pre><code>Error:(43, 22) type mismatch;
   found   : slick.lifted.MappedProjection[co.younetworks.medstream.server.models.db.Topic,(String, co.younetworks.medstream.server.models.db.Topic)]
   required: slick.lifted.ProvenShape[co.younetworks.medstream.server.models.db.Topic]
  </code></pre>
  
  <p>So I specified explicitly every step of conversion like this</p>
  
  <pre><code>def * = {
    val shape: ProvenShape[Topic] = {
      val tupled: ((String, Topic)) =&gt; (Topic) = tu =&gt; tu._2
      val unapply: (Topic) =&gt; Option[(String, Topic)] = t =&gt; Option((t.id, t))
      val toToShapedValue: ToShapedValue[(Rep[String], Rep[Topic])] = anyToToShapedValue((id, json))
      val mappedProjection: MappedProjection[Topic, (String, Topic)] = toToShapedValue &lt;&gt;(tupled, unapply)
      ProvenShape.proveShapeOf(mappedProjection)
    }
    shape
  }
  </code></pre>
  
  <p>that gives me error</p>
  
  <pre><code>Error:(52, 31) ambiguous implicit values:
   both method mappedProjectionShape in object MappedProjection of type [Level &gt;: slick.lifted.FlatShapeLevel &lt;: slick.lifted.ShapeLevel, T, P]=&gt; slick.lifted.Shape[Level,slick.lifted.MappedProjection[T,P],T,slick.lifted.MappedProjection[T,P]]
   and method repColumnShape in trait RepShapeImplicits of type [T, Level &lt;: slick.lifted.ShapeLevel](implicit evidence$1: slick.ast.BaseTypedType[T])slick.lifted.Shape[Level,slick.lifted.Rep[T],T,slick.lifted.Rep[T]]
   match expected type slick.lifted.Shape[_ &lt;: slick.lifted.FlatShapeLevel, slick.lifted.MappedProjection[co.younetworks.medstream.server.models.db.Topic,(String, co.younetworks.medstream.server.models.db.Topic)], U, _]
        ProvenShape.proveShapeOf(mappedProjection)
                                ^
  </code></pre>
  
  <p>I suspect I confused compiler with presence of mapped column but I don't know how to fix it.</p>