GHC.Base
的来源在开头有说明部分说明
The overall structure of the GHC Prelude is a bit tricky...
So the rough structure is as follows, in (linearised) dependency order
GHC.Prim Has no implementation. It defines built-in things, and
by importing it you bring them into scope.
The source file is GHC.Prim.hi-boot, which is just
copied to make GHC.Prim.hi
GHC.Base Classes: Eq, Ord, Functor, Monad
Types: list, (), Int, Bool, Ordering, Char, String
但是当Ordering
在源文件中定义时,Ord
不是。 Prelude doc页面没有Ord
的源链接。实际定义在哪里?
Ord
(和Eq
)在GHC.Classes
模块(由GHC.Base
导入)中定义自ghc-prim包(它是基础的依赖)。