エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
テストをコンピュテーション式で書けないか、という思考実験
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
テストをコンピュテーション式で書けないか、という思考実験
TestBuilder.fs �5�� // コンピュテーション式中で用いる型 type AssertionResult<'T> = | NotAsserted ... TestBuilder.fs �5�� // コンピュテーション式中で用いる型 type AssertionResult<'T> = | NotAsserted of 'T | Success | Failure of string // コンピュテーションビルダー type TestBuilder() = member self.Bind(x, f) = match x with | NotAsserted(y) -> f y | z -> z member self.Return(_) = Success member self.ReturnFrom(x) = x // アサート用関数 let assertEqual<'T when 'T : equality> (x: 'T) (y: 'T) : AssertionResult<'T> = if x = y then Success