I am a beginner in Haskell, and I want to understand Reader Monad. I know how to use this monad. But I want to see the implementation of monad (particularly code of function "return"). How can I see this code?
Answered in the comments by pdexter :
The definition is here but I would recommend reading the simplified version here .
I have downloaded the ghc source from here It contains the definition of all the base functions Then I open the folder in Sublime text editor which will index the source files. Then you can type F12
on a function or Ctrl+Shift+F
to find the implementation. You can jump back with Alt+-
.
I actually downloaded many other Haskell libraries for easy reference.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.