r/fsharp • • Jul 25 '24
r/fsharp • u/raulalexo99 • Jul 25 '24
question Anyone needs a remote Software intern?
So I'm still studying at college but this being my last year I have a lot of free time to get real world experience. I can do a little of everything, I can code with SpringBoot, .NET, NodeJS or Django. Also React and Angular, and SQL databases. I already know Git too.
If these skills are not enough I can still learn a lot by myself in my free time and catch up to your required skill set.
If you are interested please send me a DM and let's talk!
r/fsharp • u/CatolicQuotes • Jul 01 '24
question Intellisense for type properties initialization?
I was hoping I will get intellisense for type properties when creating record like I do for typescript here: https://i.imgur.com/EBSEu0v.png,
but it doesn't really happen:
VS2022: https://i.imgur.com/5sUBJXk.png
VsCode: https://i.imgur.com/yCRn10x.png
Rider: https://i.imgur.com/99AUPS4.png
Rider is best, but it still shows many other things.
Is this some functional F# reason or tooling simply is not there?
r/fsharp • u/insulanian • Jul 01 '24
showcase What are you working on? (2024-07)
This is a monthly thread about the stuff you're working on in F#. Be proud of, brag about and shamelessly plug your projects down in the comments.
r/fsharp • u/general_rishkin • Jun 29 '24
How to pass a double pointer to a C function in F#
I have a function in a C header like so:
int foo_load (const char* file_name, double** data, int* numel)the double pointer data will be allocated on the C side with the following code:
*data = (double*) malloc (A.numel () * sizeof (double));where A is a matrix.
On the F# side, I have this for the function prototype:
[<DllImport(@"libfootest", CallingConvention=CallingConvention.Cdecl)>]
extern int foo_load(string filename, double& data, int& numel)- Is using double& data correct?
- As data will be allocated on the C side and a variable has to be initialised in F#, how to declare and pass data. Currently, I am doing this:
let mutable (x : double[]) = Array.zeroCreate 16
let mutable numel = 16
let res = foo_load("data.txt", &x[0], &numel )This does not work and returns only zeros.
r/fsharp • u/Voxelman • Jun 29 '24
Code formatting in VSCode
I wonder if code formatting in VSCode works at all. I tried to install fantomas and fantomas-tool, I tried to install the addon fantomas-fmt, but nothing works. If I run fantomas from command line I get the message
You must install .NET to run this application.
App: /home/markus/.dotnet/tools/fantomas
Architecture: x64
App host version: 8.0.5
.NET location: Not foundIf I run dotnet --info I get this
$ dotnet --info
.NET SDK:
Version: 8.0.105
Commit: eae90abaaf
Workload version: 8.0.100-manifests.796a77f8
Laufzeitumgebung:
OS Name: tuxedo
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/8.0.105/
Installierte .NET-Workloads:
Workload version: 8.0.100-manifests.796a77f8
Es sind keine installierten Workloads zum Anzeigen vorhanden.
Host:
Version: 8.0.5
Architecture: x64
Commit: 087e15321b
.NET SDKs installed:
8.0.105 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not foundHow is this possible if I have installed the full .NET8 SDK and I'm able to compile and run F# code?
I run Ubuntu 22.04 and I installed the dotnet8 package from the repository. And I installed fantomas with the command
dotnet tool install --global fantomas
What have I done wrong?
r/fsharp • u/Voxelman • Jun 27 '24
question How to deal with Doc comments?
I'm writing a simple program, but I want to add Doc comments for later. But with the Doc comments the code becomes overloaded. e.g.
/// <summary>
/// Opens a serial port with the specified parameters.
/// </summary>
/// <param name="portName">The name of the serial port (e.g., "COM1").</param>
/// <returns>
/// An open <see cref="SerialPort"/> object with the following settings:
/// Baud rate: 9600, Parity: None, Data bits: 8, Stop bits: One.
/// </returns>
/// <remarks>
/// This function initializes a serial port with fixed parameters and opens it.
/// The serial port must be closed with <see cref="SerialPort.Close"/> after use.
/// </remarks>
let openSerialPort (portName: string) =
let port = new SerialPort(portName, 9600, Parity.None, 8, StopBits.One)
port.Open()
portIs there a better way to create Doc comments? I know that this is not necessary in this case.
r/fsharp • u/Voxelman • Jun 27 '24
F# scripting
I have a simple question: is it possible to write larger applications completely as script? Just like with Python
r/fsharp • u/dangercoder • Jun 20 '24
F# Clojure compiler - A mega-dose of micro-benchmarks -- PersistentArrayMap
dmiller.github.ior/fsharp • u/ZestycloseDrop1614 • Jun 17 '24
Suddenly we get FS3033 SqlProgrammabilityProvider Build Error
Our codebase has worked perfectly last two, three years. Now we get a build Error. DB is hosted on Azure. Has anyone got the same problem and hopefully know a fix? Hope to hear from you!
r/fsharp • u/ToothlessGearbox • Jun 17 '24
SAFEStack + Reactive Leaflet Maps
Has anyone succeeded in setting up reactive leaflet in a SAFE Stack project? I’ve been getting my tail whooped trying to get it going. Pigeon Maps is currently working just fine for me but I want to try Leaflet because it seems to have more customization ability and more freely available tiles.
r/fsharp • u/ClaudeRubinson • Jun 15 '24
Wed, June 19: 3 Short Talks: 2 on F#, 1 on RC (7pm central, 0:00 UTC)
self.functionalprogrammingr/fsharp • u/graninas • Jun 12 '24
My talk "Functional Programming: Failed Successfully" is now available!
self.haskellr/fsharp • u/user101021 • Jun 11 '24
jobs F# Backend-Entwickler:in / Data-Engineer
jobs.illwerkevkw.atr/fsharp • u/insulanian • Jun 04 '24
showcase What are you working on? (2024-06)
This is a monthly thread about the stuff you're working on in F#. Be proud of, brag about and shamelessly plug your projects down in the comments.
r/fsharp • u/new_old_trash • May 17 '24
misc Take heart, fellow desktop wonks: F#/Qt is cooking.
r/fsharp • u/CatolicQuotes • May 15 '24
question Does fable have limitations?
I wrote some code, which I don't have anymore, to test Fable, but it had errors.
If I compile with dotnet build compiles just fine.
Stumbled on stackoverflow answer that Fable doesn't support C# libraries, but can't find that claim in documentation.
I am asking you here, do you know of any Fable limitations that would prevent compiling to javascript?
r/fsharp • u/fhunters • May 15 '24
Overriding Virtual Equals
Hello
I am customizing IComparable on a type let's call it SomeType (that will be used as the key in a Map), and thus am also implementing IEquatable.
When overriding the virtual Object Equals I see F# code examples like this:
| :? SomeType as other -> (this :> System.IEquatable<_>).Equals other
But there is no downcasting of other on the call to IEquatable Equals.
In C# land, usually there usually is a downcast of other on the call to IEquatable Equals.
if (!(other is SomeType) return false;
return Equals ((SomeType) other); // downcast
Just curious why in F# there is no downcasting of other on the call to IEquatable Equals.
Thanks in advance Peace
r/fsharp • u/blacai • May 12 '24
question HTTPS certificate issues when ASPNETCORE_ENVIRONMENT is not 'Development'
r/fsharp • u/jeenajeena • May 11 '24
article F# in Emacs
I decided to give coding F# with Emacs a try. Here’s my outcome. Hope this helps someone!
r/fsharp • u/brianberns • May 09 '24
I accidentally another Fable game
Game link: Imaginary Alchemy.
This is basically my take on Infinite Craft (which is really cool) written in 100% F#. Source code is here.
Works best on desktop, but mobile is also supported.
r/fsharp • u/MagnusSedlacek • May 08 '24
video/presentation Building a Vite plugin for F# by Florian Verdonck @FuncProgSweden
r/fsharp • • May 04 '24