diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 1ff04b2548648c46d60a5b8d5f5da71e1d361654..73ae91329bc95ae7121768c16530cbae686eaf37 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -536,6 +536,7 @@ thought! Note [Desugar Strict binds] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See https://ghc.haskell.org/trac/ghc/wiki/StrictPragma Desugaring strict variable bindings looks as follows (core below ==>) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index a9c6f6cbfdd1454282921fd7000502ff7d56071f..f3874ab1dc6bcaaec2ea4c25a8c7bf3008cfa1da 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -1651,12 +1651,9 @@ decideGeneralisationPlan dflags lbinds closed sig_fn restricted (VarBind { var_id = v }) = no_sig v restricted (FunBind { fun_id = v, fun_matches = m }) = restricted_match m && no_sig (unLoc v) - restricted (PatSynBind {}) = panic "isRestrictedGroup/unrestricted PatSynBind" - restricted (AbsBinds {}) = panic "isRestrictedGroup/unrestricted AbsBinds" - restricted (AbsBindsSig {}) = panic "isRestrictedGroup/unrestricted AbsBindsSig" + restricted b = pprPanic "isRestrictedGroup/unrestricted" (ppr b) - restricted_match (MG { mg_alts = L _ (L _ (Match _ [] _ _) : _ )}) = True - restricted_match _ = False + restricted_match mg = matchGroupArity mg == 0 -- No args => like a pattern binding -- Some args => a function binding