McDuffin
McDuffin

Reputation: 568

Haskell prelude generic functions out of scope

When trying to use what are called "generic" list functions in the Haskell prelude, I get an out of scope error - for instance when trying to use genericDrop, genericTake and so on.

Perhaps I need to import a module or something (but I can see no mention of that in the prelude docs or by googling)

Upvotes: 3

Views: 337

Answers (1)

Matt
Matt

Reputation: 4049

Yes, I believe you need:

import Data.List

In general, when I need to figure out which module to import, I find that hoogle is very useful. You can search for a particular function, and it will take you to hackage, which then will have the module the function belongs to at the top of the page. For example, here is the result of searching for genericDrop and the associated hackage page.

Upvotes: 5

Related Questions