算譜の記 

2006/02/23 18:57:00

howl-0.1

Howl吉田さんが作成したHaskellの ライブラリ関数の参照ツールです.

ちょいと使ってみようとして howl-0.1 のビルドにてこづった.

手元の環境は

% ghc-pkg list                                                 ~/cahier
/usr/local/lib/ghc-6.4.2.20060221/package.conf:
    Cabal-1.1.3, GLUT-2.0, HGL-3.1, HUnit-1.1, (HaXml-1.15),
    OpenGL-2.0, QuickCheck-1.0, X11-1.1, base-1.0, (concurrent-1.0),
    (data-1.0), fgl-5.2, haskell-src-1.0, haskell98-1.0,
    (hssource-1.0), (lang-1.0), mtl-1.0, (net-1.0), network-1.0,
    parsec-1.0, (posix-1.0), readline-1.0, rts-1.0, stm-1.0,
    template-haskell-1.0, (text-1.0), unix-1.0, (util-1.0)
/home/nobsun/.ghc/i386-linux-6.4.2.20060221/package.conf:
    testffi-0.0

とちょっと怪しげ^^;

README.ja によれば

$ runhaskell Setup.lhs configure
$ runhaskell Setup.lhs build
$ runhaskell Setup.lhs install

でよいとな.

% runhaskell Setup.lhs configure
Setup.lhs: Warning: No license-file field.
Configuring Howl-0.1...
configure: Using install prefix: /usr/local
configure: Using compiler: /usr/local/bin/ghc
configure: Compiler flavor: GHC
configure: Compiler version: 6.4.2.20060221
configure: Using package tool: /usr/local/bin/ghc-pkg
configure: No haddock found
configure: Using happy: /usr/local/bin/happy
configure: Using alex: /usr/local/bin/alex
configure: Using hsc2hs: /usr/local/bin/hsc2hs
configure: No c2hs found
configure: No cpphs found
configure: No greencard found
configure: Dependency base-any: using base-1.0
configure: Dependency HaXml-any: using HaXml-1.15

Warning が出ているけどまぁいいんじないかな...

% runhaskell Setup.lhs build
Preprocessing executables for Howl-0.1...
Building Howl-0.1...
Chasing modules from: src/Main.hs
Could not find module `Network.URI':
  use -v to see a list of the files searched for
  (imported from src/HowlUtil.hs)

あれだめじゃん.なんで?? network パッケージを指定してないのかな??

howl.cabal の Build-Depensフィールドに network を追加

% runhaskell Setup.lhs configure; runhaskell Setup.lhs build
Setup.lhs: Warning: No license-file field.
Configuring Howl-0.1...
...途中略...
configure: Dependency base-any: using base-1.0
configure: Dependency HaXml-any: using HaXml-1.15
configure: Dependency network-any: using network-1.0
Preprocessing executables for Howl-0.1...
Building Howl-0.1...
Chasing modules from: src/Main.hs
Could not find module `Distribution.Compat.FilePath':
  use -v to see a list of the files searched for
  (imported from src/HowlUtil.hs)

おっと今度はなんだ?これは Cabal パッケージかな.

howl.cabal の Build-Depensフィールドに Cabal を追加

% runhaskell Setup.lhs configure; runhaskell Setup.lhs build
Setup.lhs: Warning: No license-file field.
Configuring Howl-0.1...
...途中略...
configure: Dependency base-any: using base-1.0
configure: Dependency HaXml-any: using HaXml-1.15
configure: Dependency network-any: using network-1.0
configure: Dependency Cabal-any: using Cabal-1.1.3
Preprocessing executables for Howl-0.1...
Building Howl-0.1...
Chasing modules from: src/Main.hs
Could not find module `Text.ParserCombinators.Parsec':
  it is a member of package parsec-1.0, which is hidden
  (imported from src/IndexDB.hs)

あれまだか?

howl.cabal の Build-Depensフィールドに parsec を追加

% runhaskell Setup.lhs configure; runhaskell Setup.lhs build
Setup.lhs: Warning: No license-file field.
Configuring Howl-0.1...
...途中略...
configure: Dependency base-any: using base-1.0
configure: Dependency HaXml-any: using HaXml-1.15
configure: Dependency network-any: using network-1.0
configure: Dependency Cabal-any: using Cabal-1.1.3
configure: Dependency parsec-any: using parsec-1.0
Preprocessing executables for Howl-0.1...
Building Howl-0.1...
Chasing modules from: src/Main.hs
Could not find module `Monad':
  it is a member of package haskell98-1.0, which is hidden
  (imported from src/HaXml/Parse.hs)

おっと.

howl.cabal の Build-Depensフィールドに haskell98 を追加

% runhaskell Setup.lhs configure; runhaskell Setup.lhs build
Setup.lhs: Warning: No license-file field.
Configuring Howl-0.1...
...途中略...
Compiling Main             ( src/Main.hs, dist/build/howl/howl-tmp/Main.o )

src/Main.hs:165:7:
    Warning: Pattern match(es) are overlapped
             In a case alternative: (_, _, errs) -> ...

Warning はでているものの問題なし(かな).

% sudo runhaskell Setup.lhs install
Installing: /usr/local/lib/Howl-0.1/ghc-6.4.2.20060221 & /usr/local/bin Howl-0.1...

おぅ.できたかな.

とりあえず,Haskell Hierarchical Libraries からデータベースをつくって おこう.

% howl --import-web-haddock  http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
importing:  http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
...

あとはサイトに書いてあるとおり.

% howl --show-type map
Data.IntMap.map ::  (a -> b) -> IntMap a -> IntMap b
Data.IntSet.map ::  (Int -> Int) -> IntSet -> IntSet
Data.List.map ::  (a -> b) -> [a] -> [b]
Data.Map.map ::  (a -> b) -> Map k a -> Map k b
Data.Set.map ::  (Ord a, Ord b) => (a -> b) -> Set a -> Set b
Prelude.map ::  (a -> b) -> [a] -> [b]
% howl --show-type Prelude.map
Prelude.map ::  (a -> b) -> [a] -> [b]
% howl --show-doc Prelude.map
Prelude.map :: (a -> b) -> [a] -> [b]

map f xs is the list obtained by applying f to each element of xs, i.e., map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] map f [x1, x2, ...] == [f x1, f x2, ...]

すばらしい.

こうなると,Haskell Hierarchical Libraries はもっと用例や解説を書いて くれぇーーーっ,と思うねぇ.(おまいが掻け > 儂)


About Me
nobsun

1月2006年2月3月
1234
567891011
12131415161718
19202122232425
262728

Recent Articles
howl-0.1

Archives
2006-02

このサイトについて|ヘルプ|Q&A|個人情報保護|プライバシーポリシー|利用規約|コメント・トラックバック規約|削除規程|広告掲載
Copyright (c) 2005-2007 Time Intermedia Corporation