Entries from 2010-06-01 to 1 month

Simple Command Line Interface for Ditz - afo released

afo

afo is a yet another command line interface for ditz (http://ditz.rubyforge.org/). afo aims to give almost information of an issue by command line parameters (no interaction). Dependencies The Glorious Glasgow Haskell Compilation System, v…

文字列のSHA1をとる

こうかなあ。 import Codec.Binary.UTF8.String (encode) import Data.ByteString.Lazy (pack) import Data.Digest.Pure.SHA (showDigest, sha1) main = do putStr $ showDigest $ sha1 $ pack $ encode "寿限無寿限無五劫の擦り切れ海砂利水魚の水行末雲来…

ファイルのパスを操作する関数

System.FilePathモジュールにあります (http://hackage.haskell.org/packages/archive/filepath/1.1.0.2/doc/html/System-FilePath.html).

printf

Text.Printfモジュールにあります (http://cvs.haskell.org/Hugs/pages/libraries/base/Text-Printf.html).

リンクエラー

問題 GHC 6.12.2を使って、Text.Regex.Posixモジュールをimportしているコードをコンパイルしようとすると、 ghc -o sourcegrep Main.hs compilation IS NOT required Main.o: In function `s1z1_info': (.text+0x28f1): undefined reference to `__stginit_…

論理否定

not演算子を使います。 $ ghci GHCi, version 6.12.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading …

パスの中のファイル名を得る

System.FilePathモジュールのtakeFileNameが使えます。 $ ghci GHCi, version 6.12.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base …

論理積と論理和

&&演算子と||演算子を使います。 $ ghci GHCi, version 6.12.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done.…

接頭辞かどうか判定する

Data.ListモジュールのisPrefixOfを使います。 $ ghci GHCi, version 6.12.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... link…

Yog 0.0.6リリース

Yog

Yog 0.0.6をリリースしました。Yogは、PythonとRubyの真ん中を目指した軽量スクリプト言語です。 主な変更点 libffi (http://sourceware.org/libffi/) により、YogからCのコードを呼び出せるようになりました。 特徴 PythonとRubyに似た構文 オブジェクト指…