The functions need to expose variables to the GUI for users to play with, for example Windows Slider controls to represent an int or double (I use the term Slider to include a text string too). I tried various designs for this before
settling on the implementation used. Additional requirements were to allow code to set the upper and lower limits and default value for the variables.

The GUI also accessed the Sliders library in order to display and alter the slider values; when they changed from the GUI the image was redrawn picking up the new values. This worked, and sliders get picked up from inner functions automatically which is nice,
but it looked ugly in the F# and there was some performance impact from repeatedly accessing the Slider values... so onto:

Sliders Try 2

I tried using custom .NET Attributes to markup the inputs to the functions - also not particularly pretty and they don't get inherited when functions are composed which means lots more typing.

In order to bind the values from the GUI, I had some fun writing a
currying function: in the above example starting with particular dx and dy I dynamically create a .NET function taking only a point p which returns a translation by that dx,dy. It does this in a similar way you can see (using Reflector.NET) F# doing its
currying, which is just hardcoding certain inputs before calling the underlying uncurried function. The code to do this (from PanWrapper.cs) is quite simple (once you've read half a dozen F# blogs of course):

join us

Complete this form to send a request to become a member of this project. Enter any comments that
you wish for the project coordinators to see when approving your request, for example
what role you would like to have in the project.