F# changes to OCaml [closed]

This question has been answered for some time now, but I was quite surprised that most of the answers say what OCaml features are missing in F# – this is definitely good to know if you want to port existing OCaml programs to F# (which is probably the motivation of most of the referenced articles). … Read more

Global operator overloading in F#

Here is the (non idiomatic) solution: type Mult = Mult with static member inline ($) (Mult, v1: ‘a list) = fun (v2: ‘b list) -> v1 |> List.collect (fun x -> v2 |> List.map (fun y -> (x, y))) : list<‘a * ‘b> static member inline ($) (Mult, v1:’a ) = fun (v2:’a) -> v1 … Read more

Pattern matching identical values

This is called a nonlinear pattern. There have been several threads on the haskell-cafe mailing list about this, not long ago. Here are two: http://www.mail-archive.com/haskell-cafe@haskell.org/msg59617.html http://www.mail-archive.com/haskell-cafe@haskell.org/msg62491.html Bottom line: it’s not impossible to implement, but was decided against for sake of simplicity. By the way, you do not need if or case to work around this; … Read more

What task is best done in a functional programming style?

I’ve just recently discovered the functional programming style […] Well, recently I was given a chance to give a talk on how to reduce software development efforts, and I wanted to introduce the concept of functional programming. If you’ve only just discovered functional programming, I do not recommend trying to speak authoritatively on the subject. … Read more