X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FMatch.lhs;h=529432021254f5fd8e221ddcd1c0e2344fb00c5e;hb=970d5b88b1554bbdd7e459dae41aab3668ae897a;hp=b40bb53fb7b199cb943b93b9b1cd410a208ef91e;hpb=e6d057711f4d6d6ff6342c39fa2b9e44d25447f1;p=ghc-hetmet.git diff --git a/compiler/deSugar/Match.lhs b/compiler/deSugar/Match.lhs index b40bb53..5294320 100644 --- a/compiler/deSugar/Match.lhs +++ b/compiler/deSugar/Match.lhs @@ -1,40 +1,39 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -\section[Main_match]{The @match@ function} + +The @match@ function \begin{code} module Match ( match, matchEquations, matchWrapper, matchSimply, matchSinglePat ) where #include "HsVersions.h" -import DynFlags ( DynFlag(..), dopt ) +import DynFlags import HsSyn -import TcHsSyn ( mkVanillaTuplePat, hsPatType ) -import Check ( check, ExhaustivePat ) +import TcHsSyn +import Check import CoreSyn -import Literal ( Literal ) -import CoreUtils ( bindNonRec, exprType ) +import Literal +import CoreUtils import DsMonad -import DsBinds ( dsLHsBinds, dsCoercion ) -import DsGRHSs ( dsGRHSs ) +import DsBinds +import DsGRHSs import DsUtils -import Id ( idName, idType, Id ) -import DataCon ( DataCon ) -import MatchCon ( matchConFamily ) -import MatchLit ( matchLiterals, matchNPlusKPats, matchNPats, - tidyLitPat, tidyNPat, hsLitKey, hsOverLitKey ) -import PrelInfo ( pAT_ERROR_ID ) -import TcType ( Type ) -import Type ( splitFunTysN, coreEqType ) -import TysWiredIn ( consDataCon, mkListTy, unitTy, - tupleCon, parrFakeCon, mkPArrTy ) -import BasicTypes ( Boxity(..) ) -import ListSetOps ( equivClasses, runs ) -import SrcLoc ( unLoc, Located(..) ) -import Maybes ( isJust ) -import Util ( lengthExceeds, notNull ) -import Name ( Name ) +import Id +import DataCon +import MatchCon +import MatchLit +import PrelInfo +import Type +import TysWiredIn +import BasicTypes +import ListSetOps +import SrcLoc +import Maybes +import Util +import Name import Outputable \end{code} @@ -610,7 +609,8 @@ JJQC 30-Nov-1997 \begin{code} matchWrapper ctxt (MatchGroup matches match_ty) - = do { eqns_info <- mapM mk_eqn_info matches + = ASSERT( notNull matches ) + do { eqns_info <- mapM mk_eqn_info matches ; new_vars <- selectMatchVars arg_pats ; result_expr <- matchEquations ctxt new_vars eqns_info rhs_ty ; return (new_vars, result_expr) }