News for hackers. Stuff that matters.
Re:F# 4.1 and Visual F# Tools for Visual Studio 2017 by mcbits on Tuesday March 07, 2017 @06:47PM (#13816418)
I haven't used F# in a while, but it seemed pretty clean for OOP with a couple of caveats. You have to explicitly implement interfaces and do a lot of casts to use interface members, which is ugly compared to the rest of F#. It's also difficult (impossible?) to have circular references between types unless you cram it all into one file.

It's probably possible to convince me that the limitation on circular references is actually a feature, but implicit interfaces would be really nice to have.

If I ever dive back into to F#, I think I will treat it as "procedural first with a neat type system" and limit the use of both OO and functional features to where they markedly improve the code.

Re:F# 4.1 and Visual F# Tools for Visual Studio 2017 by yawaramin on Tuesday March 07, 2017 @10:35PM (#13817662)
> If I ever dive back into to F#, I think I will treat it as "procedural first with a neat type system" and limit the use of both OO and functional features to where they markedly improve the code.

This may be a good strategy; I would urge you though to try doing top-down design in F# using modules and interface (.fsi) files. E.g., let's design a calculator GUI app in F# using, say, Windows Forms. Sketch out the interface first:

    (* Calculator.fsi *)
    namespace CalculatorApp

    module Calculator =
      type number = Zero | One | Two | ... | Nine
      type op = Plus | Minus | ... | Sqrt

      (*
      Holds the app model. Note that it is mutable; the keypress operations
      return `unit`, i.e. they update the `t` value in place.
      *)
      type t

      val init : t
      val press_number : t -> number -> unit
      val press_op : t -> op -> unit
      val calculate : t -> double

      (*
      Draws the app and hooks up event handlers to the above operations.
      *)
      val render : unit -> System.Windows.Forms.Control
Then in the implementation file (Calculator.fs), fill in the blanks based on the types! Of course you'll need a separate file for the main entry point, but that's good practice anyway.
Re:F# 4.1 and Visual F# Tools for Visual Studio 2017 by dualogy on Tuesday March 07, 2017 @07:11PM (#13816578)
> It's probably possible to convince me that the limitation on circular references is actually a feature

Have that in Haskell as well. As the community largely views FP as "type-driven development" and Haskell as a "typeful language", it isn't uncommon to have a single module just for listing all the Algebraic Data Types (not their "methods" though, that's more an OOP concept anyway). Having all ADTs at a glance has its own benefits in terms of "high-level overview" etc too of course.

But of course the question was about OOP so you're right calling this a "caveat" in that respect.