å ã«è¨ã£ã¨ãã¾ããã決ãã¦å½¹ã«ç«ã¤ã¨ã³ããªã§ã¯ãªãã®ã§åè«ãã³ã«ã¼ãã³ã¿ãããªãã®ã«èå³ããã人ã ãã©ããï½ Pythonã«ãããHaskellããã¯ãªdoè¨æ³ãã¸ã§ãã¬ã¼ã¿ã§å®è£ ããæ¹æ³ã«å¿æ¹ãããã®ã§ãPerlã§çä¼¼ãã¦ã¿ã¾ããã ã¸ã§ãã¬ã¼ã¿ã¯ã³ã«ã¼ãã³çãªæ¯ãèããããã®ã§ãPerlã§ã¯Coroã使ãã¨æ¥½ã§ãããã以åã®ã¨ã³ããªã§ä½ã£ãMaybeã¢ãã*1ãå©ç¨ãã¦ã以ä¸ã®ãããªã·ã³ã¿ãã¯ã¹ã·ã¥ã¬ã¼ãä½ã£ã¦ã¿ã¾ãã my $may_div = sub { my ($x, $y) = @_; return $y ? just($x / $y) : nothing; }; my $maybe_divs = do_monad { my $v1 = retrieve $may_div->(3.0, 1.0); my $v2 = retrieve $may_div->(2.0, 1.0);
{{#tags}}- {{label}}
{{/tags}}