In base alla posizione, le applicazioni parziali in Haskell ottengono la risposta corretta.Perché `-` (meno) funziona per le sezioni operatore?
Prelude> (/2) 10
5.0
Prelude> (2/) 10
0.2
Prelude> (+3) 10
13
Prelude> (3+) 10
13
Tuttavia, per - operatore, ho ottenuto un errore con (-3)
come Haskell (sembra) lo interpreta come un valore -3
dell'applicazione non parziale.
Prelude> (-3) 10
<interactive>:4:1:
Could not deduce (Num (a0 -> t))
arising from the ambiguity check for ‘it’
from the context (Num (a -> t), Num a)
bound by the inferred type for ‘it’: (Num (a -> t), Num a) => t
at <interactive>:4:1-7
The type variable ‘a0’ is ambiguous
When checking that ‘it’
has the inferred type ‘forall a t. (Num (a -> t), Num a) => t’
Probable cause: the inferred type is ambiguous
come risolvere questo problema per ottenere 7
in questo esempio?