Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Victor Peter Rouven Müller
Alternatively you can try running the all although I'm a bit confused at this point :smile:
So give mono <something>.dll a shot, k
Hmm, didn't do anything.
Victor Peter Rouven Müller
:confused: darn
I'm not familiar with Rider
Alternatively ask on the fsharp forums or in the Fsharp slack :smiley:
Hah! so looking at the Rider output running a build, the command to get things happening is dotnet something.dll
And it works!
Thanks for rubberducking for me @realvictorprm !
Victor Peter Rouven Müller
Ah dotnet ja tue command kg used with .Met Code
Sorry german keyboard lol
No problem, I'm glad it works now for you :+1:
So I can't get Ionide to see the packages I'm adding with Paket on OSX. Here's a vid of me creating a fresh project and trying to get JsonProviders, am I doing something wrong?
sorry wrong chat :-D
Leo Cavalcante

Hi folks, I'm reading about F# and trying to apply it to my daily job.
I was already been able to load a CSV file with the help of FSharp.Data from NuGet, but I did it a imperative style, I think. Now I'm trying to apply functional constructs, tried the following:

open System
open System.IO
open FSharp.Data

let main argv =
  let data =
    |> Path.Combine Environment.CurrentDirectory
    |> CsvFile.Load

  printfn "%A" data.Headers


What I'm missing here?
In my head argv.[0] is passed to the result of Path.Combine Environment.CurrentDirectory which curried already have the current dir as the first path then the combined result is given to CsvFile.Load.
Did I get |> and curring wrong?

Diego Esmerio
I believe that you must use the tupled form as Path.Combine don't support currying
But the next step to CsvFile.Load is probably ok
Alexander Prooks
I usually create small F# helpers which adapt C# methods to F# functions. Makes much easier to consume and debug type inference issues if any
Yemi Bedu @ P&R
and it is okay to not always use the fluid style. you can make the intermittent let bindings and just get things done.
hi Guys
in javascript I can write something like
var p = p1 || p0
in F# I'm writing
let p = if not (String.IsNullOrEmpty(p1)) then p1 else p0
is there a way to write this more succinctly?
Paul Agron
@kelas6666_twitter Just create your own function to wrap this or an operator
Paul Agron
Wondering if folks have experience with SQLProvider on NetCore.
Things work for me in VS Code but fail when I dotnet build
Trying to work against MySQL
@forki I am stuck on the PR. Wanted to have a quick chat with you about what I am supposed to do. If I make the tests to pass (using the CI output log) by trimming the expectation text (then we lose info). I still cannot use
dotnet test FSharpSuite.Tests.fsproj
because in the build part the ngen crashes without any clue in the ngen.log file. Sergey mentioned something about fsi but need help to get started with that.
Sergey Tihon
@mecusorin_twitter have you tried to run build.cmd in the root, then open solution in VS2019 and run test using Test runner?
@sergey-tihon Don't have VS2019, the build is failing on ngen, no help from ngen /verbose to understand the issue. So dotnet test is out of the picture. I have VS2017 but is failing on build also.

A) I should make the tests pass by mimicking the current compiler output? Scenario in which we want to limit future regressions having current state as a base. But we lose the intended behavior of the compiler declared in the old tests.

B) I'm doing things wrong by concatenating the Expectations from old tests. In this case how should I do?

Also the fsi thing you mentioned, can you help me get started? There is a fsx script somewhere?
Sergey Tihon

Also the fsi thing you mentioned, can you help me get started? There is a fsx script somewhere?

This is a workaround if you cannot debug / run from VS.
You can start new instance of F# interactive, copy-paste the code snipped from your test and it will point you 1st waring/error

@mecusorin_twitter I think that A) is correct, I did check in my PRs all string from old test was an sub-strings of current error message from the compiler.
@forki confirmed that in new tests we need full error message for exact match.
Patrik Andersson
Is there a way to declare a Map field the same way: x: int list does a list<int>?
No way to prefix-apply more than one type parameter to a type constructor?
Loïc Denuzière
@pandemonium yes you can do (int, string) Map for Map<int, string>
Robin Munn
@pandemonium Note that if you do (int, string) Map you'll get a compiler warning: "warning FS0062: This construct is for ML compatibility. The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident<typ,...,typ>' instead. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'." So while you can do it, you probably shouldn't since (int, string) Map doesn't gain any particular readability benefits over Map<int, string> IMHO. (Whereas int list flows naturally like English, so it's more readable at a glance than list<int>).
Kor Boerema
Hi all, how do I add compiler directives using dotnet build that I can reference inside my program?
I have this in my docker file 'RUN dotnet build "testapp.fsproj" -c Release -o /app/build /p:DOCKER=true'
If I try #if DOCKER it does not work
I've seen the documentation for FSC and the properties but how do I get that from dotnet build?