2

由 cabal 安装软件包:

All the requested packages are already installed:
tagsoup-0.12.8

我尝试编译:

module TagSoupSample where
import Data.Text
import Text.HTML.TagSoup
import Text.StringLike

foo :: Text -> [Tag Text]
foo = parseTags

这导致:

tagsoup.hs:7:7:
No instance for (StringLike Text)
  arising from a use of `parseTags'
Possible fix: add an instance declaration for (StringLike Text)
In the expression: parseTags
In an equation for `foo': foo = parseTags

但是,http ://hackage.haskell.org/packages/archive/tagsoup/0.12.8/doc/html/Text-StringLike.html#t:StringLike说存在这样的实例。为什么我找不到除 StringLike String 之外的任何其他实例?

Prelude Data.Text> :info Text.StringLike.StringLike
class (Data.Typeable.Internal.Typeable a,
       Eq a) => Text.StringLike.StringLike a where
  Text.StringLike.empty :: a
  Text.StringLike.cons :: Char -> a -> a
  Text.StringLike.uncons :: a -> Maybe (Char, a)
  Text.StringLike.toString :: a -> String
  Text.StringLike.fromString :: String -> a
  Text.StringLike.fromChar :: Char -> a
  Text.StringLike.strConcat :: [a] -> a
  Text.StringLike.strNull :: a -> Bool
  Text.StringLike.append :: a -> a -> a
        -- Defined in `Text.StringLike'
instance Text.StringLike.StringLike String
  -- Defined in `Text.StringLike'

如何浏览已安装软件包的文档和来源?

4

1 回答 1

0

如何浏览已安装软件包的文档和来源?

如果您传递--documentationcabal install,或Documentation: True在您的.cabal/config文件中设置,cabal install将为您安装的每个包生成文档。您可能必须重新安装您感兴趣的软件包才能获取它们的文档。您将在~/.cabal/share/doc/index.html.

如果您希望文档还包含突出显示的源代码,则需要传递--haddock-hyperlink-sourcecabal(或者,更好的是,传递给配置文件中的那个选项)。

于 2013-09-14T10:18:45.147 回答