Haskell离线文档? [英] Haskell offline documentation?

查看:105
本文介绍了Haskell离线文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获得Haskell核心库(甚至更多)的脱机文档的可能性(如果有)?

有时候,我将笔记本电脑带到没有wifi的咖啡店,并且很高兴有解决方案

Hoogle可以脱机使用,可以从Cabal安装: http://hackage.haskell.org/package/hoogle

用法说明位于 http://www.haskell.org/haskellwiki/Hoogle#Command_Line_Search_Flags ./p>

用法:

$ hoogle --help
Hoogle v4.2.8, (C) Neil Mitchell 2004-2011
http://haskell.org/hoogle

hoogle [COMMAND] ... [OPTIONS]

Commands:
  [search]  Perform a search
  data      Generate Hoogle databases
  server    Start a Hoogle server
  combine   Combine multiple databases into one
  convert   Convert an input file to a database
  test      Run tests
  dump      Dump sections of a database to stdout
  rank      Generate ranking information
  log       Analyse log files

Common flags:
  -? --help     Display help message
  -V --version  Print version information
  -v --verbose  Loud verbosity
  -q --quiet    Quiet verbosity

使用hoogle data创建默认数据库(有关更多信息,请参见 http://neilmitchell.blogspot .com/2008/08/hoogle-database-generation.html ).

在本地安装Hoogle之后的使用情况会话:

$ hoogle
No query entered
Try --help for command line options
$ hoogle data
(downloads databases...takes a few minutes)

我在这里遇到了一个错误...显然与Cabal的版本有关,所以我对此进行了更新(http://hackage.haskell.org/trac/hackage/ticket/811).这样做没有帮助,所以我运行了hoogle data all,我取消了它,因为它花费了很长时间(它似乎遍历了Hackage上的每个软件包).它仍然不允许像hoogle map这样的查询,但是允许hoogle map +base(即,将搜索限制为base程序包),希望它对您有用!

这似乎可以解决问题(对我来说):

$cd .cabal/share/hoogle-4.2.8/databases
$hoogle combine base.hoo
$hoogle foldl\'
Data.List foldl' :: (a -> b -> a) -> a -> [b] -> a
Data.Foldable foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a

What are the possibilities, if any, for getting offline docs for Haskell core libraries (and maybe more)?

Sometimes I take my laptop to the coffee-shop where there is no wifi, and it would be nice having something like Hoogle but for offline use.

解决方案

Hoogle is available offline, installable from Cabal: http://hackage.haskell.org/package/hoogle

Usage instructions are at http://www.haskell.org/haskellwiki/Hoogle#Command_Line_Search_Flags.

Usage:

$ hoogle --help
Hoogle v4.2.8, (C) Neil Mitchell 2004-2011
http://haskell.org/hoogle

hoogle [COMMAND] ... [OPTIONS]

Commands:
  [search]  Perform a search
  data      Generate Hoogle databases
  server    Start a Hoogle server
  combine   Combine multiple databases into one
  convert   Convert an input file to a database
  test      Run tests
  dump      Dump sections of a database to stdout
  rank      Generate ranking information
  log       Analyse log files

Common flags:
  -? --help     Display help message
  -V --version  Print version information
  -v --verbose  Loud verbosity
  -q --quiet    Quiet verbosity

Create a default database with hoogle data (more info at http://neilmitchell.blogspot.com/2008/08/hoogle-database-generation.html).

EDIT: A session of usage after installing Hoogle locally:

$ hoogle
No query entered
Try --help for command line options
$ hoogle data
(downloads databases...takes a few minutes)

I ran into an error here...apparently it is related to the version of Cabal, so I updated that (http://hackage.haskell.org/trac/hackage/ticket/811). That didn't help, so I ran hoogle data all, which I canceled since it was taking so long (it seems to go through every package on Hackage). It still wouldn't allow a query like hoogle map but did allow hoogle map +base (i.e. restrict the search to the base package) Hopefully it works for you!

EDIT2: This seems to fix the problem (for me):

$cd .cabal/share/hoogle-4.2.8/databases
$hoogle combine base.hoo
$hoogle foldl\'
Data.List foldl' :: (a -> b -> a) -> a -> [b] -> a
Data.Foldable foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a

这篇关于Haskell离线文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆