Search code examples
haskelloperation

Source code of Haskell's built-in operations


This question is related to this overflow post. The chosen answer there tells us that we can look up the source codes for built in functions on hackage site, for example curry.

What I'd like to ask for, however, is the location of the source codes of built in operations, including (+), (-), (*), (/=), ([...]), ([..|...]). The last two being "list constructor" and "list comprehensor" (I'm not sure if these are their standard name..).

The source codes of basic arithmetic operations like addition or multiplications are easier to find. However, for ([...]), ([..|...]) I simply have no clue where and how I can find them. Please point them out if you happen to know.


Solution

  • Here are the Haskell 98 report sections on lists, arithmetic sequences and list comprehensions. As for the actual implementation in the source code, I suggest downloading the repository and using grep to search around.

    Links