- -- (c) optionally, bindings with no signature
- let
- (goodies, dups) = removeDups cmp_sig (sigsForMe (not . isUnboundName) sigs')
- not_this_group = sigsForMe (not . (`elemNameSet` binders)) goodies
- spec_inst_sigs = [s | s@(SpecInstSig _ _) <- goodies]
- type_sig_vars = [n | Sig n _ _ <- goodies]
- sigs_required = case top_lev of {TopLevel -> opt_SigsRequired; NotTopLevel -> False}
- un_sigd_binders | sigs_required = nameSetToList binders `minusList` type_sig_vars
- | otherwise = []
- in
- mapRn dupSigDeclErr dups `thenRn_`
- mapRn unknownSigErr not_this_group `thenRn_`
- (if not inst_decl then
- mapRn unknownSigErr spec_inst_sigs
- else
- returnRn []
- ) `thenRn_`
- mapRn (addErrRn.missingSigErr) un_sigd_binders `thenRn_`
-
- returnRn sigs' -- bad ones and all:
- -- we need bindings of *some* sort for every name
-
-
-renameSig (Sig v ty src_loc)
- = pushSrcLocRn src_loc $
- lookupBndrRn v `thenRn` \ new_v ->
- rnHsSigType (quotes (ppr v)) ty `thenRn` \ new_ty ->
- returnRn (Sig new_v new_ty src_loc)
-
-renameSig (SpecInstSig ty src_loc)
- = pushSrcLocRn src_loc $
- rnHsSigType (text "A SPECIALISE instance pragma") ty `thenRn` \ new_ty ->
- returnRn (SpecInstSig new_ty src_loc)
-
-renameSig (SpecSig v ty using src_loc)
- = pushSrcLocRn src_loc $
- lookupBndrRn v `thenRn` \ new_v ->
- rnHsSigType (quotes (ppr v)) ty `thenRn` \ new_ty ->
- rn_using using `thenRn` \ new_using ->
- returnRn (SpecSig new_v new_ty new_using src_loc)