dotnet / dotnet/infer

Some FSharpWrapper operators conflict with built-in F# operators

Open
#90 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.6k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

Operators `>>` and `<<` defined in `src\FSharpWrapper\FSharpWrapper.fs`
conflict with built-in F# function composition operators.

Example. The following code:

```fsharp
open Microsoft.ML.Probabilistic.FSharp

let f2 x = x * 2
let f3 x = x * 3
let f6 = f2 >> f3
```

results in the compiler error:

```
error FS0001: Expecting a type supporting the operator '>' but given a function
type. You may be missing an argument to a function.
```

If we comment out `open Microsoft.ML.Probabilistic.FSharp` then it compiles.
But then it is harder to work with F# wrapper features, especially operators.

If the choice of operators was not an intentional design decision with
awareness of the conflicts, can these operators be changed?

Contributor guide

Open the contributing guide

Research direction

Start in src\FSharpWrapper\FSharpWrapper.fs and reproduce the reported conflict by opening Microsoft.ML.Probabilistic.FSharp and composing f2 and f3 with >>. Determine whether the operator definitions can be changed without losing the F# wrapper functionality, then verify that the example compiles while the wrapper operators remain available.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.