)
import PprType ( pprParendType )
import Module ( Module )
-import CoreUtils ( mkInlineMe )
+import CoreUtils ( exprType, mkInlineMe )
import CoreUnfold ( mkTopUnfolding, mkCompulsoryUnfolding, mkOtherCon )
import Subst ( mkTopTyVarSubst, substClasses )
import TyCon ( TyCon, isNewTyCon, tyConTyVars, tyConDataCons, isDataTyCon,
ToDo: unify with mkRecordSelId.
\begin{code}
-mkDictSelId name clas ty
+mkDictSelId name clas
= sel_id
where
+ ty = exprType rhs
sel_id = mkId name ty info
field_lbl = mkFieldLabel name ty tag
tag = assoc "MkId.mkDictSelId" (classSelIds clas `zip` allFieldLabelTags) sel_id
hcat [text "{-# LINE ", int IBOX(src_line), space,
char '\"', ptext src_path, text " #-}"]
where
- src_file = remove_directory_prefix (unpackFS src_path)
-
- remove_directory_prefix path = case break (== '/') path of
- (filename, []) -> filename
- (prefix, slash : rest) -> ASSERT( slash == '/' )
- remove_directory_prefix rest
+ src_file = unpackFS src_path -- Leave the directory prefix intact,
+ -- so emacs can find the file
ppr (UnhelpfulSrcLoc s) = ptext s