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 module

File: Odd.hs

  module where OD is :: int -> Bool isOdd x = x`Rim`2 ==   

file: Even HS

  module where Also the import is weird isEven :: int - & gt; Bool isEven = isOdd   

file: numbers hs

  module numbers where import weird import even nigens :: [Int   

edit

more beautiful in a module

File: Predicates.hs < / code>

  Module predicts that there is ... isOdd   

file: Main.hs

  module main where import forecasts (isEven) number = [1..100] main :: IO () main = mapM_ print $ filter is same number    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -