How library functions in Haskell are implemented

Here you go: http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/Data-List.html

More generally, if you look at the documentation page for Data.List you'll see "Source" links to the right of the type signatures, which will take you directly to the source for that function.

You can find the source for the rest of the standard libraries the same way and, in fact, for nearly everything on Hackage.


The documentation of the Data.List module is found here: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-List.html

And the source here: http://www.haskell.org/ghc/docs/latest/html/libraries/base/src/Data-List.html

In GHCI, you can do :browse Data.List to find more about this module. Note that the basic list definitions and operations are also found in base packages e.g. GHC.Base, GHC.List.