loading...

Lens in 2007

louy2 profile image Yufan Lou ・1 min read

Random Thoughts (16 Part Series)

1) Clojure and Rust are Duals 2) PLFA 3 ... 14 3) Hey.com tackles Unsolicited Bulk Emails with Screening Feature 4) A-chip Mac 5) Template Haskell vs GHC.Generic 6) Lens in 2007 7) (Not) Finally Tagless in Rust 8) Erlang Punctuations 9) Tagless-Final is a Powerful Footgun 10) (Ok) Tagless Final in Rust 11) Today I Learned (Not) Reflection 12) Today I Learned Program and Coprogram 13) Apple Silicon Is Also A Chance To Improve Security 14) Three Vim Features 15) Implementation vs Specification 16) A Merit of Learning a New Language

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?

Random Thoughts (16 Part Series)

1) Clojure and Rust are Duals 2) PLFA 3 ... 14 3) Hey.com tackles Unsolicited Bulk Emails with Screening Feature 4) A-chip Mac 5) Template Haskell vs GHC.Generic 6) Lens in 2007 7) (Not) Finally Tagless in Rust 8) Erlang Punctuations 9) Tagless-Final is a Powerful Footgun 10) (Ok) Tagless Final in Rust 11) Today I Learned (Not) Reflection 12) Today I Learned Program and Coprogram 13) Apple Silicon Is Also A Chance To Improve Security 14) Three Vim Features 15) Implementation vs Specification 16) A Merit of Learning a New Language

Posted on by:

louy2 profile

Yufan Lou

@louy2

Learning Rust and Haskell, tired of JavaScript. Thinks Ruby is awesome except that it is not cross-platform enough. 日本語 / 中文 OK. He/him.

Discussion

markdown guide