Skip to content

Instantly share code, notes, and snippets.

Matsushima, Kazuhiro Gab-km

Block or report user

Report or block Gab-km

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Gab-km
Gab-km / Applyable.java
Last active Aug 29, 2015
カリー化とインターフェイス
View Applyable.java
// TVar -> TResult
interface Applyable<TVar, TResult> {
public abstract TResult apply(TVar variable);
}
@Gab-km
Gab-km / Adder.java
Created Oct 20, 2014
高階関数とインターフェイス
View Adder.java
class Adder implements Applyable {
@override
public int func(int a, int b) {
return a + b;
}
}
@Gab-km
Gab-km / obsolete.py
Last active Jul 31, 2017
C# の Obsolete 属性を Python に持ち込んでみた。
View obsolete.py
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):
@Gab-km
Gab-km / dict.py
Last active Aug 29, 2015
2つの dict の和を取る関数(キー重複は後勝ち)
View dict.py
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
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
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
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
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)
View CoYoneda.fs
namespace FSharp.Monad
type CoYoneda<'U> =
abstract Run: obj -> 'U
type CoYoneda<'F, 'A>(fi: 'F, k: CoYoneda<'A>) = class end
module CoYoneda =
let apply fa k =
You can’t perform that action at this time.