【Orcas】 Visual Studio 2007 【.NET3.0】at TECH
【Orcas】 Visual Studio 2007 【.NET3.0】 - 暇つぶし2ch498:名無しさん♯
07/07/28 08:01:14
作ってみた。

#light

type OptionBuilder () =
 member o.Return x = Some x
 member o.Bind (v, f) =
  match v with
   Some x -> f x
  | _ -> None
 member o.Let (x, f) = f x

let option = OptionBuilder ()

let _ =
 option
  { let x = 100
   let! y = None
   return (x * y) }
 |> print_any; print_newline ()


(実行結果)
None


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch