Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I wouldn't expect F# to be a drop-in replacement for Matlab/R, because unlike them, F# is a general purpose programming language. Not everything you need for a specific type of work will be in the standard libraries. But that doesn't mean that the "interactive development" you describe is impossible, it may just require some effort up-front to build the library functions you depend on.</p> <p>For #1, as was mentioned earlier, adding type annotations is unfortunately necessary in some cases, but also the <code>inline</code> keyword and "hat-types" can <a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2009/06/11/f-duck-typing-and-structural-typing.aspx" rel="nofollow noreferrer">give you duck-typing</a>.</p> <p>For #2, I'm not clear on what your <code>open</code> and <code>process</code> functions do, versus what you want them to do. For example, the <code>open</code> function could:</p> <ul> <li>Read the entire file at once, return the data as an array/list/etc, and then close the file</li> <li>Return a <code>FileStream</code> object, which you're calling <code>process</code> on but forget to close.</li> <li>Return a sequence expression so you can lazily iterate over the file contents</li> <li><a href="http://blogs.msdn.com/dsyme/archive/2007/05/31/a-sample-of-the-memoization-pattern-in-f.aspx" rel="nofollow noreferrer">Memoize</a> the result of one of the above, so that subsequent calls just return the cached result</li> <li>One of the gazillion other ways to create an abstraction over file access.</li> </ul> <p>Some of these are better suited for your task than others. Compared to Matlab &amp; R, a general purpose language like F# gives you more ways to shoot yourself in the foot. But that's because it gives you more ways to do everything.</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. 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