diff options
| author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-01-06 08:12:04 +0100 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-01 14:06:11 -0500 |
| commit | ddc2a7595a28b6098b6aab61bc830f2296affcdc (patch) | |
| tree | 2863cb09e18f9d2cba1ff8a4f78b6a2f6431837f /compiler/GHC/Tc/Utils/Unify.hs | |
| parent | 5464845a012bf174cfafe03aaeb2e47150e7efb5 (diff) | |
| download | haskell-ddc2a7595a28b6098b6aab61bc830f2296affcdc.tar.gz | |
Remove ErrDoc and MsgDoc
This commit boldly removes the ErrDoc and the MsgDoc from the codebase.
The former was introduced with the only purpose of classifying errors
according to their importance, but a similar result can be obtained just
by having a simple [SDoc], and placing bullets after each of them.
On top of that I have taken the perhaps controversial decision to also
banish MsgDoc, as it was merely a type alias over an SDoc and as such it wasn't
offering any extra type safety. Granted, it was perhaps making type
signatures slightly more "focused", but at the expense of cognitive
burden: if it's really just an SDoc, let's call it with its proper name.
Diffstat (limited to 'compiler/GHC/Tc/Utils/Unify.hs')
| -rw-r--r-- | compiler/GHC/Tc/Utils/Unify.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Utils/Unify.hs b/compiler/GHC/Tc/Utils/Unify.hs index f5cf306dc1..23dcfe6e83 100644 --- a/compiler/GHC/Tc/Utils/Unify.hs +++ b/compiler/GHC/Tc/Utils/Unify.hs @@ -159,7 +159,7 @@ matchActualFunTySigma herald mb_thing err_info fun_ty ; return (mkWpCastN co, Scaled mult arg_ty, res_ty) } ------------ - mk_ctxt :: TcType -> TidyEnv -> TcM (TidyEnv, MsgDoc) + mk_ctxt :: TcType -> TidyEnv -> TcM (TidyEnv, SDoc) mk_ctxt res_ty env = mkFunTysMsg env herald (reverse arg_tys_so_far) res_ty n_val_args_in_call (n_val_args_in_call, arg_tys_so_far) = err_info @@ -371,7 +371,7 @@ matchExpectedFunTys herald ctx arity orig_ty thing_inside ; return (wrap, result) } ------------ - mk_ctxt :: [Scaled ExpSigmaType] -> TcType -> TidyEnv -> TcM (TidyEnv, MsgDoc) + mk_ctxt :: [Scaled ExpSigmaType] -> TcType -> TidyEnv -> TcM (TidyEnv, SDoc) mk_ctxt arg_tys res_ty env = mkFunTysMsg env herald arg_tys' res_ty arity where @@ -380,7 +380,7 @@ matchExpectedFunTys herald ctx arity orig_ty thing_inside -- this is safe b/c we're called from "go" mkFunTysMsg :: TidyEnv -> SDoc -> [Scaled TcType] -> TcType -> Arity - -> TcM (TidyEnv, MsgDoc) + -> TcM (TidyEnv, SDoc) mkFunTysMsg env herald arg_tys res_ty n_val_args_in_call = do { (env', fun_rho) <- zonkTidyTcType env $ mkVisFunTys arg_tys res_ty |
