module MatchCon ( matchConFamily ) where
--- XXX This define is a bit of a hack, and should be done more nicely
-#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import {-# SOURCE #-} Match ( match )
import TcType
import Type
import CoreSyn
+import MkCore
import DsMonad
import DsUtils
import Util ( takeList )
= do { (wraps, eqns') <- mapAndUnzipM shift (eqn1:eqns)
; arg_vars <- selectMatchVars (take (dataConSourceArity con1)
(eqn_pats (head eqns')))
- -- Use the new arugment patterns as a source of
+ -- Use the new argument patterns as a source of
-- suggestions for the new variables
; match_result <- match (arg_vars ++ vars) ty eqns'
; return (con1, tvs1 ++ dicts1 ++ arg_vars,
= do { prs <- dsLHsBinds bind
; return (wrapBinds (tvs `zip` tvs1)
. wrapBinds (ds `zip` dicts1)
- . mkDsLet (Rec prs),
+ . mkCoreLet (Rec prs),
eqn { eqn_pats = conArgPats con1 arg_tys args ++ pats }) }
conArgPats :: DataCon