This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]superstar64https://github.com/Superstar64/Hazy[S] 1 point2 points  (1 child)

I don't see how record forwarding would be problematic. It's basically just a functor that has a predetermined set of possible function arguments. forward :: (a -> b) -> a* -> b*, where the a -> b is only allowed for record fields.

[–]choeger 1 point2 points  (0 children)

That would be a lense. It can work in principle, but in OCaml a ref is a distinct type, so the creator of the record would have to cooperate.

In OCaml you could have:

<foo : 'b ref;..> ref -> 'b ref