gpt4 book ai didi

haskell - 如何阅读 Haskell 中内置函数的实现代码/源代码?

转载 作者:行者123 更新时间:2023-12-02 06:51:41 26 4
gpt4 key购买 nike

例如,如果我想阅读 Prelude 中默认 curry 函数的源代码,我应该引用哪里?有没有办法阅读它的实现?我试图在 Hoogle 中搜索它,但它没有给出确切的实现,只是输入和输出类型。我在堆栈上使用 GHCI 来运行 haskell。-

Hoogle curry

最佳答案

就像评论中提到的@Lee,有一个链接source对于hackage的许多功能。 enter image description here

接下来会带你到curry的源代码:

-- | 'curry' converts an uncurried function to a curried function.
curry :: ((a, b) -> c) -> a -> b -> c
curry f x y = f (x, y)

关于haskell - 如何阅读 Haskell 中内置函数的实现代码/源代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42394951/

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