We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So it seems like Image.map takes the size of the old image, but a new (Int, Int) => A function which it uses (ignoring the old raster's function).
Image.map
(Int, Int) => A
This is a bit odd, right? I would imagine the map method as looking something more like this:
trait Image[A] { self => ... def map[B](f: A => B): Image[B] = new Image[B] { def width = self.width def height = self.height def apply(x: Int, y: Int): B = f(self(x, y)) } }
I feel like the current map maybe belongs in a companion object? What is the advantage over just doing this:
object Image { def apply[A](w: Int, h: Int)(f: (Int, Int) => A): Image[A] = ... }
What do you think?
The text was updated successfully, but these errors were encountered:
You're right. I should get rid of it.
Sorry, something went wrong.
No branches or pull requests
So it seems like
Image.map
takes the size of the old image, but a new(Int, Int) => A
function which it uses (ignoring the old raster's function).This is a bit odd, right? I would imagine the map method as looking something more like this:
I feel like the current map maybe belongs in a companion object? What is the advantage over just doing this:
What do you think?
The text was updated successfully, but these errors were encountered: