Se questo funziona:funzione Haskell composizione domanda
Prelude Data.Char> map toUpper ("sdfsd" ++ "dfgfdg")
"SDFSDDFGFDG"
Allora perché questo non lo fa?
Prelude Data.Char> map toUpper . (++) "sdfsd" "dfgfdg"
<interactive>:1:14:
Couldn't match expected type `a -> [Char]'
against inferred type `[Char]'
In the second argument of `(.)', namely `(++) "sdfsd" "dfgfdg"'
In the expression: map toUpper . (++) "sdfsd" "dfgfdg"
In the definition of `it': it = map toUpper . (++) "sdfsd" "dfgfdg"
Precisione dell'operatore. L'applicazione della funzione "lega" molto strettamente; (.) si lega molto debolmente. – jrockway
'(.)' Si lega molto strettamente (precedenza = 9), ma l'applicazione della funzione si lega ancora più stretta (precedenza = 10). Basta inserire '$' tra le due stringhe per risolverlo. '$' ha una precedenza molto bassa, ** 0 **. –