स्थिति के आधार पर, हास्केल में आंशिक अनुप्रयोगों का सही उत्तर मिलता है।ऑपरेटर अनुभागों के लिए `-` (minus) क्यों काम नहीं करता है?
Prelude> (/2) 10
5.0
Prelude> (2/) 10
0.2
Prelude> (+3) 10
13
Prelude> (3+) 10
13
हालांकि, के लिए - ऑपरेटर, मैं एक त्रुटि (-3)
साथ मिला हास्केल (लगता है) के रूप में एक मूल्य -3
आंशिक नहीं आवेदन के रूप में यह व्याख्या करता है।
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
इस उदाहरण में 7
प्राप्त करने के लिए इस समस्या को हल करने के लिए कैसे करें?