Type alias or newtype wrapper?

One thing to think about is whether you want to use Image for dispatch. If you really just want to treat image as a regular array, the first option is probably the way to go, but if you wanted to overload inv to invert the colors of the image for example, you should definitely go with the second option, because otherwise, you are commiting type piracy.

5 Likes