By Alvin Alexander. Last updated: July 31, 2016
This image is from a well-written 2009 post on SO by Laurence Gonsalves about functional reactive programming. In his example, x
and y
are more or less equivalent to constantly calling getX()
and getY()
on a MouseEvent
in Java or Scala. By that I mean that (a) getX()
is immutable, and (b) its value changes over time, as the person moves the mouse.
(Here’s a link to where I show how to use MouseEvent as a MouseMotionListener.)