Comment

Comment by dragonwriter

Kind of dubious even of the “useful” example toward the end, which can be rewritten without _1 nearly as succinctly as:

  ENV.fetch('CONFIG_PATH')
    .then &File.method(:read)
    .then &YAML.method(:parse)
    .dig('metadata', 'created_at')
    .then &Time.method(:parse)
Really, if we want more compct syntax sugar for this, letting .:<identifier> be shorthand for .method(:<identifier>) would probably be better than _1 for this circumstance and more broadly useful for making functional-style programming more concise in Ruby.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton