fsprojects / FSharp.Compatibility

Compatibility libraries for F#
44 stars 22 forks source link

Integration of the Haskell compatibility layer of FSharpPlus #10

Closed ShalokShalom closed 6 years ago

ShalokShalom commented 6 years ago

Here, you can find a comprehensive integration for Haskell. The maintainer think, its nice to move the code into this repo here. See also: https://github.com/gusty/FSharpPlus/issues/66

jmquigs commented 6 years ago

If you create a PR and the maintainer of FSharpPlus approves, I can merge it.

Meanwhile, I will attempt to fix the broken build on this project. Its been broken for about 2 years so I suppose no one else plans to fix it 😜

gusty commented 6 years ago

We approve it, as from our conversations today regarding this possibility !

I'm happy to help, specially with code samples. We're not yet in v1.0 but we're pretty close and most stuff relevant for Haskell compatibility is not likely to change, but we need to stabilize the namespaces before that PR, anyway I was thinking in working on that issue next, as the suggestions from @wallymathieu make sense to me and haven't heard any voice against it.

@ShalokShalom are you willing to do the PR yourself ?

Of interest, I did once a quick port of some Haskell libraries, not a big thing, just a pair commits but might be relevant for this project.

ShalokShalom commented 6 years ago

@gusty I prefer to let you do this. :)

gusty commented 6 years ago

No worries, I can do the PR. But then re-open the issue and assign it to me, we'll close it when the PR is implemented.

This PR will depend on @jmquigs fixing the build and myself stabilizing the stuff above mentioned in F#+ side.

ShalokShalom commented 6 years ago

The assignment is up to the repo owner.

jmquigs commented 6 years ago

I am working on repairing the build. Hope to have it fixed in next few days...

jmquigs commented 6 years ago

The build is fixed. All I did was re-run it again on travis, so it was likely just some build environment error. You should be clear to make your PR; let me know if you run into other issues with the project.

gusty commented 6 years ago

Cool ! I just stabilized the namespaces, I will check what else needs to be done and once finished I will start working in the PR.

jmquigs commented 6 years ago

PR https://github.com/fsprojects/FSharp.Compatibility/pull/11 merged, closing this.

ShalokShalom commented 6 years ago

There is currently no mention about this in the Readme and I am unsure what to commit

wallymathieu commented 6 years ago

Yes, it would be nice to see what can be done in terms of documentation to increase the visibility of this project.

ShalokShalom commented 6 years ago

I adopted our compability table so that it applies to this new home:

https://gist.github.com/ShalokShalom/11cf9b1943d36ac51939e83bb0fced84

wallymathieu commented 6 years ago

That would probably be very nice to have in FSharp.Compability. What does @jmquigs think?

ShalokShalom commented 6 years ago

Ahm, the >>= operator is actually not defined in standard fsharp, so we should remove it from this place? I would also love too see the other operators named, such as $ I am just not aware, whats the most suitable name for them

wallymathieu commented 6 years ago

Well, the table is probably from the viewpoint of F#+ in the second column?

ShalokShalom commented 6 years ago

Yes

And in the viewpoint of standard fsharp in the first one?

wallymathieu commented 6 years ago

The first column is Operation ?

ShalokShalom commented 6 years ago

Oh, so you mean it :)

From that perspective, I see less sense to leave FSharp plus in now?

wallymathieu commented 6 years ago

Exactly, F#+ is used in order to implement the Haskell Compatibility. But the perspective should perhaps be from standard F# ?

ShalokShalom commented 6 years ago

What I mean?

wallymathieu commented 6 years ago

Aaa 😄

ShalokShalom commented 6 years ago

Standard F# has no bind operator (why ever) and thus that can we cancel it from the F# column?

ShalokShalom commented 6 years ago

Ok, fine

I will do it

wallymathieu commented 6 years ago

Many libraries and types define something like TypeName.bind

wallymathieu commented 6 years ago

https://fsharpforfunandprofit.com/posts/computation-expressions-bind/

wallymathieu commented 6 years ago

Sweet 👍

ShalokShalom commented 6 years ago

I removed <|> also As said, my awareness of the language is very small, so everybody is invited to change this gist :D

ShalokShalom commented 6 years ago

I guess this here should also be part of it: https://github.com/gusty/FsControl/blob/master/FsControl.Core/Samples/Haskell.fsx

Can anybody reopen this issue here, if you consider the documentation as part of the implementation?

Does anybody maintain this here actually, currently? :)

wallymathieu commented 6 years ago

It is maintained. Adding a pull request to fix that part of the docs would be very welcome!

gusty commented 6 years ago

Agree, also note that some examples are already in place at https://github.com/fsprojects/FSharp.Compatibility/blob/master/FSharp.Compatibility.Haskell/Sample.fsx

I would select specific fragments of the old file you pointed, only parts that are considered interesting, without polluting it too much.

To add more background on that file, it dates even before the unit tests, so in practice it was also used to test the compilation.

ShalokShalom commented 6 years ago

I like to add that I consider myself as too low skilled in that area, I cant decide what is suitable to get picked up and where we should put it. :)

wallymathieu commented 6 years ago

Easiest thing is to add it to markdown file in Haskell compatibility so that you can navigate the source and see it directly. Right now this repo does not use FSharp.Formatting (and it might be a bit much to do that at this point).