I tried searching the web a bit but I couldn't find any talks about Functors being implemented in a future F# version (possibly 4?). I believe they want to do it at some point because they've reserved the "functor" keyword and have implemented a good part of OCaml but I think it's a bit strange that the language is already in a production-ready state and nobody is asking for them - also because the now-dead SML.NET already did them in '06. Any "official" reason Functors haven't still been implemented?
Asked
Active
Viewed 230 times
2
-
3I don't think the question is opinion-based - what would the "opinion" I'm asking for be, exactly? The feature is either being worked on or not being worked on, that's a **fact** easily verifiable by taking part in the F# development community. Since I'm not part of it, I'm asking the question. – Gomi Oct 16 '13 at 21:10
-
1F# is not trying to reimplement OCaml - it shares the same background, but it also shares the .NET/Mono background, so there is really no reason for assuming that anything from OCaml is a planned feature in F# :-). Functors are nice in OCaml, but when writing idiomatic F# code, you don't really need this kind of abstraction that often. – Tomas Petricek Oct 16 '13 at 21:46
-
There is between 1 and 3 people wanting them, though, so you can add your vote here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4207746-functors – Tomas Petricek Oct 16 '13 at 21:51
-
7And BTW, the question might or might not be opinion-based, but it certainly is a duplicate: http://stackoverflow.com/questions/14777522/if-sml-net-had-functors-why-cant-f/14777756#14777756 – Tomas Petricek Oct 16 '13 at 21:51
-
@TomasPetricek so what do they plan to do with F#, keep it closer to the C#/.NET/OOP side? And by the way, I did read that question but it's passed some time since then and it's not exactly the same question...mine is more specific to language design, not really technical. – Gomi Oct 16 '13 at 21:55
-
2Who "they"? F# is open-source :-) but I think the general agreement in the community is that there are more important things to work on at the moment than major language changes - developing great libraries for F# is IMHO the main focus now. – Tomas Petricek Oct 17 '13 at 03:02
-
1@Gomi: Don Syme is solely responsible for such design decisions and he doesn't like module systems. Don't forget, F# isn't just lacking higher-order modules (functors), it is also lacks much more mundane and useful ordinary module system features like nested signatures. I don't believe F# will ever get functors. However, I don't really care about functors that much: there are more important things to do. – J D Oct 18 '13 at 12:09
-
3@TomasPetricek: "Who they? F# is open-source :-)". I find that an odd statement. Some old versions of the `fsc` compiler were open sourced by Don Syme. The current version (F# 3.1) is not yet OSS and the rest of the toolstack (e.g. VS integration) has never been OSS. I believe this was done to appease academics and to insure against Microsoft/.NET/F# dying commercially. I'm not sure they have ever accepted contributions from non-MS people. For example, you implemented `match!` years ago which sounds awesome and I really want it but Don doesn't want to put it in so, in reality, nobody gets it. – J D Oct 18 '13 at 12:24