Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1690734
  • 博文数量: 410
  • 博客积分: 9563
  • 博客等级: 中将
  • 技术积分: 4517
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-03 19:59
个人简介

文章分类

全部博文(410)

文章存档

2017年(6)

2016年(1)

2015年(3)

2014年(4)

2013年(32)

2012年(45)

2011年(179)

2010年(140)

分类: LINUX

2012-05-08 22:11:10

看好了,没拼错,是hoogle,主页
具体是什么不解释,知道的就知道
碰到问题(分析应该是10.04的ghc版本太低造成的)

点击(此处)折叠或打开

  1. [bl@bl-desktop:~/Downloads/torrent/hoogle-4.2.11]$ cabal install conduit
  2. Resolving dependencies...
  3. cabal: cannot configure conduit-0.4.1.1. It requires base >=4.3 && <5
  4. For the dependency on base >=4.3 && <5 there are these packages: base-4.3.0.0,
  5. base-4.3.1.0, base-4.4.0.0, base-4.4.1.0 and base-4.5.0.0. However none of
  6. them are available.
  7. base-4.3.0.0 was excluded because of the top level dependency base -any
  8. base-4.3.1.0 was excluded because of the top level dependency base -any
  9. base-4.4.0.0 was excluded because of the top level dependency base -any
  10. base-4.4.1.0 was excluded because of the top level dependency base -any
  11. base-4.5.0.0 was excluded because of the top level dependency base -any



Ran into the same problem. Solved it.

It was a clean haskell install. But it was a clean haskell install from the linux flavor's (in this case ubuntu) package manager which had older versions.

Had to remove the old packages & download the source & build & install it.

get the latest platform sources from:

get the ghc sources that are required for the platform.

an example for doing this:


看样子10.04安装hoogle需要手动编译安装ghc 7
刚好笔记本刚刚安装了12.04,试验成功
  1. sudo apt-get install ghc haskell-platform
  2. sudo apt-get install cabal-install
  3. cabal update
  4. cabal install hoogle
如果上面第4步报错的话,就可能需要源码安装hoogle

点击(此处)折叠或打开

  1. wget
  2. tar zxvf hoogle-4.2.11.tar.gz
  3. cd hoogle-4.2.11/
  4. cabal install
设置与ghci交互
  1. 在终端下如果找不到hoogle命令,需要把~/.cabal/bin加到搜索路径中。
    1. echo >> ~/.bashrc 'PATH=$PATH:$HOME/.cabal/bin'

  2. 执行下面的命令
    1. echo >> ~/.ghci ':def hoogle \x -> return $ ":!hoogle \"" ++ x ++ "\""'
    其他使用方式
扫盲:

 

Haskell Platform 是一个打包的haskell 开发环境,包含GHC以及很多第三方开发库,以及cabal 包管理器等。

 

Cabal 又是什么?

 

简单说就是 Ubuntu 的  apt-get, Perl 的 cpan , Python 的 easy_install , Ruby 的 gem 。 这么说明白了吧.

要安装一个第三方库,只需要:  cabal install lib-name 就可以了。 几乎就这么简单。

 

怎么安装 Haskell 的第三方库?

 

有一个   类似与 Perl 的cpan 的东西,这个列表包含了 Haskell 可用的第三方库。安装用同一的方式:  cabal install libname 就可以了。 大部分的库可以很方便的安装,不过一些第三方库会依赖一些特定系统的库,因此不是总能顺利安装。

 


阅读(1420) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~