doodle icon indicating copy to clipboard operation
doodle copied to clipboard

Implementing Clipping with Reified

Open VOSID8 opened this issue 10 months ago • 1 comments

I'm working keeping in mind the other Java2D algebras as reference utilizing reified data structure and package. I'm facing bit of a trouble with expressing relationships between types with ReifiedClip and Reified.

  val ClipApi = new ClipApi {
    def clip[A](
        tx: Tx,
        img: Drawing[A],
        clipPath: ClosedPath
    ): Reification[A] = {
      WriterT.tell(List(Reified.clip(tx, img, clipPath)))
    }
  }
[error] -- [E007] Type Mismatch Error: C:\Projects\doodle\java2d\src\main\scala\doodle\java2d\algebra\reified\ReifiedClip.scala:44:6 
[error] 44 |      WriterT.tell(List(Reified.clip(tx,img, clipPath)))
[error]    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |      Found:    cats.data.WriterT[[A] =>> doodle.java2d.Drawing[A],
[error]    |        List[doodle.java2d.algebra.reified.Reified], Unit]
[error]    |      Required: doodle.java2d.algebra.reified.Reification[A┬▓]
[error]    |
[error]    |      where:    A  is a type variable with constraint
[error]    |                A┬▓ is a type in method clip

VOSID8 avatar Apr 21 '24 09:04 VOSID8