[Type-constraints] Do not duplicate constraints
This commit is contained in:
parent
8449d36eca
commit
bca7748264
@ -24,6 +24,7 @@ import Outputable (PprStyle)
|
|||||||
import TcHsSyn (hsPatType)
|
import TcHsSyn (hsPatType)
|
||||||
import Prelude
|
import Prelude
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
import Data.List (nub)
|
||||||
import Control.Arrow
|
import Control.Arrow
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ collectSpansTypes withConstraints tcs lc =
|
|||||||
| otherwise = (maybeToList <$> getType' x, s)
|
| otherwise = (maybeToList <$> getType' x, s)
|
||||||
constrainedType pids s spn genTyp =
|
constrainedType pids s spn genTyp =
|
||||||
let
|
let
|
||||||
ctys = mapMaybe build pids
|
ctys = mapMaybe build (nub pids)
|
||||||
build x | Just cti <- x `M.lookup` s
|
build x | Just cti <- x `M.lookup` s
|
||||||
= let
|
= let
|
||||||
(preds', ctt) = getPreds cti
|
(preds', ctt) = getPreds cti
|
||||||
|
Loading…
Reference in New Issue
Block a user