Closed Neftedollar closed 5 years ago
For example like tuples:
<@ fun (s:string) ->
let rcrd = (s,"tsda")
let (a,b) = rcrd
a @>
tree
Let (rcrd, NewTuple (s, Value ("tsda")),
Let (b, TupleGet (rcrd, 1), Let (a, TupleGet (rcrd, 0), a)))
Does it work when deserializing on the same process?
@eiriktsarpalis checking
@eiriktsarpalis
let ex = <@ fun (s:string) ->
let rcrd = {| Fst = s |}
rcrd.Fst @>
printfn "ex %A" ex
let bs = FsPickler.CreateBinarySerializer()
let bts = bs.Pickle ex
let exp = bs.UnPickle<Quotations.Expr<string -> string>>(bts)
printfn "exp unpickled: %A" exp
let f = exp.Compile()
let result = f "LALA"
printfn "result - %s" result
produce this:
ex Lambda (s,
Let (rcrd, NewRecord (<>f__AnonymousType1872059638`1', s),
PropertyGet (Some (rcrd), Fst, [])))
exp unpickled: Lambda (s,
Let (rcrd, NewRecord (<>f__AnonymousType1872059638`1', s),
PropertyGet (Some (rcrd), Fst, [])))
result - LALA
So it's working
I see https://github.com/eiriktsarpalis/TypeShape/commit/cbc42a91cad1226d8acfc2818f3592aacd2e7e34 Can I help with something?
This is expected behaviour. Anonymous records are still nominal types in disguise, each assembly generates its own definitions. So you can't really deserialize an anonymous record without having the related assembly available, much like normal records.
I'm going to close this issue.
ok. Thank you!
Hey! I'm trying to send expression from one process to another. Expression is:
And as tree
While I trying to deserialize it (another process) I'm getting error
It's ok. Deserializer trying to find type
<>f__AnonymousType1712465342
1'` But maybe deserilizer can understand that it is an anonimus type and maybe it can create another one with same structure?