Import a function in haskell -
I have written a function in which I say which number is weird and then in another function, I want to say this What is strange from the given list is my question:
How can I include a data file for the first function, e.g. In other data files, odd.hs, e.g. oddNbrs.hs. To use the first function in the second function?
For example, "include" me in C as you know there is nothing like "included" in the shell, too? Or?
EDIT: Both files are in the same directory. Is it enough, when I write the first function of the name in another function, or should I do a different job?
I think the keyword you are searching for is File: file: file: more beautiful in a module File: file: module
Odd.hs
module where OD is :: int -> Bool isOdd x = x`Rim`2 ==
Even HS
module where Also the import is weird isEven :: int - & gt; Bool isEven = isOdd
numbers hs
module numbers where import weird import even nigens :: [Int
edit
Predicates.hs < / code>
Module predicts that there is ... isOdd
Main.hs
module main where import forecasts (isEven) number = [1..100] main :: IO () main = mapM_ print $ filter is same number
Comments
Post a Comment