Last active
September 13, 2015 04:05
-
-
Save pocketberserker/b0f67590f0bcc615b330 to your computer and use it in GitHub Desktop.
コンピュテーション式でてきとーに日本語を使ってみる
This file contains 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 ホモビルダー() = | |
member __.Delay(f: unit -> _) = f | |
member __.Run(f) = f () | |
member __.Yield(()) = "" | |
member __.Yield(x: string) = x | |
[<CustomOperation("攻め")>] | |
member inline __.攻め(_, case) = case | |
[<CustomOperation("受け")>] | |
member inline __.受け(source: string, case) = (source, case) | |
[<CustomOperation("┌(┌^o^)┐")>] | |
member __.ホモォ((攻め, 受け)) = printfn "%s × %s" 攻め 受け | |
let ホモ = ホモビルダー() | |
ホモ { | |
攻め "hoge" | |
受け "fuga" | |
``┌(┌^o^)┐`` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment