2016-08-01から1ヶ月間の記事一覧

Socket.IO やってみた

const Http = require( 'http' ); const Express = require( 'express' ); const Socket_IO = require( 'socket.io' ); const app = Express(); const server = Http.createServer( app ); const io = Socket_IO( server ); const port = 3000; app.get( '/'…

ファイルの順番の話

こーいう F# のソースファイルがありますよね。 Batteries.Env モジュールと: // env.fs module Batteries open System module Env = let at (index : int) = let argv = Environment.GetCommandLineArgs() argv.[index] let get = at それを参照する main.f…

Argu すごい

Argu は F# 製のコマンドラインパーサーだよ。 gmake のオプションを前半だけ書いてみた。 type Arguments = | [<AltCommandLine("-B")>] Always_Make | [<AltCommandLine("-C")>] Directory of dir : string | Debug of mode : DebugMode option | [<AltCommandLine("-e")>] Environment_Overrides | Eval of expr : string | [<AltCommandLine("-f")></altcommandline("-f")></altcommandline("-e")></altcommandline("-c")></altcommandline("-b")>…

printfn とかで出力する時に

最近までこんな風にやってたんだけど: let name = user.GetName() // printfn "Hello, %s!" user.GetName() はエラーになっちゃうので // 一旦、変数に束縛する。 printfn "Hello, %s!" name 別にそんなことをする必要はなかったらしい。 <| を使うんだルー…