diff options
| author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-08-28 17:33:59 +0100 |
|---|---|---|
| committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-08-29 09:37:11 +0100 |
| commit | a6c448b403dbe8720178ca82100f34baedb1f47e (patch) | |
| tree | 957d36a85d5f361c34df5f826e96a2132ce51991 /compiler/deSugar/DsUtils.hs | |
| parent | 8eead4de7c820e602193d6d16acd00faeffa035c (diff) | |
| download | haskell-a6c448b403dbe8720178ca82100f34baedb1f47e.tar.gz | |
Small refactor of getRuntimeRep
Instead of using a string argument, use HasDebugCallStack.
(Oddly, some functions were using both!)
Plus, use getRuntimeRep rather than getRuntimeRep_maybe when
if the caller panics on Nothing. Less code, and a better debug
stack.
Diffstat (limited to 'compiler/deSugar/DsUtils.hs')
| -rw-r--r-- | compiler/deSugar/DsUtils.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/deSugar/DsUtils.hs b/compiler/deSugar/DsUtils.hs index a1f3a143f3..088db2c568 100644 --- a/compiler/deSugar/DsUtils.hs +++ b/compiler/deSugar/DsUtils.hs @@ -344,7 +344,7 @@ sort_alts = sortWith (dataConTag . alt_pat) mkPatSynCase :: Id -> Type -> CaseAlt PatSyn -> CoreExpr -> DsM CoreExpr mkPatSynCase var ty alt fail = do matcher <- dsLExpr $ mkLHsWrap wrapper $ - nlHsTyApp matcher [getRuntimeRep "mkPatSynCase" ty, ty] + nlHsTyApp matcher [getRuntimeRep ty, ty] let MatchResult _ mkCont = match_result cont <- mkCoreLams bndrs <$> mkCont fail return $ mkCoreAppsDs (text "patsyn" <+> ppr var) matcher [Var var, ensure_unstrict cont, Lam voidArgId fail] @@ -471,7 +471,7 @@ mkErrorAppDs err_id ty msg = do full_msg = showSDoc dflags (hcat [ppr src_loc, vbar, msg]) core_msg = Lit (mkMachString full_msg) -- mkMachString returns a result of type String# - return (mkApps (Var err_id) [Type (getRuntimeRep "mkErrorAppDs" ty), Type ty, core_msg]) + return (mkApps (Var err_id) [Type (getRuntimeRep ty), Type ty, core_msg]) {- 'mkCoreAppDs' and 'mkCoreAppsDs' hand the special-case desugaring of 'seq'. |
