Multiply two lists element by element in Haskell -


How can I increase the two lists elements in Haskell two times? Actually if I have [1,2,3] and [2,3,4] to get me [2,612].

  zipWith (*) [1,2,3] [2,3,4]  

There is zipWith as a useful way of finding such a function, you can enter the type of function you are looking for, and this Will try to find matching tasks in standard libraries.

In this case you are looking for a function to combine two lists using int s using a combing function (*) int s is sent to a list, so this will be your query:. If you change the sequence of logic then Hogal will get the right funcation too.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -