The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Justinfront (1) [Avatar] Offline
Hi, I just bought the Functional Programming book earlier today ( well yesterday ) because I was interested in making better use of HaXe's functional aspects, and there were no books on Ocaml ( the language haXe compiler is written on ).

Anyway I am on a mac so I am trying to setup F# on a mac.

I am not really too sure how to compile on a mac. I have managed to get Mono installed and fsi.exe seems to work.

Now I wanted to compile from 'Textmate'. I downloaded the textmate bundle which seemed to have highlighting but the eval script did not work and seemed complex involving iterm rather just terminal, so based on haxe2's "build selected' I added a command that allows textmate to compile f# from the terminal.

# Compiles from a selected .fs file
echo compile: "$TM_FILEPATH"


mono /usr/lib/fsharp/bin/fsc.exe "$TM_FILEPATH"

But I found an example file online which looked like a good test of if I have a proper setup...

It uses OpenTK, which I have downloaded, but the fsc compiler keeps complaining about not understanding OpenTK, I have tried -r OpenTK.dll but am really in the dark as how to set up the compiler.

Could someone explain a bit more about how I might use fsc for compiling f# ( on mac ) and obviously to a level that I can also run the book examples and also ones using OpenTK, I would be really grateful, (if this is in the book somewhere page no?).

Many Thanks.