gpt4 book ai didi

debugging - :type in ghci in a ghc source file? 最接近的等价物是多少

转载 作者:行者123 更新时间:2023-12-02 22:46:32 25 4
gpt4 key购买 nike

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

最佳答案

Typed holes!

foo x =  length [x] + _

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

Found hole ‘_’ with type: Int
Relevant bindings include
x :: a
foo :: a -> Int

关于debugging - :type in ghci in a ghc source file? 最接近的等价物是多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30138726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com