fsprojects / Fleece

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

F#+ Lenses #27

Closed wallymathieu closed 6 years ago

wallymathieu commented 6 years ago

Additional tests needed

Starting to port lenses from lens-aeson

Note: Depends on pre release version of f#+

gusty commented 6 years ago

I don't think we need to change to Result to implement F#+ lenses.

However it would make sense for this library to switch to Result, but IMHO we should treat it as a separate issue.

wallymathieu commented 6 years ago

Yes, that makes sense.

wallymathieu commented 6 years ago

I'll fix it after the next f#+ release

wallymathieu commented 6 years ago

We need to verify that usage of the lenses doesn't cause to much of a slowdown when used.

gusty commented 6 years ago

If they do so, it may be worth exploring other lens implementations, based on Data.Lens and add PR to F#+ to a different namespace.

wallymathieu commented 6 years ago

I'm not sure lenses are needed as much for JSON data, since the format is inherently mutable.

gusty commented 6 years ago

I think there are valid scenarios for lenses here. Anyway I'm not sure if Control Lenses are really needed.

As Json is dynamic, we might not need polymorphic updates.

But, then the first step would be to create Data.Lenses, possibly with the same interface (operators, functions and lenses).

wallymathieu commented 6 years ago

Sounds like a plan 😄

wallymathieu commented 6 years ago

It would be nice of you could mix them somehow?

wallymathieu commented 6 years ago

The compilation cost of lenses are now negligible! Awesome work @gusty !

wallymathieu commented 6 years ago

Compilation times: