improving insertion of type for forall.

This commit is contained in:
Kazu Yamamoto 2010-11-10 17:03:56 +09:00
parent 6bac8141db
commit 0fd39e9b56
2 changed files with 4 additions and 3 deletions

View File

@ -91,7 +91,8 @@ style :: PprStyle
style = mkUserStyle neverQualify AllTheWay
showSDoc :: SDoc -> String
showSDoc d = map toNull . Pretty.showDocWith ZigZagMode $ d style
--showSDoc d = map toNull . Pretty.showDocWith ZigZagMode $ d style
showSDoc d = map toNull . Pretty.showDocWith PageMode $ d style
where
toNull '\n' = '\0'
toNull x = x

View File

@ -79,10 +79,10 @@
(dolist (data (ghc-flymake-err-list))
(save-excursion
(cond
((string-match "Inferred type: \\([^:]+ :: \\)\\(forall [^.]+\\. \\)?\\([^\0]*\\)" data)
((string-match "Inferred type: \\([^:]+ :: \\)\\(forall [^.]+\\.\\( \\|\0 +\\)\\)?\\([^\0]*\\)" data)
(beginning-of-line)
(insert (match-string 1 data)
(replace-regexp-in-string "\\[Char\\]" "String" (match-string 3 data))
(replace-regexp-in-string "\\[Char\\]" "String" (match-string 4 data))
"\n"))
((string-match "lacks an accompanying binding" data)
(beginning-of-line)