This file contains hidden or 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
let rec zip lst1 lst2 = | |
match (lst1,lst2) with | |
| ([],_) | (_,[]) -> [] | |
| ((x::xs),(y::ys)) -> (x,y)::zip xs ys |
This file contains hidden or 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
(*´・_・`*) | |
let rec unzip = function | |
| [] -> ([],[]) | |
| (x,y)::xs -> (x::fst (unzip xs),y::snd (unzip xs)) |
This file contains hidden or 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
let rec filter p = function | |
| [] -> [] | |
| x::xs -> if p x then x::filter p xs else filter p xs |
This file contains hidden or 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
let rec take lst n = | |
match (lst,n) with | |
| ([],_) -> [] | |
| (x::xs,m) -> if m <= 0 then [] else x::(take xs) (m-1) | |
let rec drop lst n = | |
match (lst,n) with | |
| ([],_) -> [] | |
| (x::xs,m) -> if m > 1 then take xs (m-1) else xs |
This file contains hidden or 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
let rec max_list = function | |
| [] -> 0 | |
| x::xs -> let max = max_list xs in if x >= max then x else max |
This file contains hidden or 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
let rec mem a s = | |
match (a,s) with | |
| (_,[]) -> false | |
| (b,x::xs) -> if b = x then true else mem b xs |
This file contains hidden or 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
import System.Environment | |
import Data.List | |
import System.Directory | |
import System.IO | |
import Control.Exception | |
dispatch :: String -> [String] -> IO () | |
dispatch "add" = add | |
dispatch "view" = view | |
dispatch "remove" = remove |
This file contains hidden or 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
//grepでdefのある行を抽出したファイルからvim用のdict向けに結果を出力 | |
//例:grep -r -h def */scalaz-scalaz-seven > scalaz.txt | |
// scalaToDict.scala scalaz.txt > scalaz.dict | |
import scala.io.Source | |
val reg = """def\s(.+?)[\s\[\(]""".r | |
if(args.length > 0) { | |
val lines = Source.fromFile(args(0)).getLines().toList | |
val defdict = for(line <- lines;m <- reg.findFirstMatchIn(line)) yield m.group(1) | |
val defdictsorted = defdict.sorted.distinct | |
defdictsorted.foreach(println) |
This file contains hidden or 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
set nocompatible | |
set hidden | |
filetype off | |
set autoread | |
set noswapfile | |
if has('vim_starting') | |
set runtimepath+=~/.vim/bundle/neobundle.vim | |
call neobundle#rc(expand('~/.vim/bundle')) | |
endif |
This file contains hidden or 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
let $SSH_ASKPASS = simplify($VIM . '/../../MacOS') . '/macvim-askpass' | |
set noimdisable | |
set imdisableactivate | |
if has('gui_macvim') | |
set guioptions-=T | |
set showtabline=0 | |
set imdisable " IME OFF | |
set guioptions-=T " ツールバー非表示 |