doodle
doodle copied to clipboard
BufferedImageConverter cleanup
Consider the following:
-
BufferedImageConverter
is quite a mouthful. Can we shorten the name? Perhaps we use the term "Writer" for anything we can convert aPicture
into, and rename the currentWriter
toFileWriter
(andBase64
becomesBase64Writer
)? -
Can we make the
Frame
optional? Can we get it from aDefaultRenderer
? Maybe the idea of a default frame should be extracted into it's own effect (it's not really an effect, but it is associated with effects.) -
Do we need to return the value of type
A
when we convert to aBufferedImage
? Most of the time the user will throw it away. (Same issue exists forBase64
). Maybe the convention should be you get theA
if you convert to anIO
but we throw it away in you immediately run thatIO
. This would match what happens indraw
. -
Maybe what we need is a generic conversion effect type class. Something like
trait To[+Alg <: Algebra, Frame, Out] { def to[A](description: Frame, picture: Picture[Alg, A]): IO[(A, Out)] }
-
Java2dBufferedImageWriter
inJava2dWriter.scala
should be renamed and moved to its own file. -
Add tests.
-
Add documentation.
This issue could probably be usefully turned into a project. Each bullet could be it's own issue.