From 7f6674d62e760d2afa53ff57bb4a115eed58901d Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 21 Apr 2017 13:12:15 +0100 Subject: [PATCH] Comments and tiny refactoring --- compiler/deSugar/DsBinds.hs | 1 + compiler/typecheck/TcBinds.hs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 1ff04b2548..73ae91329b 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 a9c6f6cbfd..f3874ab1dc 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 -- GitLab