由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'
如何浏览我安装的软件包的文档和来源?
答案 0 :(得分:0)
如何浏览我安装的软件包的文档和来源?
如果您将--documentation
传递给cabal install
,或在Documentation: True
文件中设置.cabal/config
,cabal install
将为您安装的每个软件包生成文档。您可能必须重新安装您感兴趣的软件包才能获得它们的文档。您将在~/.cabal/share/doc/index.html
。
如果您希望文档还包含突出显示的源代码,则需要将--haddock-hyperlink-source
传递给cabal
(或者,更好的是,在配置文件中将该选项传递出去)。