sanjay_si (7) [Avatar] Offline
Hi, By looking up at the ScreenElement it was unclear what string meant in "ImageElement of string * Rect" - unless one read the description. If it can be written as:

type ImageFileName = string

type ScreenElement =
| TextElement of TextContent * Rect
| ImageElement of ImageFileName * Rect

The same applies for listing 7.9 on page 187

Tomas Petricek (160) [Avatar] Offline
Re: Suggestion for Listing 7.4 on Page 182
thanks for the feedback - you're right. In a bigger application it would be quite useful to define a type alias for this. I'm often trying to make the code a bit simpler and focus only on some aspects, so I didn't do that.

However, there will be an inline annotation right in the listing (in the final version), so the code should be easy to follow. Same thing could be achieved by adding a code comment (but it's of course better to make the code more self-explanatory when possible).