简体   繁体   中英

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)

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM