在GHC中,有没有办法打印模块的出口?

时间:2010-07-14 07:18:25

标签: haskell

例如,如果我想查看来自Test.QuickCheck的输出,是否有一个命令我可以向GHCI发出这样的命令?

1 个答案:

答案 0 :(得分:12)

是的,有。键入:browse Test.QuickCheck(或您想要的任何模块)将打印所有导出:

Prelude> :browse Test.QuickCheck
(.&.) ::
  (Testable prop1, Testable prop2) => prop1 -> prop2 -> Property
(==>) :: (Testable prop) => Bool -> prop -> Property
(><) :: (Gen a -> Gen a) -> (Gen a -> Gen a) -> Gen a -> Gen a
class Arbitrary a where
  arbitrary :: Gen a
  shrink :: a -> [a]

... <snip> ...

vectorOf :: Int -> Gen a -> Gen [a]
whenFail :: (Testable prop) => IO () -> prop -> Property
whenFail' :: (Testable prop) => IO () -> prop -> Property
within :: (Testable prop) => Int -> prop -> Property

有关GHCi命令的完整列表,请查看the documentation