
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
// 代数的データ型を関数に、 // パターンマッチを関数適用に見立てる宣言 const caseOf = match => adt... // 代数的データ型を関数に、 // パターンマッチを関数適用に見立てる宣言 const caseOf = match => adt => adt(match); // Haskell の Maybe を意識した何か const Nothing = () => ({Nothing}) => Nothing(); const Just = x => ({Just}) => Just(x); const guard = flg => flg ? Just() : Nothing(); const fmap = f => caseOf({ Nothing, Just: x => Just(f(x)) }); const fromMaybe = v => caseOf({ Nothing: () => v, Just: x => x }); // 定数関数 const con$t = x => _