Tôi đang cố gắng sử dụng ghc-modplugin vim để kiểm tra kiểu / cú pháp, v.v. Tuy nhiên, tôi thấy rằng ghc-modluôn sử dụng đầy đủ các đường dẫn của các loại trong thông báo lỗi, ví dụ:
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
...
Điều này làm mờ màn hình và rất khó để tôi tìm ra lỗi sai. Để so sánh, đây là thông báo lỗi cho cùng một tệp bằng cách sử dụng 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
...
cái nào sạch hơn nhiều Có cách nào để ghc-modsử dụng tên ngắn cho các loại?
Bạn có một ví dụ khép kín (bao gồm nhập khẩu) tạo đầu ra như trên không? Tôi nghĩ rằng tôi có một ý tưởng về vấn đề có thể là gì, nhưng hơi khó để chỉ nói từ đầu ra ...
—
Alec
ghcvàghc-modbạn đang sử dụng?