I am currently reading about the identity Monad and one piece defines fmap as this:
fmap :: (a -> b) -> (W a -> W b)
fmap f (W x) = W (f x)
The text says the goal is creating a function which changes an existing function for the types of a and b to another function which applies the original function to the types W a and W b.
From this point of view there are two functions involved and the type signature also looks like this: Its parameter is one function and it delivers a function.
What puzzled me at first is that the actual type of fmap as ghci tells is:
fmap :: (a -> b) -> W a -> W b
Thinking about that reveals that the function fmap gets a function and a parameter of type W a and then applies the function on the a in the W a and returns the result as W b. Which happens to be the description of what the code for fmap does.
I am pretty sure that it does not make any difference in what the function does if one omits the parenthesis in the type definition.
Am I right that this is similar to as if I would say:
addab
is a function which creates a function that can add a value to its parameter
And give this example code:
addab :: Int -> (Int -> Int)
addab x y = x + y
add1 :: Int -> Int
add1 = addab 1
Basically just indicating that the function is made to be used without giving all the parameters to it?
Or is there any deeper meaning to it which I did not consider?