<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Windymelt</author_name>
  <author_url>https://blog.hatena.ne.jp/Windymelt/</author_url>
  <blog_title>Lambdaカクテル</blog_title>
  <blog_url>https://blog.3qe.us/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>scala</anon>
  </categories>
  <description>Scalaには2.13からpipeという面白いメソッドが追加されている。a pipe fと書くとf(a)になるという、それだけの仕組みだ。Elixirなどの他の言語では|&gt;といった記号で導入されている。 blog.knoldus.com 記号の氾濫を避けるためにScalaは公式には単体の演算子を提供するつもりはない*1ようだが、Scala 3から使えるextension記法でパイプライン演算子を定義して遊んでみよう。 まずはパイプラインでくっつけたい関数を定義しておこう: val plus1 = (n: Int) =&gt; n + 1 val double = (n: Int) =&gt; n * 2 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.3qe.us%2Fentry%2F2023%2F01%2F30%2F204224&quot; title=&quot;Scalaのpipeでパイプライン演算子を作って遊ぶ - Lambdaカクテル&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-01-30 20:42:24</published>
  <title>Scalaのpipeでパイプライン演算子を作って遊ぶ</title>
  <type>rich</type>
  <url>https://blog.3qe.us/entry/2023/01/30/204224</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
