मैं ghc-modटाइप / सिंटैक्स जाँच आदि करने के लिए vim प्लगइन का उपयोग करने की कोशिश कर रहा हूँ । हालाँकि, मैंने पाया कि ghc-modहमेशा त्रुटि संदेशों में पूर्ण पथों का उपयोग करता है, उदाहरण के लिए:
test.hs|71 col 13 error| Couldn't match type ‘Data.Text.Internal.Text’
|| with ‘[GHC.Types.Char]’
|| Expected type: containers-0.5.6.2:Data.Map.Base.Map
|| [GHC.Types.Char]
|| ([(integer-gmp-1.0.0.0:GHC.Integer.Type.Integer,
|| integer-gmp-1.0.0.0:GHC.Integer.Type.Integer)],
|| containers-0.5.6.2:Data.Set.Base.Set
|| integer-gmp-1.0.0.0:GHC.Integer.Type.Integer)
|| Actual type: containers-0.5.6.2:Data.Map.Base.Map
|| Data.Text.Internal.Text
|| ([(integer-gmp-1.0.0.0:GHC.Integer.Type.Integer,
|| integer-gmp-1.0.0.0:GHC.Integer.Type.Integer)],
|| containers-0.5.6.2:Data.Set.Base.Set
|| integer-gmp-1.0.0.0:GHC.Integer.Type.Integer)
|| In the second argument of ‘containers-0.5.6.2:Data.Map.Base.map’, namely
|| ‘zippedMap’
|| In the second argument of ‘(GHC.Base.$)’, namely
|| ‘containers-0.5.6.2:Data.Map.Base.map
...
जो स्क्रीन को बंद कर देता है और मेरे लिए यह पता लगाना बहुत मुश्किल है कि कहां गलत हुआ। तुलना के रूप में, यह उसी फ़ाइल का उपयोग करने के लिए त्रुटि संदेश है ghci:
test.hs:71:13:
Couldn't match type ‘T.Text’ with ‘[Char]’
Expected type: M.Map [Char] ([(Integer, Integer)], S.Set Integer)
Actual type: M.Map T.Text ([(Integer, Integer)], S.Set Integer)
In the second argument of ‘M.map’, namely ‘zippedMap’
In the second argument of ‘($)’, namely
‘M.map
...
जो बहुत साफ है। क्या ghc-modप्रकारों के लिए छोटे नामों का उपयोग करने का एक तरीका है ?
क्या आपके पास एक स्व-निहित उदाहरण (आयात शामिल है) जो उपरोक्त की तरह आउटपुट उत्पन्न करता है? मुझे लगता है कि मेरे पास एक विचार है कि समस्या क्या हो सकती है, लेकिन केवल आउटपुट से यह बताना थोड़ा कठिन है ...
—
एलेक
ghcऔरghc-modआप उपयोग कर रहे हैं?