Improve project F# model
Improve F# project model (at least, add directions support). Maybe some extension to the language itself would be pretty good: #require "filename" to indicate that filename must be compiled before current file.
Kristoffer Garcia commented
Native support for File & Folder management, incl Add/Rename/Remove Folder, Drag n Drop, Copy/Paste, Show All Files and Include in Project is essential.
I really appreciate the work that has done on the Visual F# Power Tools, however, the Folder Organization feature is too unstable to be considered a true solution to this problem. In fact, the maintainers themselves say the following:
"This feature is disabled by default. Because there are known issues with F# Project System in Visual F# Tools, folder organization may not work 100% correctly in all cases. We do not advice you to introduce complicated folder structure within F# projects. You should keep number of folders within your project as low as possible."
I know that there are points to be made on how code organization in F# is different from other languages but this is basically like saying that limited file and folder management is a feature of the language tooling because it is more idiomatic to use less files and folders in the language.
File and folder management is such a basic part of editing code and this is among the top issues that everyone I introduce F# to seems to get stuck on. It is really difficult to make a case for F# being a viable language for everyday development alongside C# when something so basic (even if peripheral) doesn't work quite right, and has remained this way for years.
This has come up in so many other forums over the years that it hard to track down all the times it has been discuss, but below are just a few examples:
btw: you can have folders. That's a tooling problem, and one that was addressed by F# Power Tools, which is a set of tools developed by a some members of the F# community to enhance Visual Studio. https://fsprojects.github.io/VisualFSharpPowerTools/ I *think* that folders are a fairly recent addition to PowerTools. I was still editing the .fsproj files this year by hand to add folders when a kind soul at an F# user group showed me. "When did that creep in!".
Make sure that you check the "Folder Organisation" option in the "Tools/Options/F# Power Tools/General" area. Now if you restart VS, and then right click on a project, or a file, you'll see additional menu items concerning folders.
Also, re: "the compiler should be able to determine the correct compilation order". There are a few things that occur in F# like this that are by design. This behaviour leads to a number of benefits... and in this case it's flow. Like you can follow the process that is in your code either top down (should you use the "and" keyword) or bottom up (default).
Also, when you are dealing with type inference (which allows you to edit down your function definitions so that you can read them first for meaning, rather than compiler hints), it's nice to follow the train of though (or logic) that leads to a type being inferred should you need to. If there is no direction convention in the way the files are ordered, it makes it uneccessarily much harder to do this.
On file ordering I'd suggest just going with it for 3 to 12 months to see if you start appreciating it. Sometimes these things are counter-intuitive.
On annotating files for order... probably quite an easy thing to do. Say we hacked at it with a comment // #FileOrder: 1, etc. You could pre-process all files and then change the order that files are placed on the fsc.exe command line (which is what VS does). Probably not too hard to have an "Ordered Compile" menu item in VS if you really wanted it. Anyway... my suggestion is to just go with the flow.
Samuel Bronson commented
Embedding that-before-this information in the source files in CPP-style (the C and/or C++ preprocessor(s), not C++!) notation certainly doesn't sound particularly elegant, but there clearly needs to be SOME reasonable way for MSBuild and/or FSC to know in what order to arrange the compilation units.
(I mean, it's not like it would be feasible to redefine F# such that the order dependencies go away, because presumably if that were feasible it would have been done back when F#'s was solely a Microsoft Research project, right?)
F# project must support folders ! A folder is something so simple that I do not understand why there is not.
Johann Dirry commented
I'd advice against #include. the compiler should be able to determine the correct compilation order automatically. however, folders for grouping of namespaces are highly needed in large applications.
Folders within projects are essential for large projects. I can add folders by manually changing the project file, which means there isn't a technical roadblock to doing it from the IDE itself. Folder support is an absolute must have.
Eric Taucher commented
I think a better idea is one taken from HOL Light and is called needs <module>. The idea is from math and in particular theorems. A theorem needs other theorems in order to be proven. You only specify the specific theorems you need and those theorems specify the theorems they need and so on. See OCaml implementation at: http://code.google.com/p/hol-light/source/browse/trunk/hol.ml
Herman Tho commented
WTH Why F# Not Support Folders, What happen if we have 500class.
Please support it.
Rodrigo Vidal commented
F# project must support folders! It's a shame!
no to c++ style
Marc Sigrist commented
Folders would be nice, or, as an alternative: Improving _object browser_ support in Visual Studio, so that the internal and private details of an F# project can be looked up in a structured way in "My Solution", as it is possible for other languages.
Also, for large projects it would be nice to group files in folders. Even without ordering this would be very good
Michael Garnett commented
No c++ includes, file ordering isn't bad, but drag/drop to reorder would be nice and most definately folders! Folders would need to be reorderable, or course, to control compilation order.
I'm certainly up for improvements to the F# projects in general, but the idea of having to require files a-la C++ is not something I'm interested in at all.
Folders would be great, and not having to specify the order of files in any way would also be nice.
I really would hate to see C++ style includes, but folders would be nice.