2

Imagine this:

f = (*10) . (+1) 

It is a simple way to say to add 1 and then multiply by 10. Now check the following:

f = (* 10) . (-1) 

Here -1 is a number, not a function, I would like to know if there is a function available to avoid this

\x -> x - 1 

or this

flip (-) 1 

I know they are right, but I would like to not make it be like that.

1 Answer 1

5

Subtracting numbers can be accomplished via the subtract function

subtract 1 is equivalent to \x -> x - 1

So,

f = (* 10) . subtract 1

Sign up to request clarification or add additional context in comments.

3 Comments

I've found it on hoogle at the same time you answered! I think I am getting tired :P, this is the exactly right function.
Fantastic :) Mark it if you want
I will, I am just waiting the waiting time

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.