Re: [Haskell-cafe] Newbie Q: GHCi: Where “List” module is imported from?

Dmitri O.Kondratiev dokondr at
Fri Feb 16 17:11:37 EST 2007

On 2/16/07, Jules Bean <jules at> wrote:
> Actually, lists are partly defined in the Prelude, with auxiliary
> functions in Data.List. In particular, <= for List is defined in the
> Prelude. Or rather, I should say, the Ord instance for lists is defined
> in the prelude (and only if the type inside the lists is itself an Ord
> instance). Look:
> Prelude> [1,2] <= [3,4]
> True

Where exactly "the Ord instance for lists is defined in the Prelude"?
It seems that Prelude treats "list" as a built-in type same as a "tuple"
type. Also Prelude does not know anything about Data.List type, right?
As I understand in Haskell to be an instance of a class type must be
declared as:

instance ClassName  TypeName

where  then declaration:

instance Ord []

can be found?
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Haskell-Cafe mailing list