Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 14 03:59
  • Mar 29 20:09
    et1975 commented #52
  • Mar 29 14:54
    panesofglass commented #52
  • Mar 29 12:21
    stroborobo commented #52
  • Mar 29 12:17
    et1975 commented #52
  • Mar 29 11:44
    stroborobo commented #52
  • Mar 29 10:44
    Build #119 passed
  • Mar 29 10:44
    stroborobo edited #52
  • Mar 29 10:43
    stroborobo opened #52
  • Mar 29 10:35
  • Oct 08 2018 13:03
    Build #118 passed
  • Oct 08 2018 13:00

    panesofglass on 8.3.1

    (compare)

  • Oct 08 2018 12:57
    Build #117 passed
  • Oct 08 2018 12:55

    panesofglass on master

    Add missing SourceLink properti… (compare)

  • Oct 08 2018 12:50
    Build #116 passed
  • Oct 08 2018 12:48
    Build #115 passed
  • Oct 08 2018 12:47

    panesofglass on master

    Bump version (compare)

  • Oct 08 2018 12:46

    panesofglass on master

    Require FSharp.Core >= 4.3.4 (compare)

  • Oct 08 2018 11:36
    Build #114 passed
  • Oct 08 2018 11:30

    panesofglass on 8.3.0

    (compare)

varon
@varon
could probably PR in a link fix, it's likely copied from the aether page.
Alexandr Sugak
@AlexSugak
@varon ok will do, thanks!
funlambda
@funlambda
is there a way for me to use Aether with ToJson/FromJson methods defined in a different assembly than the types I want to convert to/from JSON?
use Chiron*
I have a Core project that contains my "domain" types, and I can't have it reference Chiron since it needs to also compile to JS via Fable
I want to use Chiron to define mapping from these domain types to JSON, but the mapping needs to be defined in a separate server-only assembly
funlambda
@funlambda
oops, didn't realize there was a separate room for Chiron. please ignore -- will repost there
Roman Provazník
@Dzoukr
hi guys, I recently came to Chiron and I love it! I found that I can use function serializeWith and pass it custom mapping function instead of having static member ToJson, which is great. But there is no deserializeWith? Did anyone know why is it missing? I suppose it is by design so I am just curious, what is the internal reason? :)
Alexander Prooks
@aprooks
hi, that's a quick guess but deserialize receives parsed nested json representation. You can use your own function here
parsed |> myDeserialize
and there is a chiron dedicated channel ;)
Roman Provazník
@Dzoukr
oh, is there? :) thanks and sorry
btrepp
@btrepp

does anyone have any clever ideas about making lenses out of record types automatically? say with a type provider?. I don't know enough about type providers but it would be cool to do things like

type MyRecord = { property : string} 

....
MyRecord.property_ : Lens<MyRecord,string>

This can be declared simply enough with

module MyRecord = 
    let property_ : Lens<MyRecord,string> = (fun s -> s.property),(fun v s -> {s with property = v})

But that always looks the same for every property, so would be neat if it could be automatic :)

Ibnu Daru Aji
@ibnuda
Reflection?
Robin Munn
@rmunn
@btrepp - There's an RFC for expanding the capabilities of type proviers, currently in early proof-of-concept stage. Making lenses from record types automatically via a type provider was one of the use cases mentioned. Keep an eye on that one, and contribute if you're able to so that it gets completed faster, and that should be what you're looking for here.
btrepp
@btrepp
@rmunn Thanks!. Thats pretty exciting really. I will keep an eye on it.
btrepp
@btrepp
@Danl2620 serialize into what? (json?) there is a chiron gitter channel :)
Dan Liebgold
@Danl2620
(moved to xynchro/chiron)
varon
@varon
@kolektiv - xyncro/aether#47
Wojtek
@wklm
Hey Everyone :)
Could someone suggest a good example for working with nested jsons with chiron?
varon
@varon
@wklm - this is the aether channel. try the chiron one.
Wojtek
@wklm
@varon sorry, I chiron docs are pointing here
varon
@varon
no worries, probably needs a PR to fix that link
Wojtek
@wklm
:+1:
btrepp
@btrepp
So my first intro to lenses was aether, and I'm not too around the theory, but we have prism defined as Prism<'a,'b>: ('a->'b option),('a->'b->'a). I can somewhat intuit that, but sometimes I feel like I want to reach for something of the form Prism<'a,'b>: ('a-> Result<'b,string>),('a->'b->'a)
With the idea that the Prism ultimatelty tells us which part in the tree is missing
So when one goes Optic.get lens data we get Result<'a,string> with an error message about why the lens failed. (Which would be handy in logging)
Am I insane/missing the point?
Pete Johanson
@petejohanson
Shouldn't be too hard to write a function to compose prisms/lenses that way.
What are you trying to achieve by discovering where the None started in the chain?
May be slightly nicer to have the TError be a string list instead, that gets the chain appended too.
btrepp
@btrepp
Usually I've been using aether + chiron together. To parse into my own datastructures, it would be nice to debug how and why a lense failed to get a value
At the moment I find myself writing a would bunch of Result<'a,'b> code after I get specific parts of objects
giuliohome
@giuliohome
morning, I have a |> List.mapi on a list of a record type
If I want to assign (change) a member in the mapi fun, should I use a lens ?
Pete Johanson
@petejohanson
You certainly could. A lens will be more helpful if you're trying to change something ' in the record.
deeper'
giuliohome
@giuliohome
oh... deeper... you right
in this case maybe I just need record overload syntax thank you
Pete Johanson
@petejohanson
Yeah, also depends if you've already got lenses for your types defined, might as well use them.
Justin Rawlings
@jmjrawlings
Apologies if this has been asked before, but is there a way to use lenses to map between generic types? Something like this:
open Aether

let a : int option = Some 3

// This does not compile
let b : string option =
    a
    |> Optic.map Option.value_ string
varon
@varon
@jmjrawlings - This is a super late answer but...
Just map over the containing type.
a |> Option.map string
you don't need lenses in that case.
If you wanted to do it with lenses:
        let a : int option = Some 3

        let b : string option =
            a |> Optic.map string Option.value_
sashang
@sashang
Hi - how do I use chiron to query values from json data?
sorry wrong room
Torben Clasen
@Angr1st
If I have multiple Values inside of my Record that I want to use Optics to update. Could anyone be so kind to whip up a short example?