Skip to content

Instantly share code, notes, and snippets.


Matsushima, Kazuhiro Gab-km

View GitHub Profile
Gab-km / TestBuilder.fs
Last active Aug 29, 2015
View TestBuilder.fs
// コンピュテーション式中で用いる型
type AssertionResult<'T> =
| NotAsserted of 'T
| Success
| Failure of string
// コンピュテーションビルダー
type TestBuilder() =
member self.Bind(x, f) =
match x with
Gab-km /
Last active Aug 29, 2015
// TVar -> TResult
interface Applyable<TVar, TResult> {
public abstract TResult apply(TVar variable);
Gab-km /
Created Oct 20, 2014
class Adder implements Applyable {
public int func(int a, int b) {
return a + b;
Gab-km /
Last active Jul 31, 2017
C# の Obsolete 属性を Python に持ち込んでみた。
def obsolete(message=None, deprecated=False):
@message 警告に表示するテキスト
@deprecated すでに非推奨の場合、True
def outer(fn):
import warnings
def inner(*args, **kwargs):
Gab-km /
Last active Aug 29, 2015
2つの dict の和を取る関数(キー重複は後勝ち)
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
Gab-km / concurrentProgramming_head.rst
Last active Aug 29, 2015
公式チュートリアルである "Getting Started with Erlang User's Guide" の翻訳 - Concurrent Programming (翻訳中)
View concurrentProgramming_head.rst
Gab-km / sequencialProgramming_head.rst
Last active Dec 17, 2015
公式チュートリアルである "Getting Started with Erlang User's Guide" の翻訳 - Sequential Programming
View sequencialProgramming_head.rst
Gab-km / introduction_head.rst
Last active Dec 17, 2015
公式チュートリアルである "Getting Started with Erlang User's Guide" の翻訳 - Introduction
View introduction_head.rst
View gist:afc2db9d6503004f6ed1
namespace FsCheck.Ext
module Test =
open System
open FsCheck
open FsCheck.Arb
type JapaneseChar = char
let japaneseChar (s: string) =
Gab-km / mailboxProcessorSample.fs
Created Aug 6, 2014
MailboxProcessor<'Message> の調べ物
View mailboxProcessorSample.fs
type Message = string * AsyncReplyChannel<string>
let agent = new MailboxProcessor<Message>(fun inbox ->
let rec loop count =
async {
System.Threading.Thread.Sleep(1000) // something busy
let! msg, replyChannel = inbox.Receive()
printfn "%s" msg
replyChannel.Reply(msg + msg)
return! loop (count + 1)
You can’t perform that action at this time.