Jacqueline Firth

Results 451 comments of Jacqueline Firth

Ou, that's neat

Seems like something that should go in a library of math-specific lenses

Ah you're right, this would be `lens-join/struct`. `struct-pick-lens` would be something that creates a smaller struct from a larger struct: ``` > (struct foo (a b c d) #:transparent >...

I think the third is easily defined in terms of `lens-join/struct`, so I'm not sure that one's necessary. I definitely think it should possible to change the order of the...

I've thought about this one too and I'm really not sure, because you can't swap out a set of views with a new set of views without knowing which view...

Perhaps `define-struct-lenses` should throw an error when used on a struct that has a parent?

Right, but right now there's simply no mention of inheritance at all in the lens docs rather than any sort of indication that it should be avoided. Signaling the problems...

Would it even be possible to add "final" structs to the Racket runtime? That's my ideal preferred solution to this problem but I suspect the way structs are internally represented...

You're right. I think maybe this should accept lenses for the fields, and a more general read-write isomorphism would be a separate thing altogether. That seems the most natural way...

This is meant to be an isomorphism yes? I think allowing field reordering would be good. A contrived use case I can think of off the top of my head...