Since Mono 3.0.2, Our Mac can run F# 3.0. Please check F# 3.0 on Mac
F# is an object-oriented functional language by Microsoft. It's based on C#. I try to explain what technologies of Java-lang are corresponding to:
|execution environment||object-oriented language||object-oriented functional language|
And F# is also available on Mono, not only .NET . Let's install F# on Mac OS X from scratch!
- Download Mono 2.8 from here
- Install Mono 2.8
- Download mono.snk from here
- Download F# zip from here
- Unpack fsharp.zip
- cd /Library/Frameworks/Mono.framework/Versions/2.8/lib
- move unpacked directory (e.g. FSharp-188.8.131.52) to ./fsharp
- cd fsharp, and copy mono.snk to here
- sudo chown -R root:admin ../fsharp
- sudo ./install-mono.sh
At last, we had better aliasing two F# commands like below:
alias fsc='mono /Library/Frameworks/Mono.framework/Versions/2.8/lib/fsharp/bin/fsc.exe'
alias fsi='mono /Library/Frameworks/Mono.framework/Versions/2.8/lib/fsharp/bin/fsi.exe'
That's OK. Start the interactive shell:
$ fsi Microsoft (R) F# 2.0 Interactive build 184.108.40.206 Copyright (c) Microsoft Corporation. All Rights Reserved. For help type #help;; > #light;; > let Additional = (fun i j -> i + j);; val Additional : int -> int -> int > let sum = Additional 3 5;; val sum : int = 8 > printf "%d" sum;; 8val it : unit = () > #quit;; - Exit... $