Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I didn't describe them! I just told you what the state of play is.

A lens is a "functional reference". Say you have a data structure of some kind. You can create a lens which points at one of the fields. It lets you get and set that field. Because this is functional programming, when you set the field, you get given a new reference to the whole structure (can't change things in place). So, naturally the way lenses are used involves combinining a reference to a structure of type A, a lens which refers to a field within type A, and, if you are setting the field (not getting it) then you supply the new value as well.

The jury is still out on whether writing programs in this style is wise, but the notion of a lens is fixed now.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: