Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Sep 10 02:24
    ByLiZhao starred learn-fsharp/think-fsharp
  • Nov 17 2017 10:37
  • Sep 24 2017 20:42
    ShalokShalom opened #7
  • Mar 30 2017 00:49

    jeroldhaas on master

    Initial conversion of Chapter 1… First draft of Chapter 2. Added… Merge remote-tracking branch 'r… and 1 more (compare)

  • Mar 30 2017 00:49
    jeroldhaas closed #6
  • Mar 29 2017 06:02
    jhurdlow opened #6
  • Mar 27 2017 07:48
    jhurdlow commented #3
  • Mar 26 2017 05:32
    cloudRoutine commented #3
  • Mar 26 2017 05:32
    jeroldhaas opened #5
  • Mar 26 2017 05:30
    jeroldhaas opened #4
  • Mar 26 2017 05:30
    jeroldhaas labeled #4
  • Mar 26 2017 05:30
    jeroldhaas labeled #4
  • Mar 26 2017 05:26
    jeroldhaas commented #3
  • Mar 26 2017 05:00

    cloudRoutine on master

    Update 01.1_fsharp_programming_… Create 01.2_the_fs_interpreter.… Update boring_stuff.md and 11 more (compare)

  • Mar 26 2017 05:00
    cloudRoutine closed #3
  • Mar 26 2017 05:00
    cloudRoutine commented #3
  • Mar 25 2017 23:39
    jhurdlow opened #3
  • Mar 25 2017 21:57
    jhurdlow closed #2
  • Mar 25 2017 21:57
    jhurdlow commented #2
  • Mar 25 2017 21:47
    jhurdlow opened #2
Alex Zhidkov
Hi. How to write a mock function for a test with signature string -> int64 option?
Alex Zhidkov
I did it this way let getId test = if true then Some(999L) else None
Yemi Bedu @ P&R
@AlexZhidkov let getId (test:string) = Some(999L)
Oscar Vargas Torres
Hi! Anyone here using https://github.com/fsprojects/ProjectScaffold ? I added FSharp.Data to process csv files. Project compiles with .\build.cmd but it also reports a strange error: http://dpaste.com/1V9WK5V
I have this source code file: http://dpaste.com/3WJ6E77
Robin Munn
@oscarvarto - That actually looks like a bug in the F# compiler service. I suggest you report it at https://github.com/fsharp/FSharp.Compiler.Service/issues, and make sure to copy your dpaste links to a Github Gist so that they won't expire in 7 days (because the F# team is rather busy working on .NET Core 2.0 issues, so someone might not look at it until after those dpaste links have expired).
Also, if you can upload your source code to a public Github repo, then you should do so, and put a link to it in your bug report so that others can also reproduce the problem. A step-by-step repro is gold when it comes to bugfixing.
Oscar Vargas Torres
@rmunn Thanks a lot for answering! I appreciate your help.
@rmunn Yesterday I created an issue in ProjectScaffold repo fsprojects/ProjectScaffold#309, maybe I could use some of that text to create an issue on the Fsharp.Compiler.Service project
Jerold Haas
@oscarvarto that's one of the most perfect issue reports I've seen
perhaps you should write a template
Hi, i have a little question: What's the recommended JSON library to use with fsharp ? I looked at chiron and NewtonSoft, they look good but the both seem unmaintained (last commit in 2016). Until now I was using fsharp data. By the way I'm on mono/linux
John Stovin
NewtonSoft is the 'goto' .NET JSON library. I don't think it's going to disappear any time soon. I don't think it's very functional though...
If I have a function let add (x:int) (y:int) = x +y whats the functional way to call this function with 2 option arguments?
Ryan Riley
@BigEpsilon Newtonsoft.Json is the most popular and the default in the Microsoft frameworks. It's great if you prefer serializing by reflection. If you want more control, especially in terms of composing serializers, then Chiron will work well for you. I don't think there's anything necessary to add to those, which is why you don't see more recent commits. They are pretty well baked.
Thx !
Oscar Vargas Torres
Hi! Has anyone used dotnet core cli to create a .NET framework project (on Linux/Mac, using mono) and run it successfully?
$ dotnet new console -lang F# --target-framework-override net462 -o hello works to create the project
Then I can compile the project, after I modify the hello.fsproj, like this:
cat hello.fsproj                                                                           ✓  4218  15:35:37
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup Condition="$(OS)=='Unix'">

    <Compile Include="Program.fs" />

Remove tour target framework to embed net core 2.0
Oscar Vargas Torres
I created a ./tools/fsharpc.exe with the following contents:
#!/usr/bin/env sh
mono /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/fsharp/fsc.exe --exename:$(basename "$0") "$@"
then $ dotnet build works
but $ dotnet run doesn't
However, $ mono bin/Debug/net462/hello.exe works
It is important to me to use with mono (.NET Framework) to be able to use type providers
@arthis ^
I have not through this particular case , sorry I cannot help
Oscar Vargas Torres
At the moment this is what I get with $ dotnet run:
System.ComponentModel.Win32Exception (0x80004005): Permission denied
   at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Microsoft.DotNet.Cli.Utils.Command.Execute()
   at Microsoft.DotNet.Tools.Run.RunCommand.Start()
   at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
hi there
Uri Goldstein
Hello. Might someone be able to help me with a newbie question I just posted on SO? https://stackoverflow.com/questions/50149863/f-this-expression-was-expected-to-have-type-datetime-but-here-has-type-unit
Uri Goldstein
Now that the above SO question has been answered, perhaps someone can help with this, even simpler SO question I have: https://stackoverflow.com/questions/50181215/f-why-does-script-file-not-recognize-module
Daniel Hines
Hello. I've got a question about FsCheck. Is this an ok place to ask?
Nikolai Paul
does F# have a validation library similar to ASP.NET MVC attribute validation?
Oscar Vargas Torres
Hi! I am trying to include a citation to .NET in a .bib document, and I cannot make it typeset .NET correctly (https://blogs.msdn.microsoft.com/dsyme/2011/03/15/netc-generics-history-some-photos-from-feb-1999/)
I know this is a F# channel, but I have asked several places before, and asking here to see if anyone from the .NET community has expericence with LaTeX
    title = {{..NET/C#} Generics History: Some Photos From Feb 1999 – Don Syme's WebLog on F# and Related Topics},
    author = {Syme, Don},
    date = {2011-03-15},
    url = {https://blogs.msdn.microsoft.com/dsyme/2011/03/15/netc-generics-history-some-photos-from-feb-1999/},
    urldate = {2018-10-01},
    file = {.NET/C# Generics History\: Some Photos From Feb 1999 – Don Syme's WebLog on F# and Related Topics:/home/oscarvarto/Zotero/storage/IV2TGS4I/netc-generics-history-some-photos-from-feb-1999.html:text/html}
This is the best I can do at the moment: {..NET/C#}
Torben Clasen
I have asked a question on SO about using TryParse to parse string to int. I know there are already answers and post on this but the old answers don't seem to work anymore. If you are interested in helping a newbie out answer the question here
Kovács György
I have a question that I didn't found an answer to
how do we manage external resources such as icons in F#?
is it the same as C#?
Alexander Pantyukhin
Hi! I have a question. What is the best way to make an architecture for apps which work intensely with db and written on functional style? I'm asking because for me is not clearthe following: when we work with functions then we in true shoud pass data and test result, but if we work with database we should check state. How it could be implemented? thanks
Arnav Borborah
Russ Freeman
Hi @alexpantyukhin, if you can keep as much of the core of your system as immutable code then it will be easier to reason about and test. Consider the onion architecture, where the core of the onion is this core application logic and the outer skin contains the side-effect-producing code (reading and writing from the DB). In languages like C# and Java, you typically use classes and interfaces to achieve this separation. In F# you would do it mostly with functions and modules. It's also easier to implement monads in F#, which allow you to write what looks like state-changing code into immutable code but separating the state-changing code from the immutable stuff. Read this post from Mark Seemann if you can. https://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/ Hope this answers your question.
Damian Reeves
Hi. I want to make a clone of the Elm parser library, it defined 2 custom operators |= and |. however |. has a higher precedence than |= in the elm library. Is it possible to define such a precedence in F# (I see docs say precedence is based on the first character, does that mean all additional characters play no part in determining subsequent precedence rules?)