You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What should this draw? The problem is that there is no natural way to combine the circle and the square. Often it isn't desirable to combine them. Something like
Apologies for the delay - I think that's a good approach.
We do still need to define the behaviour of map, andThen and width with respect to drawing.
What do you think about:
Picture.circle(10).width.andThen(w =>Picture.square(w *2)) // Draws the square, but not the circle.Picture.circle(10).width // Currently draws the circlePicture.circle(10).map(identity) // === Picture.circle(10) so should draw the circle
The behaviour of the picture monad is a bit different to what I would expect. It discards effects when
map
is used:map
is implemented in terms offlatMap
, which has the same behaviour:On the other hand, functions such as
width
which construct a new picture still draw:Is this intended?
The text was updated successfully, but these errors were encountered: