3 ms·
What I mean is writing a desktop application without falling back to using C# for all the front-end code and relegating F# to being a glorified DSL for data pro
by jarcane 12y ago
What I mean is writing a desktop application without falling back to using C# for all the front-end code and relegating F# to being a glorified DSL for data processing.
Microsoft doesn't believe anyone wants to make apps in F#; Visual Studio doesn't even come with templates for it. You're expected to use F# to write libraries like Fsharp.Data, and write your app code in C#.
If I wanted to code in C#, I'd code in C#, but I don't.
- tegeek 12y agoA desktop app on Windows either uses WPF or WinForms. In either case F# doesn't stop at all. In fact I would say that building WPF desktop on F# is more intuitive than C#.
- louthy 12y agoopen System.Windows.Forms [<EntryPoint>] let main argv = let form = new Form() let button = new Button() button.Text <- "Click me" button.Click.Add (fun _ -> MessageBox.Show "Hello" |> ignore) form.Controls.Add button Application.Run form 0
- latkin 12y agoThere are some decent samples on MSDN, 56 in F# at the time of writing. Most aren't GUI apps, but some are. https://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=ProgrammingLanguage&f%5B0%5D.Value=F%23&f%5B0%5D.Text=F%23&sortBy=Date https://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=Pr... My "WPF Image Cropper" sample might be interesting to you - pure F# WPF via XAML type provider. I am not a GUI dev, though, so it's probably crap design :)