DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 967,911 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Yufan Lou
Yufan Lou

Posted on

Lens in 2007

Making Haskell nicer for game programming | Luke Palmer

Luke described in this 2007 blog post an Accessor type:

data Accessor a
    = Accessor { readVal :: Game a
               , writeVal :: a -> Game ()
               }

And used C macro to generate this for each field, and defined some familiar operators for it.

Nowadays the lens library is the most popular implementation of this pattern, and Template Haskell is used for generating the field lenses. The first version of the lens library was uploaded to Hackage in 2012. There might be even older examples of this pattern.

How long does it take for a spark of ingenuity like this to develop into a field of research? How long then does it take for the research to become mature applied library? How much is it worth to do so?

Top comments (0)

🌚 Life is too short to browse without dark mode