-
Notifications
You must be signed in to change notification settings - Fork 21
Description
I don't know if this is the right place for it, but there's something I thought about doing but I won't have time for it anytime soon, so I though maybe you would like to try it. The idea would be to take something like this:
type DU = A | B | C of string | D of bool
type Record = { Prop1 : string
Prop2 : bool
Prop3: int
Prop4: DU }
let myFunc (input:Record) -> ..
And have a function like this:
let generateUI (f:'Input->'Output) : Window =
That would use reflection on typeof<'Input>
, generate a set of UI controls (TextBox for string, CheckBox for bool, Slider for int, GroupBox with RadioButtons for DU cases, etc...), and wire change notifications on those controls to trigger calling f
, and show the results somewhere in the window in a ContentPresenter. This would work both for mathematical functions, for functions returning strings, or event for functions returning a chart from FSharp.Charting. What do you think?
We could start by doing this for WPF, and if it worked nicely we could make it work for other platforms (including web)