DEV Community

Yufan Lou
Yufan Lou

Posted on

1 1

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay