Developer at large, expert typist, fungineer

Rails is missing an abstraction when it comes to building REST APIs, in my opinion. Requests route through controllers, controllers call models or services to obtain the right objects. And then…you awkwardly try to bang a JSON object together with an ERB template? It gets awkward quickly.

I came across one yesterday that immediately caught my eye. You could just use `lambda` to implement a bunch of functions that present, decorate, or map objects from one representation to another. To borrow an example:

I love that this one adds no machinery and no state. Input, function, output. With just `lambda`, you can describe a bunch of transformations and string them together into meaningful and interesting pipelines. I'm experimenting with this now, hoping to find an interesting way that functional programming approaches can make it simpler to build APIs with Rails.