Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I always describe F# as a cousin of OCaml because OCaml has many features that F# does not have and is never likely to get. F# is more closely related to the previous CAML language. In particular, F# has very limited support for abstraction and no support for structural typing (like OCaml's <a href="http://ocamlnews.blogspot.com/2008/11/object-oriented-programming-in-ocaml.html" rel="noreferrer">objects</a> and <a href="http://ocamlnews.blogspot.com/2008/03/getting-most-out-of-static-typing.html" rel="noreferrer">polymorphic variants</a>) at all.</p> <p>Contrary to what some respondants have written, F# does have (limited) support for labeled ("named") and optional arguments.</p> <p>However, these are all advanced features and you can certainly start getting to grips with the basic ideas behind small-scale OCaml-style functional programming using resources about OCaml. The first major difference you will discover is larger-scale problems like encapsulation and abstraction which are solved in completely different ways in OCaml and in F#. If you want to learn how to do that in F#, the only available literature is <a href="http://fsharpnews.blogspot.com/2009/05/purely-functional-data-structures.html" rel="noreferrer">this article on purely functional data structures</a>.</p> <p>I have also discovered that OCaml's wonderful module system makes it easy to parameterize code over types (such as data structures) but the OOP alternatives are not only hideous but almost entirely unused on .NET. Moreover, when trying to write elegantly-parameterized data structures I hit dozens of bugs in the F# compiler because nobody has even attempted to do this before. The F# stdlib does contain some nice data structure implementations but virtually no reuse, i.e. it is a cut'n'paste job.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload