1. revDiv, which takes two numbers, x and y, and does a division in reverse,
i.e. y/x
2. revDiv', which is the same as revDiv except using integer division.
3. evens, which takes an integer and returns the list of all equal or lesser
positive even numbers.
If this is really the entire problem it is too trivial to charge money for. Here is the solution:
revDiv :: Fractional a => a -> a -> a
revDiv x y = y / x
revDivInt :: Integral a => a -> a -> a
revDivInt x y = y `div` x
evens :: Integral a => a -> [a]
evens n = [2*x | x <- [1.. n `div` 2] ]
$10 CAD en 1 día
5,0 (13 comentarios)
3,6
3,6
4 freelancers están ofertando un promedio de $25 CAD por este trabajo
Hello! I can do what you ask in a while. I have a good understanding of Haskell since it is one of the languages we use in college (I am a computer science student).
Hi. I can help you with this project. I'm happy to do with and I'll provide well structured code and comments for you to follow. The second example I can do with a few strategies, using list comprehension, recursion, etc. Let me know if you'd like me to help