2007-12-18から1日間の記事一覧

'balloneval'を使ってみる/式の型を推論させる

ftplugin/haskell.vim に setlocal balloonexpr=system('echo\ :t\ '.substitute(v:beval_text,'&','^^^&','g').'\ \|\ ghci\ -v0\ '.expand('%'))[0:-2] setlocal ballooneval [0:-2] で末尾の改行文字を落とす。"&" を "^^^&" にエスケープするのは Window…

型とかちゃんとみるprintf

そんなんできるのか、と思ってたけど分かってしまえば簡単…なのか? import Numeric (showHex) type Format a b = (String -> a) -> String -> b format :: Format String a -> a format f = f id "" q :: String -> Format a a q x = q' where q' k s = k (…