From bca774826414557dcf238b72674f245059f76f4c Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Wed, 20 Jan 2016 03:11:50 +0300 Subject: [PATCH] [Type-constraints] Do not duplicate constraints --- Language/Haskell/GhcMod/SrcUtils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/Language/Haskell/GhcMod/SrcUtils.hs index 833624b..06cd873 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/Language/Haskell/GhcMod/SrcUtils.hs @@ -24,6 +24,7 @@ import Outputable (PprStyle) import TcHsSyn (hsPatType) import Prelude import Control.Monad +import Data.List (nub) import Control.Arrow import qualified Data.Map as M @@ -72,7 +73,7 @@ collectSpansTypes withConstraints tcs lc = | otherwise = (maybeToList <$> getType' x, s) constrainedType pids s spn genTyp = let - ctys = mapMaybe build pids + ctys = mapMaybe build (nub pids) build x | Just cti <- x `M.lookup` s = let (preds', ctt) = getPreds cti