senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. yugapanda (yugapanda@mstdn.jp)'s status on Wednesday, 24-Oct-2018 22:31:21 JST yugapanda yugapanda

    失敗し得る関数を書くとき、どんな言語で書いてても
    ・わかりやすさ
    ・読みやすさ
    を考慮して、戻り値の値が
    <Bool, (T | String)> みたいな感じになって、

    const [success, resultOrErrorMessage] = f(x);

    if (!success) {
    return resultOrErrorMessage;
    }

    ...

    的な感じになるモヤる気持ちを抱えて生きている(これが悪いと思っているわけではない)

    Eitherは、3つの失敗し得る関数の結果を使って何かを実行するときに、
    const a = af();
    const b = bf();
    const c = cf();

    c.flatMap(x => b.flatMap(y => a.map(z => f(x, y, z))))
    みたいになるのが辛い

    (今日のまとめ)

    In conversation Wednesday, 24-Oct-2018 22:31:21 JST from mstdn.jp permalink
    • なのやつ repeated this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.