| タイトル: | Erlang ユーザーガイドから始めよう |
|---|---|
| バージョン: | 6.2 |
| 原文: | Erlang -- Getting Started with Erlang User's Guide |
| 原文の著作権者: | Ericsson AB. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // コンピュテーション式中で用いる型 | |
| type AssertionResult<'T> = | |
| | NotAsserted of 'T | |
| | Success | |
| | Failure of string | |
| // コンピュテーションビルダー | |
| type TestBuilder() = | |
| member self.Bind(x, f) = | |
| match x with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // TVar -> TResult | |
| interface Applyable<TVar, TResult> { | |
| public abstract TResult apply(TVar variable); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Adder implements Applyable { | |
| @override | |
| public int func(int a, int b) { | |
| return a + b; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def obsolete(message=None, deprecated=False): | |
| """今後使用しない関数やメソッドにマークを付けます。 | |
| @message 警告に表示するテキスト | |
| @deprecated すでに非推奨の場合、True | |
| 今後非推奨になる予定の場合、False | |
| @see http://msdn.microsoft.com/ja-jp/library/system.obsoleteattribute.aspx | |
| """ | |
| def outer(fn): | |
| import warnings | |
| def inner(*args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def add_dict(this, other): | |
| """2つの dict の和を取る関数(キー重複は後勝ち) | |
| @this ベースとなる dict オブジェクト | |
| @other 追加される dict オブジェクト | |
| @return 2つの dict を合成した dict | |
| """ | |
| result = this.copy() | |
| for key in other: | |
| result[key] = other[key] | |
| return result |
| タイトル: | Erlang ユーザーガイドから始めよう |
|---|---|
| バージョン: | 6.2 |
| 原文: | Erlang -- Getting Started with Erlang User's Guide |
| 原文の著作権者: | Ericsson AB. |
| タイトル: | Erlang ユーザーガイドから始めよう |
|---|---|
| バージョン: | 6.2 / 7.1 |
| 原文: | Erlang -- Getting Started with Erlang User's Guide |
| 原文の著作権者: | Ericsson AB. |
| タイトル: | Erlang ユーザーガイドから始めよう |
|---|---|
| バージョン: | 7.2 |
| 原文: | Erlang -- Getting Started with Erlang User's Guide |
| 原文の著作権者: | Ericsson AB. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace FsCheck.Ext | |
| module Test = | |
| open System | |
| open FsCheck | |
| open FsCheck.Arb | |
| type JapaneseChar = char | |
| let japaneseChar (s: string) = |