Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read the implementation code/source code for inbuilt functions in Haskell?

Tags:

haskell

For instance if I would like to read the source code for the default curry function in Prelude, where do I refer? Is there a way to read it's implementation? I tried to search it in Hoogle, but it doesn't give the exact implementation, just the input and output types. I am using GHCI on stack to run haskell.-

Hoogle curry

like image 974
devssh Avatar asked Aug 02 '26 05:08

devssh


1 Answers

Like @Lee mentioned in the comments, there is a link for source for many of the functions on hackage. enter image description here

Following this will take you to the source code for curry:

-- | 'curry' converts an uncurried function to a curried function.
curry                   :: ((a, b) -> c) -> a -> b -> c
curry f x y             =  f (x, y)
like image 67
jkeuhlen Avatar answered Aug 04 '26 21:08

jkeuhlen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!