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? :)
parsed |> myDeserialize
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 :)
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)
Result<'a,string>
with an error message about why the lens failed. (Which would be handy in logging)
TError
be a string list instead, that gets the chain appended too.