Haskell - importing functions from prelude
I have kind of a newbie question. I want to use some func开发者_如何学JAVAtions from prelude, but I'm getting same error all the time.
For example:
Undefined variable "diff"
Some other functions are working, some not. I guess I have to import something, Google didn't help me... I'm using WinHugs.
Here are two sites you should bookmark, because they'll help you find functions you need -- and find out what you need to import.
http://haskell.org/hoogle/ http://holumbus.fh-wedel.de/hayoo/hayoo.html
Searching both those sites, I don't see anything that looks like the function you want. Some possibilities that occur to me are:
You're learning from a book that has examples of things you'd type at the Linux command line. "diff" is a common Linux command for comparing two files. I believe the windows equivalent is comp.
You're using some sample code that you got somewhere, but you didn't import everything you needed. If you can find the file that contains the "diff" function, import that.
You've written a function called "diff", and put it in another file. In the file where you want to use "diff", you need to import the module that contains it.
Prelude is typically imported implicitly. Are you sure that is really your problem? Undefined variable "diff"
is a bit vague, since I don't know of a diff
function imported with Prelude. Can you elaborate?
精彩评论