Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
882e439b
Commit
882e439b
authored
Aug 03, 2011
by
Simon Peyton Jones
Browse files
Simplify TcSMonad.matchFam's interface
parent
0d74feea
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcInteract.lhs
View file @
882e439b
...
...
@@ -1827,10 +1827,10 @@ doTopReact _inerts (CFunEqCan { cc_flavor = fl })
doTopReact _inerts workItem@(CFunEqCan { cc_id = cv, cc_flavor = fl
, cc_fun = tc, cc_tyargs = args, cc_rhs = xi })
= ASSERT (isSynFamilyTyCon tc) -- No associated data families have reached that far
do { match_res <- matchFam tc args -- See Note [MATCHING-SYNONYMS]
do { match_res <- matchFam tc args
-- See Note [MATCHING-SYNONYMS]
; case match_res of
MatchInstNo
-> return NoTopInt
MatchInstSingle
(rep_tc, rep_tys)
Nothing
-> return NoTopInt
Just
(rep_tc, rep_tys)
-> do { let Just coe_tc = tyConFamilyCoercion_maybe rep_tc
Just rhs_ty = tcView (mkTyConApp rep_tc rep_tys)
-- Eagerly expand away the type synonym on the
...
...
@@ -1864,8 +1864,6 @@ doTopReact _inerts workItem@(CFunEqCan { cc_id = cv, cc_flavor = fl
, tir_new_inert = Stop }
}
}
_
-> panicTcS $ text "TcSMonad.matchFam returned multiple instances!"
}
...
...
compiler/typecheck/TcSMonad.lhs
View file @
882e439b
...
...
@@ -941,15 +941,6 @@ matchClass clas tys
}
}
matchFam :: TyCon
-> [Type]
-> TcS (MatchInstResult (TyCon, [Type]))
matchFam tycon args
= do { mb <- wrapTcS $ TcM.tcLookupFamInst tycon args
; case mb of
Nothing -> return MatchInstNo
Just res -> return $ MatchInstSingle res
-- DV: We never return MatchInstMany, since tcLookupFamInst never returns
-- multiple matches. Check.
}
matchFam :: TyCon -> [Type] -> TcS (Maybe (TyCon, [Type]))
matchFam tycon args = wrapTcS $ TcM.tcLookupFamInst tycon args
\end{code}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment