<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hiratara</author_name>
  <author_url>https://blog.hatena.ne.jp/hiratara/</author_url>
  <blog_title>Pixel Pedals of Tomakomai</blog_title>
  <blog_url>https://hiratara.hatenadiary.jp/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>数学</anon>
    <anon>Monad</anon>
  </categories>
  <description>先に言っときますが、決して役に立つエントリではないので圏論やコルーチンみたいなものに興味がある人だけどうぞｗPythonにおけるHaskellチックなdo記法をジェネレータで実装する方法に心惹かれたので、Perlで真似してみました。ジェネレータはコルーチン的な振る舞いをするので、PerlではCoroを使うと楽でしょう。以前のエントリで作ったMaybeモナド*1を利用して、以下のようなシンタックスシュガーを作ってみます。 my $may_div = sub { my ($x, $y) = @_; return $y ? just($x / $y) : nothing; }; my $maybe_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhiratara.hatenadiary.jp%2Fentry%2F20100719%2F1279552182&quot; title=&quot;モナドのdo記法をPerlのCoroで実装してみた - Pixel Pedals of Tomakomai&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>2010-07-19 00:09:42</published>
  <title>モナドのdo記法をPerlのCoroで実装してみた</title>
  <type>rich</type>
  <url>https://hiratara.hatenadiary.jp/entry/20100719/1279552182</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
