fsprojects / Fleece

Json mapper for F#
http://fsprojects.github.io/Fleece
Apache License 2.0
199 stars 31 forks source link

Simplify dependencies #15

Closed dtchepak closed 6 years ago

dtchepak commented 8 years ago

Hi @mausch,

Not sure if this is a silly idea, but was wondering if it is possible to drop the FsControl and FSharpPlus dependencies from Fleece? Beyond map/apply/traverse for Choice<'a,'b> I'm not sure where else they are used?

I'm happy to try a PR if this sounds reasonable.

mausch commented 8 years ago

I remember having a conversation on twitter about this a long time ago, but twitter search is hopeless.

In that conversation I argued that I was using FSharpPlus in all applications using Fleece anyway, so it just made sense to me to include the dependency in Fleece to make the code in Fleece shorter/simpler.

That said, this is the second time I get the request so I'm more open to changing my mind. Out of curiosity, do you use traverse in your applications? Are you using another library that implements these things?

dtchepak commented 8 years ago

I was using FSharpPlus in all applications using Fleece anyway, so it just made sense to me to include the dependency in Fleece to make the code in Fleece shorter/simpler.

Fair enough. :)

I'm probably in the minority here, but I've had a few cases come up recently where i only wanted toJSON for a couple of types, and so pulled in Fleece which pulled in the other dependencies I wasn't going to use, and then couldn't compile anyway due to this issue. I ended up having to roll my own mini-toJSON, hence me making the suggestion.

Out of curiosity, do you use traverse in your applications? Are you using another library that implements these things?

I've only worked on pretty small F# programs, where I haven't found I've needed much in terms of a generalised traverse (this might just be due to my inexperience). Instead I just add specific versions for each type when/if I need it, or pull in FSharpx.Extras.

gusty commented 8 years ago

Please note that the issue you are linking is an F# issue and it doesn't prevent you to compile. It just prints some warnings which are relevant to the F# team to debug an internal issue that exists since earlier F# versions. Adding a nowarn is just fine.

dtchepak commented 8 years ago

Thanks @gmpl, I'd forgotten that workaround (I have warnings-as-errors).

wallymathieu commented 6 years ago

Since FsControl is merged into F#+, can we close this issue?

gusty commented 6 years ago

I would say yes. I think it makes sense to keep using F#+ instead of getting dependencies in many other libraries. Also, if we decide to implement parsers, codecs, F#+ would be very helpful and maybe we can simplify a bit more the dependencies once we have a working parser and a "neutral" version of Fleece.