Skip to content

Instantly share code, notes, and snippets.

View tyru's full-sized avatar
🏠
Working from home

Fujiwara Takuya tyru

🏠
Working from home
View GitHub Profile
@tyru
tyru / pn.hs
Created December 19, 2011 01:24 — forked from anonymous/pn.hs
Polish Notation
import qualified Data.Char as Ctype
main = do cs <- getContents
print $ calculate $ parse cs
-- TODO: op n1 n2 以外の式にも対応
calculate :: [Token] -> Int
calculate (op:n1:n2:rest) =
@tyru
tyru / rpn.hs
Created December 19, 2011 05:14 — forked from anonymous/rpn.hs
import qualified Data.Char as Ctype
main = do cs <- getContents
putStr $ unlines $ map (show . calculate . parse) $ lines cs
calculate :: [Token] -> Int
calculate cs = calculate' [] cs
where
@tyru
tyru / Changes
Created June 7, 2012 16:23 — forked from mattn/Changes
修正予定な箇所
9ee1a32
Data.String: diffidx does not handle multi-byte string.
b2bbfdd
add modeline (see #21 for the discussion)
3bb4cee
Fixed detecting case-insensitive system.
@tyru
tyru / .vimrc
Last active January 10, 2016 00:18 — forked from hinagishi/.vimrc
if has('vim_starting')
set rtp+=~/.vim/bundle/vivacious.vim
endif
filetype plugin indent on
call vivacious#bundle()
set fileencodings=utf-8,iso-2022-jp,cp932,sjis,euc-jp
@tyru
tyru / function-type-test.js
Created February 12, 2016 15:36 — forked from davidosomething/function-type-test.js
Various function styles for testing
/*eslint-env es6*/
// ES6 generator function
var anonymousGeneratorFunctionExpression = function* (arg1, arg2) {
};
var namedGeneratorFunctionExpression = function* namedGenerator(arg1, arg2) {
};