recursion - Recursive functions with multiple arguments Haskell -


A very simple question: I want to apply multiples of 2 integers in Haskell. I do not compile what I wrote:

  mult :: int -> Int - & gt; The problem is the last statement I tried to write:   

Pre> mult xy = x + (mult x-1 y)

and

  mult xy = x + (multiplexed by x- 1, y))   

The error I get is:

  could not match the expected actual type `int -> Type 'Int' in the IT returns' call type 'multi'   

I do not know that the compiler says that mult come back to a Goes - & gt; IT when it explicitly returns Int .

You have to put x-1 in parentheses! Like

  mult xy = x + (mult (x-1) y)   

By the way, it does not count x and multiply Y: ) Try some examples ... this is just a little mistake.

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 -