logo

Crowdly

Calling functions Calling functions is the bread and butter of a programmer's...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Calling functions

Calling functions is the bread and butter of a programmer's life. Functional programmers prefer to say that they are applying a function on some argument(s). It is the exact same concept.

Haskell's syntax for calling (applying) functions differs from what you are used to in other languages, however. There are no parentheses. The name of the function and all the arguments are simply separated by spaces.

Here is an example, in which we call the function not on the argument True:

ghci> not True

False

We can also check the type of the function not:

ghci> :t not

not :: Bool -> Bool

It takes in a Bool and produces a Bool.

Write the call to the function max to determine whether 42 or 100 is the bigger number:

More questions like this

Want instant access to all verified answers on www.icorsi.ch?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!