什么是最接近的等价物:在ghc源文件中输入ghci?

v21*_*217 3 debugging haskell types

如果我想在Haskell源文件中比较类型或只打印类型信息,我有哪些选项?

chi*_*chi 7

打字洞!

foo x =  length [x] + _
Run Code Online (Sandbox Code Playgroud)

使用GHC进行编译或加载到GHCi中将给出:

Found hole ‘_’ with type: Int
Relevant bindings include
  x :: a
  foo :: a -> Int
Run Code Online (Sandbox Code Playgroud)