packages feed

apply-refact 0.9.2.0 → 0.9.3.0

raw patch · 24 files changed

+1722/−1412 lines, 24 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Refact.Compat: ABE :: XABE p -> IdP p -> IdP p -> HsWrapper -> TcSpecPrags -> ABExport p
+ Refact.Compat: AbsBinds :: XAbsBinds idL idR -> [TyVar] -> [EvVar] -> [ABExport idL] -> [TcEvBinds] -> LHsBinds idL -> Bool -> HsBindLR idL idR
+ Refact.Compat: Ambiguous :: XAmbiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
+ Refact.Compat: AnnAnyclass :: AnnKeywordId
+ Refact.Compat: AnnAs :: AnnKeywordId
+ Refact.Compat: AnnAt :: AnnKeywordId
+ Refact.Compat: AnnBackquote :: AnnKeywordId
+ Refact.Compat: AnnBang :: AnnKeywordId
+ Refact.Compat: AnnBy :: AnnKeywordId
+ Refact.Compat: AnnCase :: AnnKeywordId
+ Refact.Compat: AnnClass :: AnnKeywordId
+ Refact.Compat: AnnClose :: AnnKeywordId
+ Refact.Compat: AnnCloseB :: AnnKeywordId
+ Refact.Compat: AnnCloseBU :: AnnKeywordId
+ Refact.Compat: AnnCloseC :: AnnKeywordId
+ Refact.Compat: AnnCloseP :: AnnKeywordId
+ Refact.Compat: AnnCloseQ :: AnnKeywordId
+ Refact.Compat: AnnCloseQU :: AnnKeywordId
+ Refact.Compat: AnnCloseS :: AnnKeywordId
+ Refact.Compat: AnnColon :: AnnKeywordId
+ Refact.Compat: AnnComma :: AnnKeywordId
+ Refact.Compat: AnnCommaTuple :: AnnKeywordId
+ Refact.Compat: AnnD :: XAnnD p -> AnnDecl p -> HsDecl p
+ Refact.Compat: AnnDarrow :: AnnKeywordId
+ Refact.Compat: AnnDarrowU :: AnnKeywordId
+ Refact.Compat: AnnData :: AnnKeywordId
+ Refact.Compat: AnnDcolon :: AnnKeywordId
+ Refact.Compat: AnnDcolonU :: AnnKeywordId
+ Refact.Compat: AnnDefault :: AnnKeywordId
+ Refact.Compat: AnnDeriving :: AnnKeywordId
+ Refact.Compat: AnnDo :: AnnKeywordId
+ Refact.Compat: AnnDot :: AnnKeywordId
+ Refact.Compat: AnnDotdot :: AnnKeywordId
+ Refact.Compat: AnnElse :: AnnKeywordId
+ Refact.Compat: AnnEofPos :: AnnKeywordId
+ Refact.Compat: AnnEqual :: AnnKeywordId
+ Refact.Compat: AnnExport :: AnnKeywordId
+ Refact.Compat: AnnFamily :: AnnKeywordId
+ Refact.Compat: AnnForall :: AnnKeywordId
+ Refact.Compat: AnnForallU :: AnnKeywordId
+ Refact.Compat: AnnForeign :: AnnKeywordId
+ Refact.Compat: AnnFunId :: AnnKeywordId
+ Refact.Compat: AnnGroup :: AnnKeywordId
+ Refact.Compat: AnnHeader :: AnnKeywordId
+ Refact.Compat: AnnHiding :: AnnKeywordId
+ Refact.Compat: AnnIf :: AnnKeywordId
+ Refact.Compat: AnnImport :: AnnKeywordId
+ Refact.Compat: AnnIn :: AnnKeywordId
+ Refact.Compat: AnnInfix :: AnnKeywordId
+ Refact.Compat: AnnInstance :: AnnKeywordId
+ Refact.Compat: AnnLam :: AnnKeywordId
+ Refact.Compat: AnnLarrow :: AnnKeywordId
+ Refact.Compat: AnnLarrowU :: AnnKeywordId
+ Refact.Compat: AnnLarrowtail :: AnnKeywordId
+ Refact.Compat: AnnLarrowtailU :: AnnKeywordId
+ Refact.Compat: AnnLet :: AnnKeywordId
+ Refact.Compat: AnnMdo :: AnnKeywordId
+ Refact.Compat: AnnMinus :: AnnKeywordId
+ Refact.Compat: AnnModule :: AnnKeywordId
+ Refact.Compat: AnnName :: AnnKeywordId
+ Refact.Compat: AnnNewtype :: AnnKeywordId
+ Refact.Compat: AnnOf :: AnnKeywordId
+ Refact.Compat: AnnOpen :: AnnKeywordId
+ Refact.Compat: AnnOpenB :: AnnKeywordId
+ Refact.Compat: AnnOpenBU :: AnnKeywordId
+ Refact.Compat: AnnOpenC :: AnnKeywordId
+ Refact.Compat: AnnOpenE :: AnnKeywordId
+ Refact.Compat: AnnOpenEQ :: AnnKeywordId
+ Refact.Compat: AnnOpenEQU :: AnnKeywordId
+ Refact.Compat: AnnOpenP :: AnnKeywordId
+ Refact.Compat: AnnOpenPE :: AnnKeywordId
+ Refact.Compat: AnnOpenPTE :: AnnKeywordId
+ Refact.Compat: AnnOpenS :: AnnKeywordId
+ Refact.Compat: AnnPackageName :: AnnKeywordId
+ Refact.Compat: AnnPattern :: AnnKeywordId
+ Refact.Compat: AnnProc :: AnnKeywordId
+ Refact.Compat: AnnQualified :: AnnKeywordId
+ Refact.Compat: AnnRarrow :: AnnKeywordId
+ Refact.Compat: AnnRarrowU :: AnnKeywordId
+ Refact.Compat: AnnRarrowtail :: AnnKeywordId
+ Refact.Compat: AnnRarrowtailU :: AnnKeywordId
+ Refact.Compat: AnnRec :: AnnKeywordId
+ Refact.Compat: AnnRole :: AnnKeywordId
+ Refact.Compat: AnnSafe :: AnnKeywordId
+ Refact.Compat: AnnSemi :: AnnKeywordId
+ Refact.Compat: AnnSignature :: AnnKeywordId
+ Refact.Compat: AnnSimpleQuote :: AnnKeywordId
+ Refact.Compat: AnnStatic :: AnnKeywordId
+ Refact.Compat: AnnStock :: AnnKeywordId
+ Refact.Compat: AnnThIdSplice :: AnnKeywordId
+ Refact.Compat: AnnThIdTySplice :: AnnKeywordId
+ Refact.Compat: AnnThTyQuote :: AnnKeywordId
+ Refact.Compat: AnnThen :: AnnKeywordId
+ Refact.Compat: AnnTilde :: AnnKeywordId
+ Refact.Compat: AnnType :: AnnKeywordId
+ Refact.Compat: AnnUnit :: AnnKeywordId
+ Refact.Compat: AnnUsing :: AnnKeywordId
+ Refact.Compat: AnnVal :: AnnKeywordId
+ Refact.Compat: AnnValStr :: AnnKeywordId
+ Refact.Compat: AnnVbar :: AnnKeywordId
+ Refact.Compat: AnnVia :: AnnKeywordId
+ Refact.Compat: AnnWhere :: AnnKeywordId
+ Refact.Compat: Annlarrowtail :: AnnKeywordId
+ Refact.Compat: AnnlarrowtailU :: AnnKeywordId
+ Refact.Compat: Annrarrowtail :: AnnKeywordId
+ Refact.Compat: AnnrarrowtailU :: AnnKeywordId
+ Refact.Compat: AnyclassStrategy :: DerivStrategy pass
+ Refact.Compat: ApplicativeArgMany :: XApplicativeArgMany idL -> [ExprLStmt idL] -> HsExpr idL -> LPat idL -> ApplicativeArg idL
+ Refact.Compat: ApplicativeArgOne :: XApplicativeArgOne idL -> LPat idL -> LHsExpr idL -> Bool -> SyntaxExpr idL -> ApplicativeArg idL
+ Refact.Compat: ApplicativeStmt :: XApplicativeStmt idL idR body -> [(SyntaxExpr idR, ApplicativeArg idL)] -> Maybe (SyntaxExpr idR) -> StmtLR idL idR body
+ Refact.Compat: ArgDocMap :: Map Name (Map Int HsDocString) -> ArgDocMap
+ Refact.Compat: ArithSeq :: XArithSeq p -> Maybe (SyntaxExpr p) -> ArithSeqInfo p -> HsExpr p
+ Refact.Compat: ArrowExpr :: HsStmtContext id
+ Refact.Compat: BindStmt :: XBindStmt idL idR body -> LPat idL -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Refact.Compat: BodyStmt :: XBodyStmt idL idR body -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Refact.Compat: CExport :: Located CExportSpec -> Located SourceText -> ForeignExport
+ Refact.Compat: CFunction :: CCallTarget -> CImportSpec
+ Refact.Compat: CImport :: Located CCallConv -> Located Safety -> Maybe Header -> CImportSpec -> Located SourceText -> ForeignImport
+ Refact.Compat: CLabel :: CLabelString -> CImportSpec
+ Refact.Compat: CWrapper :: CImportSpec
+ Refact.Compat: CaseAlt :: HsMatchContext id
+ Refact.Compat: ClassDecl :: XClassDecl pass -> LHsContext pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> [LHsFunDep pass] -> [LSig pass] -> LHsBinds pass -> [LFamilyDecl pass] -> [LTyFamDefltDecl pass] -> [LDocDecl] -> TyClDecl pass
+ Refact.Compat: ClassOpSig :: XClassOpSig pass -> Bool -> [Located (IdP pass)] -> LHsSigType pass -> Sig pass
+ Refact.Compat: ClosedTypeFamily :: Maybe [LTyFamInstEqn pass] -> FamilyInfo pass
+ Refact.Compat: ClsInstD :: XClsInstD pass -> ClsInstDecl pass -> InstDecl pass
+ Refact.Compat: ClsInstDecl :: XCClsInstDecl pass -> LHsSigType pass -> LHsBinds pass -> [LSig pass] -> [LTyFamInstDecl pass] -> [LDataFamInstDecl pass] -> Maybe (Located OverlapMode) -> ClsInstDecl pass
+ Refact.Compat: CmdTopTc :: Type -> Type -> CmdSyntaxTable GhcTc -> CmdTopTc
+ Refact.Compat: CompleteMatchSig :: XCompleteMatchSig pass -> SourceText -> Located [Located (IdP pass)] -> Maybe (Located (IdP pass)) -> Sig pass
+ Refact.Compat: ConDeclField :: XConDeclField pass -> [LFieldOcc pass] -> LBangType pass -> Maybe LHsDocString -> ConDeclField pass
+ Refact.Compat: ConDeclGADT :: XConDeclGADT pass -> [Located (IdP pass)] -> Located Bool -> LHsQTyVars pass -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> LHsType pass -> Maybe LHsDocString -> ConDecl pass
+ Refact.Compat: ConDeclH98 :: XConDeclH98 pass -> Located (IdP pass) -> Located Bool -> [LHsTyVarBndr pass] -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> Maybe LHsDocString -> ConDecl pass
+ Refact.Compat: DataDecl :: XDataDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> HsDataDefn pass -> TyClDecl pass
+ Refact.Compat: DataDeclRn :: Bool -> NameSet -> DataDeclRn
+ Refact.Compat: DataFamInstD :: XDataFamInstD pass -> DataFamInstDecl pass -> InstDecl pass
+ Refact.Compat: DataFamInstDecl :: FamInstEqn pass (HsDataDefn pass) -> DataFamInstDecl pass
+ Refact.Compat: DataFamily :: FamilyInfo pass
+ Refact.Compat: DataType :: NewOrData
+ Refact.Compat: DecBrG :: XDecBrG p -> HsGroup p -> HsBracket p
+ Refact.Compat: DecBrL :: XDecBrL p -> [LHsDecl p] -> HsBracket p
+ Refact.Compat: DeclDocMap :: Map Name HsDocString -> DeclDocMap
+ Refact.Compat: DefD :: XDefD p -> DefaultDecl p -> HsDecl p
+ Refact.Compat: DefaultDecl :: XCDefaultDecl pass -> [LHsType pass] -> DefaultDecl pass
+ Refact.Compat: DelayedSplice :: TcLclEnv -> LHsExpr GhcRn -> TcType -> LHsExpr GhcTcId -> DelayedSplice
+ Refact.Compat: DerivD :: XDerivD p -> DerivDecl p -> HsDecl p
+ Refact.Compat: DerivDecl :: XCDerivDecl pass -> LHsSigWcType pass -> Maybe (LDerivStrategy pass) -> Maybe (Located OverlapMode) -> DerivDecl pass
+ Refact.Compat: DoExpr :: HsStmtContext id
+ Refact.Compat: DocCommentNamed :: String -> HsDocString -> DocDecl
+ Refact.Compat: DocCommentNext :: HsDocString -> DocDecl
+ Refact.Compat: DocCommentPrev :: HsDocString -> DocDecl
+ Refact.Compat: DocD :: XDocD p -> DocDecl -> HsDecl p
+ Refact.Compat: DocGroup :: Int -> HsDocString -> DocDecl
+ Refact.Compat: EmptyLocalBinds :: XEmptyLocalBinds idL idR -> HsLocalBindsLR idL idR
+ Refact.Compat: Exact :: Name -> RdrName
+ Refact.Compat: ExpBr :: XExpBr p -> LHsExpr p -> HsBracket p
+ Refact.Compat: ExplicitBidirectional :: MatchGroup id (LHsExpr id) -> HsPatSynDir id
+ Refact.Compat: ExplicitList :: XExplicitList p -> Maybe (SyntaxExpr p) -> [LHsExpr p] -> HsExpr p
+ Refact.Compat: ExplicitSplice :: SpliceExplicitFlag
+ Refact.Compat: ExplicitSum :: XExplicitSum p -> ConTag -> Arity -> LHsExpr p -> HsExpr p
+ Refact.Compat: ExplicitTuple :: XExplicitTuple p -> [LHsTupArg p] -> Boxity -> HsExpr p
+ Refact.Compat: ExprWithTySig :: XExprWithTySig p -> LHsExpr p -> LHsSigWcType (NoGhcTc p) -> HsExpr p
+ Refact.Compat: FamDecl :: XFamDecl pass -> FamilyDecl pass -> TyClDecl pass
+ Refact.Compat: FamEqn :: XCFamEqn pass rhs -> Located (IdP pass) -> Maybe [LHsTyVarBndr pass] -> HsTyPats pass -> LexicalFixity -> rhs -> FamEqn pass rhs
+ Refact.Compat: FamilyDecl :: XCFamilyDecl pass -> FamilyInfo pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LFamilyResultSig pass -> Maybe (LInjectivityAnn pass) -> FamilyDecl pass
+ Refact.Compat: FieldOcc :: XCFieldOcc pass -> Located RdrName -> FieldOcc pass
+ Refact.Compat: FixSig :: XFixSig pass -> FixitySig pass -> Sig pass
+ Refact.Compat: Fixity :: SourceText -> Int -> FixityDirection -> Fixity
+ Refact.Compat: FixitySig :: XFixitySig pass -> [Located (IdP pass)] -> Fixity -> FixitySig pass
+ Refact.Compat: FlagSpec :: String -> flag -> (TurnOnFlag -> DynP ()) -> GhcFlagMode -> FlagSpec flag
+ Refact.Compat: ForD :: XForD p -> ForeignDecl p -> HsDecl p
+ Refact.Compat: ForallInvis :: ForallVisFlag
+ Refact.Compat: ForallVis :: ForallVisFlag
+ Refact.Compat: ForeignExport :: XForeignExport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignExport -> ForeignDecl pass
+ Refact.Compat: ForeignImport :: XForeignImport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignImport -> ForeignDecl pass
+ Refact.Compat: From :: LHsExpr id -> ArithSeqInfo id
+ Refact.Compat: FromThen :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Refact.Compat: FromThenTo :: LHsExpr id -> LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Refact.Compat: FromTo :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Refact.Compat: FunBind :: XFunBind idL idR -> Located (IdP idL) -> MatchGroup idR (LHsExpr idR) -> HsWrapper -> [Tickish Id] -> HsBindLR idL idR
+ Refact.Compat: FunRhs :: Located id -> LexicalFixity -> SrcStrictness -> HsMatchContext id
+ Refact.Compat: GRHS :: XCGRHS p body -> [GuardLStmt p] -> body -> GRHS p body
+ Refact.Compat: GRHSs :: XCGRHSs p body -> [LGRHS p body] -> LHsLocalBinds p -> GRHSs p body
+ Refact.Compat: GhciStmtCtxt :: HsStmtContext id
+ Refact.Compat: GroupForm :: TransForm
+ Refact.Compat: HasDollar :: SpliceDecoration
+ Refact.Compat: HasParens :: SpliceDecoration
+ Refact.Compat: HsAnnotation :: XHsAnnotation pass -> SourceText -> AnnProvenance (IdP pass) -> Located (HsExpr pass) -> AnnDecl pass
+ Refact.Compat: HsApp :: XApp p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsAppKindTy :: XAppKindTy pass -> LHsType pass -> LHsKind pass -> HsType pass
+ Refact.Compat: HsAppTy :: XAppTy pass -> LHsType pass -> LHsType pass -> HsType pass
+ Refact.Compat: HsAppType :: XAppTypeE p -> LHsExpr p -> LHsWcType (NoGhcTc p) -> HsExpr p
+ Refact.Compat: HsArgPar :: SrcSpan -> HsArg tm ty
+ Refact.Compat: HsBangTy :: XBangTy pass -> HsSrcBang -> LHsType pass -> HsType pass
+ Refact.Compat: HsBinTick :: XBinTick p -> Int -> Int -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsBoxedOrConstraintTuple :: HsTupleSort
+ Refact.Compat: HsBoxedTuple :: HsTupleSort
+ Refact.Compat: HsBracket :: XBracket p -> HsBracket p -> HsExpr p
+ Refact.Compat: HsCase :: XCase p -> LHsExpr p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Refact.Compat: HsChar :: XHsChar x -> Char -> HsLit x
+ Refact.Compat: HsCharPrim :: XHsCharPrim x -> Char -> HsLit x
+ Refact.Compat: HsCmdApp :: XCmdApp id -> LHsCmd id -> LHsExpr id -> HsCmd id
+ Refact.Compat: HsCmdArrApp :: XCmdArrApp id -> LHsExpr id -> LHsExpr id -> HsArrAppType -> Bool -> HsCmd id
+ Refact.Compat: HsCmdArrForm :: XCmdArrForm id -> LHsExpr id -> LexicalFixity -> Maybe Fixity -> [LHsCmdTop id] -> HsCmd id
+ Refact.Compat: HsCmdCase :: XCmdCase id -> LHsExpr id -> MatchGroup id (LHsCmd id) -> HsCmd id
+ Refact.Compat: HsCmdDo :: XCmdDo id -> Located [CmdLStmt id] -> HsCmd id
+ Refact.Compat: HsCmdIf :: XCmdIf id -> Maybe (SyntaxExpr id) -> LHsExpr id -> LHsCmd id -> LHsCmd id -> HsCmd id
+ Refact.Compat: HsCmdLam :: XCmdLam id -> MatchGroup id (LHsCmd id) -> HsCmd id
+ Refact.Compat: HsCmdLet :: XCmdLet id -> LHsLocalBinds id -> LHsCmd id -> HsCmd id
+ Refact.Compat: HsCmdPar :: XCmdPar id -> LHsCmd id -> HsCmd id
+ Refact.Compat: HsCmdTop :: XCmdTop p -> LHsCmd p -> HsCmdTop p
+ Refact.Compat: HsCmdWrap :: XCmdWrap id -> HsWrapper -> HsCmd id -> HsCmd id
+ Refact.Compat: HsConLikeOut :: XConLikeOut p -> ConLike -> HsExpr p
+ Refact.Compat: HsConstraintTuple :: HsTupleSort
+ Refact.Compat: HsCoreAnn :: XCoreAnn p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsDataDefn :: XCHsDataDefn pass -> NewOrData -> LHsContext pass -> Maybe (Located CType) -> Maybe (LHsKind pass) -> [LConDecl pass] -> HsDeriving pass -> HsDataDefn pass
+ Refact.Compat: HsDerivingClause :: XCHsDerivingClause pass -> Maybe (LDerivStrategy pass) -> Located [LHsSigType pass] -> HsDerivingClause pass
+ Refact.Compat: HsDo :: XDo p -> HsStmtContext Name -> Located [ExprLStmt p] -> HsExpr p
+ Refact.Compat: HsDocTy :: XDocTy pass -> LHsType pass -> LHsDocString -> HsType pass
+ Refact.Compat: HsDoublePrim :: XHsDoublePrim x -> FractionalLit -> HsLit x
+ Refact.Compat: HsExplicitListTy :: XExplicitListTy pass -> PromotionFlag -> [LHsType pass] -> HsType pass
+ Refact.Compat: HsExplicitTupleTy :: XExplicitTupleTy pass -> [LHsType pass] -> HsType pass
+ Refact.Compat: HsFirstOrderApp :: HsArrAppType
+ Refact.Compat: HsFloatPrim :: XHsFloatPrim x -> FractionalLit -> HsLit x
+ Refact.Compat: HsForAllTy :: XForAllTy pass -> ForallVisFlag -> [LHsTyVarBndr pass] -> LHsType pass -> HsType pass
+ Refact.Compat: HsFractional :: !FractionalLit -> OverLitVal
+ Refact.Compat: HsFunTy :: XFunTy pass -> LHsType pass -> LHsType pass -> HsType pass
+ Refact.Compat: HsGroup :: XCHsGroup p -> HsValBinds p -> [LSpliceDecl p] -> [TyClGroup p] -> [LDerivDecl p] -> [LFixitySig p] -> [LDefaultDecl p] -> [LForeignDecl p] -> [LWarnDecls p] -> [LAnnDecl p] -> [LRuleDecls p] -> [LDocDecl] -> HsGroup p
+ Refact.Compat: HsHigherOrderApp :: HsArrAppType
+ Refact.Compat: HsIB :: XHsIB pass thing -> thing -> HsImplicitBndrs pass thing
+ Refact.Compat: HsIPBinds :: XHsIPBinds idL idR -> HsIPBinds idR -> HsLocalBindsLR idL idR
+ Refact.Compat: HsIPName :: FastString -> HsIPName
+ Refact.Compat: HsIPVar :: XIPVar p -> HsIPName -> HsExpr p
+ Refact.Compat: HsIParamTy :: XIParamTy pass -> Located HsIPName -> LHsType pass -> HsType pass
+ Refact.Compat: HsIf :: XIf p -> Maybe (SyntaxExpr p) -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsInt :: XHsInt x -> IntegralLit -> HsLit x
+ Refact.Compat: HsInt64Prim :: XHsInt64Prim x -> Integer -> HsLit x
+ Refact.Compat: HsIntPrim :: XHsIntPrim x -> Integer -> HsLit x
+ Refact.Compat: HsInteger :: XHsInteger x -> Integer -> Type -> HsLit x
+ Refact.Compat: HsIntegral :: !IntegralLit -> OverLitVal
+ Refact.Compat: HsIsString :: !SourceText -> !FastString -> OverLitVal
+ Refact.Compat: HsKindSig :: XKindSig pass -> LHsType pass -> LHsKind pass -> HsType pass
+ Refact.Compat: HsLam :: XLam p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Refact.Compat: HsLamCase :: XLamCase p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Refact.Compat: HsLazy :: HsImplBang
+ Refact.Compat: HsLet :: XLet p -> LHsLocalBinds p -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsListTy :: XListTy pass -> LHsType pass -> HsType pass
+ Refact.Compat: HsLit :: XLitE p -> HsLit p -> HsExpr p
+ Refact.Compat: HsModule :: Maybe (Located ModuleName) -> Maybe (Located [LIE pass]) -> [LImportDecl pass] -> [LHsDecl pass] -> Maybe (Located WarningTxt) -> Maybe LHsDocString -> HsModule pass
+ Refact.Compat: HsMultiIf :: XMultiIf p -> [LGRHS p (LHsExpr p)] -> HsExpr p
+ Refact.Compat: HsNumTy :: SourceText -> Integer -> HsTyLit
+ Refact.Compat: HsOpTy :: XOpTy pass -> LHsType pass -> Located (IdP pass) -> LHsType pass -> HsType pass
+ Refact.Compat: HsOverLabel :: XOverLabel p -> Maybe (IdP p) -> FastString -> HsExpr p
+ Refact.Compat: HsOverLit :: XOverLitE p -> HsOverLit p -> HsExpr p
+ Refact.Compat: HsPar :: XPar p -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsParTy :: XParTy pass -> LHsType pass -> HsType pass
+ Refact.Compat: HsProc :: XProc p -> LPat p -> LHsCmdTop p -> HsExpr p
+ Refact.Compat: HsQTvs :: XHsQTvs pass -> [LHsTyVarBndr pass] -> LHsQTyVars pass
+ Refact.Compat: HsQualTy :: XQualTy pass -> LHsContext pass -> LHsType pass -> HsType pass
+ Refact.Compat: HsQuasiQuote :: XQuasiQuote id -> IdP id -> IdP id -> SrcSpan -> FastString -> HsSplice id
+ Refact.Compat: HsRat :: XHsRat x -> FractionalLit -> Type -> HsLit x
+ Refact.Compat: HsRecField :: Located id -> arg -> Bool -> HsRecField' id arg
+ Refact.Compat: HsRecFields :: [LHsRecField p arg] -> Maybe (Located Int) -> HsRecFields p arg
+ Refact.Compat: HsRecFld :: XRecFld p -> AmbiguousFieldOcc p -> HsExpr p
+ Refact.Compat: HsRecTy :: XRecTy pass -> [LConDeclField pass] -> HsType pass
+ Refact.Compat: HsRnBracketOut :: XRnBracketOut p -> HsBracket GhcRn -> [PendingRnSplice] -> HsExpr p
+ Refact.Compat: HsRule :: XHsRule pass -> Located (SourceText, RuleName) -> Activation -> Maybe [LHsTyVarBndr (NoGhcTc pass)] -> [LRuleBndr pass] -> Located (HsExpr pass) -> Located (HsExpr pass) -> RuleDecl pass
+ Refact.Compat: HsRuleRn :: NameSet -> NameSet -> HsRuleRn
+ Refact.Compat: HsRules :: XCRuleDecls pass -> SourceText -> [LRuleDecl pass] -> RuleDecls pass
+ Refact.Compat: HsSCC :: XSCC p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsSpliceE :: XSpliceE p -> HsSplice p -> HsExpr p
+ Refact.Compat: HsSpliceTy :: XSpliceTy pass -> HsSplice pass -> HsType pass
+ Refact.Compat: HsSpliced :: XSpliced id -> ThModFinalizers -> HsSplicedThing id -> HsSplice id
+ Refact.Compat: HsSplicedExpr :: HsExpr id -> HsSplicedThing id
+ Refact.Compat: HsSplicedPat :: Pat id -> HsSplicedThing id
+ Refact.Compat: HsSplicedT :: DelayedSplice -> HsSplice id
+ Refact.Compat: HsSplicedTy :: HsType id -> HsSplicedThing id
+ Refact.Compat: HsSrcBang :: SourceText -> SrcUnpackedness -> SrcStrictness -> HsSrcBang
+ Refact.Compat: HsStarTy :: XStarTy pass -> Bool -> HsType pass
+ Refact.Compat: HsStatic :: XStatic p -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsStrTy :: SourceText -> FastString -> HsTyLit
+ Refact.Compat: HsStrict :: HsImplBang
+ Refact.Compat: HsString :: XHsString x -> FastString -> HsLit x
+ Refact.Compat: HsStringPrim :: XHsStringPrim x -> ByteString -> HsLit x
+ Refact.Compat: HsSumTy :: XSumTy pass -> [LHsType pass] -> HsType pass
+ Refact.Compat: HsTcBracketOut :: XTcBracketOut p -> HsBracket GhcRn -> [PendingTcSplice] -> HsExpr p
+ Refact.Compat: HsTick :: XTick p -> Tickish (IdP p) -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsTickPragma :: XTickPragma p -> SourceText -> (StringLiteral, (Int, Int), (Int, Int)) -> ((SourceText, SourceText), (SourceText, SourceText)) -> LHsExpr p -> HsExpr p
+ Refact.Compat: HsTupleTy :: XTupleTy pass -> HsTupleSort -> [LHsType pass] -> HsType pass
+ Refact.Compat: HsTyLit :: XTyLit pass -> HsTyLit -> HsType pass
+ Refact.Compat: HsTyVar :: XTyVar pass -> PromotionFlag -> Located (IdP pass) -> HsType pass
+ Refact.Compat: HsTypeArg :: SrcSpan -> ty -> HsArg tm ty
+ Refact.Compat: HsTypedSplice :: XTypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
+ Refact.Compat: HsUnboundVar :: XUnboundVar p -> UnboundVar -> HsExpr p
+ Refact.Compat: HsUnboxedTuple :: HsTupleSort
+ Refact.Compat: HsUnpack :: Maybe Coercion -> HsImplBang
+ Refact.Compat: HsUntypedSplice :: XUntypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
+ Refact.Compat: HsValArg :: tm -> HsArg tm ty
+ Refact.Compat: HsValBinds :: XHsValBinds idL idR -> HsValBindsLR idL idR -> HsLocalBindsLR idL idR
+ Refact.Compat: HsVar :: XVar p -> Located (IdP p) -> HsExpr p
+ Refact.Compat: HsWC :: XHsWC pass thing -> thing -> HsWildCardBndrs pass thing
+ Refact.Compat: HsWildCardTy :: XWildCardTy pass -> HsType pass
+ Refact.Compat: HsWord64Prim :: XHsWord64Prim x -> Integer -> HsLit x
+ Refact.Compat: HsWordPrim :: XHsWordPrim x -> Integer -> HsLit x
+ Refact.Compat: HsWrap :: XWrap p -> HsWrapper -> HsExpr p -> HsExpr p
+ Refact.Compat: IEDoc :: XIEDoc pass -> HsDocString -> IE pass
+ Refact.Compat: IEDocNamed :: XIEDocNamed pass -> String -> IE pass
+ Refact.Compat: IEGroup :: XIEGroup pass -> Int -> HsDocString -> IE pass
+ Refact.Compat: IEModuleContents :: XIEModuleContents pass -> Located ModuleName -> IE pass
+ Refact.Compat: IEName :: Located name -> IEWrappedName name
+ Refact.Compat: IEPattern :: Located name -> IEWrappedName name
+ Refact.Compat: IEThingAbs :: XIEThingAbs pass -> LIEWrappedName (IdP pass) -> IE pass
+ Refact.Compat: IEThingAll :: XIEThingAll pass -> LIEWrappedName (IdP pass) -> IE pass
+ Refact.Compat: IEThingWith :: XIEThingWith pass -> LIEWrappedName (IdP pass) -> IEWildcard -> [LIEWrappedName (IdP pass)] -> [Located (FieldLbl (IdP pass))] -> IE pass
+ Refact.Compat: IEType :: Located name -> IEWrappedName name
+ Refact.Compat: IEVar :: XIEVar pass -> LIEWrappedName (IdP pass) -> IE pass
+ Refact.Compat: IEWildcard :: Int -> IEWildcard
+ Refact.Compat: IPBind :: XCIPBind id -> Either (Located HsIPName) (IdP id) -> LHsExpr id -> IPBind id
+ Refact.Compat: IPBinds :: XIPBinds id -> [LIPBind id] -> HsIPBinds id
+ Refact.Compat: IdSig :: XIdSig pass -> Id -> Sig pass
+ Refact.Compat: IfAlt :: HsMatchContext id
+ Refact.Compat: ImplicitBidirectional :: HsPatSynDir id
+ Refact.Compat: ImplicitSplice :: SpliceExplicitFlag
+ Refact.Compat: ImportDecl :: XCImportDecl pass -> SourceText -> Located ModuleName -> Maybe StringLiteral -> Bool -> Bool -> ImportDeclQualifiedStyle -> Bool -> Maybe (Located ModuleName) -> Maybe (Bool, Located [LIE pass]) -> ImportDecl pass
+ Refact.Compat: InfixCon :: arg -> arg -> HsConDetails arg rec
+ Refact.Compat: InjectivityAnn :: Located (IdP pass) -> [Located (IdP pass)] -> InjectivityAnn pass
+ Refact.Compat: InlineSig :: XInlineSig pass -> Located (IdP pass) -> InlinePragma -> Sig pass
+ Refact.Compat: InstD :: XInstD p -> InstDecl p -> HsDecl p
+ Refact.Compat: IsDefaultMethod :: TcSpecPrags
+ Refact.Compat: KindSig :: XCKindSig pass -> LHsKind pass -> FamilyResultSig pass
+ Refact.Compat: KindSigD :: XKindSigD p -> StandaloneKindSig p -> HsDecl p
+ Refact.Compat: KindedTyVar :: XKindedTyVar pass -> Located (IdP pass) -> LHsKind pass -> HsTyVarBndr pass
+ Refact.Compat: L :: l -> e -> GenLocated l e
+ Refact.Compat: LambdaExpr :: HsMatchContext id
+ Refact.Compat: LastStmt :: XLastStmt idL idR body -> body -> Bool -> SyntaxExpr idR -> StmtLR idL idR body
+ Refact.Compat: LetStmt :: XLetStmt idL idR body -> LHsLocalBindsLR idL idR -> StmtLR idL idR body
+ Refact.Compat: ListComp :: HsStmtContext id
+ Refact.Compat: ListPatTc :: Type -> Maybe (Type, SyntaxExpr GhcTc) -> ListPatTc
+ Refact.Compat: MDoExpr :: HsStmtContext id
+ Refact.Compat: MG :: XMG p body -> Located [LMatch p body] -> Origin -> MatchGroup p body
+ Refact.Compat: Match :: XCMatch p body -> HsMatchContext (NameOrRdrName (IdP p)) -> [LPat p] -> GRHSs p body -> Match p body
+ Refact.Compat: MatchGroupTc :: [Type] -> Type -> MatchGroupTc
+ Refact.Compat: MinimalSig :: XMinimalSig pass -> SourceText -> LBooleanFormula (Located (IdP pass)) -> Sig pass
+ Refact.Compat: Missing :: XMissing id -> HsTupArg id
+ Refact.Compat: ModuleAnnProvenance :: AnnProvenance name
+ Refact.Compat: MonadComp :: HsStmtContext id
+ Refact.Compat: NHsCoreTy :: Type -> NewHsTypeX
+ Refact.Compat: NPatBindTc :: NameSet -> Type -> NPatBindTc
+ Refact.Compat: NValBinds :: [(RecFlag, LHsBinds idL)] -> [LSig GhcRn] -> NHsValBindsLR idL
+ Refact.Compat: NegApp :: XNegApp p -> LHsExpr p -> SyntaxExpr p -> HsExpr p
+ Refact.Compat: NewType :: NewOrData
+ Refact.Compat: NewtypeStrategy :: DerivStrategy pass
+ Refact.Compat: NoExtField :: NoExtField
+ Refact.Compat: NoIEWildcard :: IEWildcard
+ Refact.Compat: NoParens :: SpliceDecoration
+ Refact.Compat: NoSig :: XNoSig pass -> FamilyResultSig pass
+ Refact.Compat: NoSourceText :: SourceText
+ Refact.Compat: NoSrcStrict :: SrcStrictness
+ Refact.Compat: NoSrcUnpack :: SrcUnpackedness
+ Refact.Compat: NotQualified :: ImportDeclQualifiedStyle
+ Refact.Compat: OpApp :: XOpApp p -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Refact.Compat: OpenTypeFamily :: FamilyInfo pass
+ Refact.Compat: Opt_AbstractRefHoleFits :: GeneralFlag
+ Refact.Compat: Opt_AlignmentSanitisation :: GeneralFlag
+ Refact.Compat: Opt_AsmShortcutting :: GeneralFlag
+ Refact.Compat: Opt_AutoLinkPackages :: GeneralFlag
+ Refact.Compat: Opt_AutoSccsOnIndividualCafs :: GeneralFlag
+ Refact.Compat: Opt_BreakOnError :: GeneralFlag
+ Refact.Compat: Opt_BreakOnException :: GeneralFlag
+ Refact.Compat: Opt_BuildDynamicToo :: GeneralFlag
+ Refact.Compat: Opt_BuildingCabalPackage :: GeneralFlag
+ Refact.Compat: Opt_ByteCode :: GeneralFlag
+ Refact.Compat: Opt_CSE :: GeneralFlag
+ Refact.Compat: Opt_CallArity :: GeneralFlag
+ Refact.Compat: Opt_CaseFolding :: GeneralFlag
+ Refact.Compat: Opt_CaseMerge :: GeneralFlag
+ Refact.Compat: Opt_CatchBottoms :: GeneralFlag
+ Refact.Compat: Opt_CfgBlocklayout :: GeneralFlag
+ Refact.Compat: Opt_CmmElimCommonBlocks :: GeneralFlag
+ Refact.Compat: Opt_CmmSink :: GeneralFlag
+ Refact.Compat: Opt_CprAnal :: GeneralFlag
+ Refact.Compat: Opt_CrossModuleSpecialise :: GeneralFlag
+ Refact.Compat: Opt_D_dump_minimal_imports :: GeneralFlag
+ Refact.Compat: Opt_D_faststring_stats :: GeneralFlag
+ Refact.Compat: Opt_DeferDiagnostics :: GeneralFlag
+ Refact.Compat: Opt_DeferOutOfScopeVariables :: GeneralFlag
+ Refact.Compat: Opt_DeferTypeErrors :: GeneralFlag
+ Refact.Compat: Opt_DeferTypedHoles :: GeneralFlag
+ Refact.Compat: Opt_DiagnosticsShowCaret :: GeneralFlag
+ Refact.Compat: Opt_DictsCheap :: GeneralFlag
+ Refact.Compat: Opt_DictsStrict :: GeneralFlag
+ Refact.Compat: Opt_DistrustAllPackages :: GeneralFlag
+ Refact.Compat: Opt_DmdTxDictSel :: GeneralFlag
+ Refact.Compat: Opt_DoAnnotationLinting :: GeneralFlag
+ Refact.Compat: Opt_DoAsmLinting :: GeneralFlag
+ Refact.Compat: Opt_DoCmmLinting :: GeneralFlag
+ Refact.Compat: Opt_DoCoreLinting :: GeneralFlag
+ Refact.Compat: Opt_DoEtaReduction :: GeneralFlag
+ Refact.Compat: Opt_DoLambdaEtaExpansion :: GeneralFlag
+ Refact.Compat: Opt_DoStgLinting :: GeneralFlag
+ Refact.Compat: Opt_DumpToFile :: GeneralFlag
+ Refact.Compat: Opt_EagerBlackHoling :: GeneralFlag
+ Refact.Compat: Opt_EmbedManifest :: GeneralFlag
+ Refact.Compat: Opt_EnableRewriteRules :: GeneralFlag
+ Refact.Compat: Opt_EnableThSpliceWarnings :: GeneralFlag
+ Refact.Compat: Opt_ErrorSpans :: GeneralFlag
+ Refact.Compat: Opt_ExcessPrecision :: GeneralFlag
+ Refact.Compat: Opt_Exitification :: GeneralFlag
+ Refact.Compat: Opt_ExposeAllUnfoldings :: GeneralFlag
+ Refact.Compat: Opt_ExternalDynamicRefs :: GeneralFlag
+ Refact.Compat: Opt_ExternalInterpreter :: GeneralFlag
+ Refact.Compat: Opt_FastLlvm :: GeneralFlag
+ Refact.Compat: Opt_FlatCache :: GeneralFlag
+ Refact.Compat: Opt_FloatIn :: GeneralFlag
+ Refact.Compat: Opt_ForceRecomp :: GeneralFlag
+ Refact.Compat: Opt_FullLaziness :: GeneralFlag
+ Refact.Compat: Opt_FunToThunk :: GeneralFlag
+ Refact.Compat: Opt_G_NoOptCoercion :: GeneralFlag
+ Refact.Compat: Opt_G_NoStateHack :: GeneralFlag
+ Refact.Compat: Opt_GenManifest :: GeneralFlag
+ Refact.Compat: Opt_GhciHistory :: GeneralFlag
+ Refact.Compat: Opt_GhciLeakCheck :: GeneralFlag
+ Refact.Compat: Opt_GhciSandbox :: GeneralFlag
+ Refact.Compat: Opt_Haddock :: GeneralFlag
+ Refact.Compat: Opt_HaddockOptions :: GeneralFlag
+ Refact.Compat: Opt_HelpfulErrors :: GeneralFlag
+ Refact.Compat: Opt_HexWordLiterals :: GeneralFlag
+ Refact.Compat: Opt_HideAllPackages :: GeneralFlag
+ Refact.Compat: Opt_HideAllPluginPackages :: GeneralFlag
+ Refact.Compat: Opt_HideSourcePaths :: GeneralFlag
+ Refact.Compat: Opt_Hpc :: GeneralFlag
+ Refact.Compat: Opt_IgnoreAsserts :: GeneralFlag
+ Refact.Compat: Opt_IgnoreDotGhci :: GeneralFlag
+ Refact.Compat: Opt_IgnoreHpcChanges :: GeneralFlag
+ Refact.Compat: Opt_IgnoreInterfacePragmas :: GeneralFlag
+ Refact.Compat: Opt_IgnoreOptimChanges :: GeneralFlag
+ Refact.Compat: Opt_ImplicitImportQualified :: GeneralFlag
+ Refact.Compat: Opt_IrrefutableTuples :: GeneralFlag
+ Refact.Compat: Opt_KeepCAFs :: GeneralFlag
+ Refact.Compat: Opt_KeepGoing :: GeneralFlag
+ Refact.Compat: Opt_KeepHcFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepHiDiffs :: GeneralFlag
+ Refact.Compat: Opt_KeepHiFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepHscppFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepLlvmFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepOFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepRawTokenStream :: GeneralFlag
+ Refact.Compat: Opt_KeepSFiles :: GeneralFlag
+ Refact.Compat: Opt_KeepTmpFiles :: GeneralFlag
+ Refact.Compat: Opt_KillAbsence :: GeneralFlag
+ Refact.Compat: Opt_KillOneShot :: GeneralFlag
+ Refact.Compat: Opt_LateDmdAnal :: GeneralFlag
+ Refact.Compat: Opt_LateSpecialise :: GeneralFlag
+ Refact.Compat: Opt_LiberateCase :: GeneralFlag
+ Refact.Compat: Opt_LlvmFillUndefWithGarbage :: GeneralFlag
+ Refact.Compat: Opt_LlvmTBAA :: GeneralFlag
+ Refact.Compat: Opt_LocalGhciHistory :: GeneralFlag
+ Refact.Compat: Opt_Loopification :: GeneralFlag
+ Refact.Compat: Opt_NoHsMain :: GeneralFlag
+ Refact.Compat: Opt_NoIt :: GeneralFlag
+ Refact.Compat: Opt_NoLlvmMangler :: GeneralFlag
+ Refact.Compat: Opt_NoTypeableBinds :: GeneralFlag
+ Refact.Compat: Opt_NumConstantFolding :: GeneralFlag
+ Refact.Compat: Opt_OmitInterfacePragmas :: GeneralFlag
+ Refact.Compat: Opt_OmitYields :: GeneralFlag
+ Refact.Compat: Opt_OptimalApplicativeDo :: GeneralFlag
+ Refact.Compat: Opt_PIC :: GeneralFlag
+ Refact.Compat: Opt_PICExecutable :: GeneralFlag
+ Refact.Compat: Opt_PIE :: GeneralFlag
+ Refact.Compat: Opt_PackageTrust :: GeneralFlag
+ Refact.Compat: Opt_PedanticBottoms :: GeneralFlag
+ Refact.Compat: Opt_PluginTrustworthy :: GeneralFlag
+ Refact.Compat: Opt_Pp :: GeneralFlag
+ Refact.Compat: Opt_PprCaseAsLet :: GeneralFlag
+ Refact.Compat: Opt_PprShowTicks :: GeneralFlag
+ Refact.Compat: Opt_PrintAxiomIncomps :: GeneralFlag
+ Refact.Compat: Opt_PrintBindContents :: GeneralFlag
+ Refact.Compat: Opt_PrintBindResult :: GeneralFlag
+ Refact.Compat: Opt_PrintEqualityRelations :: GeneralFlag
+ Refact.Compat: Opt_PrintEvldWithShow :: GeneralFlag
+ Refact.Compat: Opt_PrintExpandedSynonyms :: GeneralFlag
+ Refact.Compat: Opt_PrintExplicitCoercions :: GeneralFlag
+ Refact.Compat: Opt_PrintExplicitForalls :: GeneralFlag
+ Refact.Compat: Opt_PrintExplicitKinds :: GeneralFlag
+ Refact.Compat: Opt_PrintExplicitRuntimeReps :: GeneralFlag
+ Refact.Compat: Opt_PrintPotentialInstances :: GeneralFlag
+ Refact.Compat: Opt_PrintTypecheckerElaboration :: GeneralFlag
+ Refact.Compat: Opt_PrintUnicodeSyntax :: GeneralFlag
+ Refact.Compat: Opt_ProfCountEntries :: GeneralFlag
+ Refact.Compat: Opt_RPath :: GeneralFlag
+ Refact.Compat: Opt_RegsGraph :: GeneralFlag
+ Refact.Compat: Opt_RegsIterative :: GeneralFlag
+ Refact.Compat: Opt_RelativeDynlibPaths :: GeneralFlag
+ Refact.Compat: Opt_SccProfilingOn :: GeneralFlag
+ Refact.Compat: Opt_SharedImplib :: GeneralFlag
+ Refact.Compat: Opt_ShowDocsOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowHoleConstraints :: GeneralFlag
+ Refact.Compat: Opt_ShowLoadedModules :: GeneralFlag
+ Refact.Compat: Opt_ShowMatchesOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowProvOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowTypeAppOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowTypeAppVarsOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowTypeOfHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowValidHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ShowWarnGroups :: GeneralFlag
+ Refact.Compat: Opt_SimplPreInlining :: GeneralFlag
+ Refact.Compat: Opt_SingleLibFolder :: GeneralFlag
+ Refact.Compat: Opt_SolveConstantDicts :: GeneralFlag
+ Refact.Compat: Opt_SortBySizeHoleFits :: GeneralFlag
+ Refact.Compat: Opt_SortBySubsumHoleFits :: GeneralFlag
+ Refact.Compat: Opt_SortValidHoleFits :: GeneralFlag
+ Refact.Compat: Opt_SpecConstr :: GeneralFlag
+ Refact.Compat: Opt_SpecConstrKeen :: GeneralFlag
+ Refact.Compat: Opt_Specialise :: GeneralFlag
+ Refact.Compat: Opt_SpecialiseAggressively :: GeneralFlag
+ Refact.Compat: Opt_SplitSections :: GeneralFlag
+ Refact.Compat: Opt_StaticArgumentTransformation :: GeneralFlag
+ Refact.Compat: Opt_StgCSE :: GeneralFlag
+ Refact.Compat: Opt_StgLiftLams :: GeneralFlag
+ Refact.Compat: Opt_StgStats :: GeneralFlag
+ Refact.Compat: Opt_Strictness :: GeneralFlag
+ Refact.Compat: Opt_SuppressCoercions :: GeneralFlag
+ Refact.Compat: Opt_SuppressIdInfo :: GeneralFlag
+ Refact.Compat: Opt_SuppressModulePrefixes :: GeneralFlag
+ Refact.Compat: Opt_SuppressStgExts :: GeneralFlag
+ Refact.Compat: Opt_SuppressTicks :: GeneralFlag
+ Refact.Compat: Opt_SuppressTimestamps :: GeneralFlag
+ Refact.Compat: Opt_SuppressTypeApplications :: GeneralFlag
+ Refact.Compat: Opt_SuppressTypeSignatures :: GeneralFlag
+ Refact.Compat: Opt_SuppressUnfoldings :: GeneralFlag
+ Refact.Compat: Opt_SuppressUniques :: GeneralFlag
+ Refact.Compat: Opt_SuppressVarKinds :: GeneralFlag
+ Refact.Compat: Opt_Ticky :: GeneralFlag
+ Refact.Compat: Opt_Ticky_Allocd :: GeneralFlag
+ Refact.Compat: Opt_Ticky_Dyn_Thunk :: GeneralFlag
+ Refact.Compat: Opt_Ticky_LNE :: GeneralFlag
+ Refact.Compat: Opt_UnboxSmallStrictFields :: GeneralFlag
+ Refact.Compat: Opt_UnboxStrictFields :: GeneralFlag
+ Refact.Compat: Opt_UnclutterValidHoleFits :: GeneralFlag
+ Refact.Compat: Opt_ValidateHie :: GeneralFlag
+ Refact.Compat: Opt_VersionMacros :: GeneralFlag
+ Refact.Compat: Opt_WarnIsError :: GeneralFlag
+ Refact.Compat: Opt_WeightlessBlocklayout :: GeneralFlag
+ Refact.Compat: Opt_WholeArchiveHsLibs :: GeneralFlag
+ Refact.Compat: Opt_WorkerWrapper :: GeneralFlag
+ Refact.Compat: Opt_WriteHie :: GeneralFlag
+ Refact.Compat: Opt_WriteInterface :: GeneralFlag
+ Refact.Compat: Orig :: Module -> OccName -> RdrName
+ Refact.Compat: OutOfScope :: OccName -> GlobalRdrEnv -> UnboundVar
+ Refact.Compat: OverLit :: XOverLit p -> OverLitVal -> HsExpr p -> HsOverLit p
+ Refact.Compat: OverLitTc :: Bool -> Type -> OverLitTc
+ Refact.Compat: PSB :: XPSB idL idR -> Located (IdP idL) -> HsPatSynDetails (Located (IdP idR)) -> LPat idR -> HsPatSynDir idR -> PatSynBind idL idR
+ Refact.Compat: ParStmt :: XParStmt idL idR body -> [ParStmtBlock idL idR] -> HsExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Refact.Compat: ParStmtBlock :: XParStmtBlock idL idR -> [ExprLStmt idL] -> [IdP idR] -> SyntaxExpr idR -> ParStmtBlock idL idR
+ Refact.Compat: ParStmtCtxt :: HsStmtContext id -> HsStmtContext id
+ Refact.Compat: Parsed :: Pass
+ Refact.Compat: PatBind :: XPatBind idL idR -> LPat idL -> GRHSs idR (LHsExpr idR) -> ([Tickish Id], [[Tickish Id]]) -> HsBindLR idL idR
+ Refact.Compat: PatBindGuards :: HsMatchContext id
+ Refact.Compat: PatBindRhs :: HsMatchContext id
+ Refact.Compat: PatBr :: XPatBr p -> LPat p -> HsBracket p
+ Refact.Compat: PatGuard :: HsMatchContext id -> HsStmtContext id
+ Refact.Compat: PatSyn :: HsMatchContext id
+ Refact.Compat: PatSynBind :: XPatSynBind idL idR -> PatSynBind idL idR -> HsBindLR idL idR
+ Refact.Compat: PatSynSig :: XPatSynSig pass -> [Located (IdP pass)] -> LHsSigType pass -> Sig pass
+ Refact.Compat: PendingRnSplice :: UntypedSpliceFlavour -> SplicePointName -> LHsExpr GhcRn -> PendingRnSplice
+ Refact.Compat: PendingTcSplice :: SplicePointName -> LHsExpr GhcTc -> PendingTcSplice
+ Refact.Compat: PrefixCon :: [arg] -> HsConDetails arg rec
+ Refact.Compat: Present :: XPresent id -> LHsExpr id -> HsTupArg id
+ Refact.Compat: ProcExpr :: HsMatchContext id
+ Refact.Compat: Qual :: ModuleName -> OccName -> RdrName
+ Refact.Compat: QualifiedPost :: ImportDeclQualifiedStyle
+ Refact.Compat: QualifiedPre :: ImportDeclQualifiedStyle
+ Refact.Compat: RecCon :: rec -> HsConDetails arg rec
+ Refact.Compat: RecStmt :: XRecStmt idL idR body -> [LStmtLR idL idR body] -> [IdP idR] -> [IdP idR] -> SyntaxExpr idR -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Refact.Compat: RecStmtTc :: Type -> [PostTcExpr] -> [PostTcExpr] -> Type -> RecStmtTc
+ Refact.Compat: RecUpd :: HsMatchContext id
+ Refact.Compat: RecordCon :: XRecordCon p -> Located (IdP p) -> HsRecordBinds p -> HsExpr p
+ Refact.Compat: RecordConTc :: ConLike -> PostTcExpr -> RecordConTc
+ Refact.Compat: RecordPatSynField :: a -> a -> RecordPatSynField a
+ Refact.Compat: RecordUpd :: XRecordUpd p -> LHsExpr p -> [LHsRecUpdField p] -> HsExpr p
+ Refact.Compat: RecordUpdTc :: [ConLike] -> [Type] -> [Type] -> HsWrapper -> RecordUpdTc
+ Refact.Compat: Renamed :: Pass
+ Refact.Compat: RoleAnnotD :: XRoleAnnotD p -> RoleAnnotDecl p -> HsDecl p
+ Refact.Compat: RoleAnnotDecl :: XCRoleAnnotDecl pass -> Located (IdP pass) -> [Located (Maybe Role)] -> RoleAnnotDecl pass
+ Refact.Compat: RuleBndr :: XCRuleBndr pass -> Located (IdP pass) -> RuleBndr pass
+ Refact.Compat: RuleBndrSig :: XRuleBndrSig pass -> Located (IdP pass) -> LHsSigWcType pass -> RuleBndr pass
+ Refact.Compat: RuleD :: XRuleD p -> RuleDecls p -> HsDecl p
+ Refact.Compat: SCCFunSig :: XSCCFunSig pass -> SourceText -> Located (IdP pass) -> Maybe (Located StringLiteral) -> Sig pass
+ Refact.Compat: SectionL :: XSectionL p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Refact.Compat: SectionR :: XSectionR p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Refact.Compat: SigD :: XSigD p -> Sig p -> HsDecl p
+ Refact.Compat: SourceText :: String -> SourceText
+ Refact.Compat: SpecInstSig :: XSpecInstSig pass -> SourceText -> LHsSigType pass -> Sig pass
+ Refact.Compat: SpecPrag :: Id -> HsWrapper -> InlinePragma -> TcSpecPrag
+ Refact.Compat: SpecPrags :: [LTcSpecPrag] -> TcSpecPrags
+ Refact.Compat: SpecSig :: XSpecSig pass -> Located (IdP pass) -> [LHsSigType pass] -> InlinePragma -> Sig pass
+ Refact.Compat: SpliceD :: XSpliceD p -> SpliceDecl p -> HsDecl p
+ Refact.Compat: SpliceDecl :: XSpliceDecl p -> Located (HsSplice p) -> SpliceExplicitFlag -> SpliceDecl p
+ Refact.Compat: SrcLazy :: SrcStrictness
+ Refact.Compat: SrcNoUnpack :: SrcUnpackedness
+ Refact.Compat: SrcStrict :: SrcStrictness
+ Refact.Compat: SrcUnpack :: SrcUnpackedness
+ Refact.Compat: StandaloneKindSig :: XStandaloneKindSig pass -> Located (IdP pass) -> LHsSigType pass -> StandaloneKindSig pass
+ Refact.Compat: StmtCtxt :: HsStmtContext id -> HsMatchContext id
+ Refact.Compat: StockStrategy :: DerivStrategy pass
+ Refact.Compat: SynDecl :: XSynDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LHsType pass -> TyClDecl pass
+ Refact.Compat: SyntaxExpr :: HsExpr p -> [HsWrapper] -> HsWrapper -> SyntaxExpr p
+ Refact.Compat: TExpBr :: XTExpBr p -> LHsExpr p -> HsBracket p
+ Refact.Compat: ThModFinalizers :: [ForeignRef (Q ())] -> ThModFinalizers
+ Refact.Compat: ThPatQuote :: HsMatchContext id
+ Refact.Compat: ThPatSplice :: HsMatchContext id
+ Refact.Compat: ThenForm :: TransForm
+ Refact.Compat: TransStmt :: XTransStmt idL idR body -> TransForm -> [ExprLStmt idL] -> [(IdP idR, IdP idR)] -> LHsExpr idR -> Maybe (LHsExpr idR) -> SyntaxExpr idR -> SyntaxExpr idR -> HsExpr idR -> StmtLR idL idR body
+ Refact.Compat: TransStmtCtxt :: HsStmtContext id -> HsStmtContext id
+ Refact.Compat: TrueExprHole :: OccName -> UnboundVar
+ Refact.Compat: TyClD :: XTyClD p -> TyClDecl p -> HsDecl p
+ Refact.Compat: TyClGroup :: XCTyClGroup pass -> [LTyClDecl pass] -> [LRoleAnnotDecl pass] -> [LStandaloneKindSig pass] -> [LInstDecl pass] -> TyClGroup pass
+ Refact.Compat: TyFamInstD :: XTyFamInstD pass -> TyFamInstDecl pass -> InstDecl pass
+ Refact.Compat: TyFamInstDecl :: TyFamInstEqn pass -> TyFamInstDecl pass
+ Refact.Compat: TyVarSig :: XTyVarSig pass -> LHsTyVarBndr pass -> FamilyResultSig pass
+ Refact.Compat: TypBr :: XTypBr p -> LHsType p -> HsBracket p
+ Refact.Compat: TypeAnnProvenance :: Located name -> AnnProvenance name
+ Refact.Compat: TypeSig :: XTypeSig pass -> [Located (IdP pass)] -> LHsSigWcType pass -> Sig pass
+ Refact.Compat: Typechecked :: Pass
+ Refact.Compat: Unambiguous :: XUnambiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
+ Refact.Compat: Unidirectional :: HsPatSynDir id
+ Refact.Compat: Unqual :: OccName -> RdrName
+ Refact.Compat: UntypedDeclSplice :: UntypedSpliceFlavour
+ Refact.Compat: UntypedExpSplice :: UntypedSpliceFlavour
+ Refact.Compat: UntypedPatSplice :: UntypedSpliceFlavour
+ Refact.Compat: UntypedTypeSplice :: UntypedSpliceFlavour
+ Refact.Compat: UserTyVar :: XUserTyVar pass -> Located (IdP pass) -> HsTyVarBndr pass
+ Refact.Compat: ValBinds :: XValBinds idL idR -> LHsBindsLR idL idR -> [LSig idR] -> HsValBindsLR idL idR
+ Refact.Compat: ValD :: XValD p -> HsBind p -> HsDecl p
+ Refact.Compat: ValueAnnProvenance :: Located name -> AnnProvenance name
+ Refact.Compat: VarBind :: XVarBind idL idR -> IdP idL -> LHsExpr idR -> Bool -> HsBindLR idL idR
+ Refact.Compat: VarBr :: XVarBr p -> Bool -> IdP p -> HsBracket p
+ Refact.Compat: ViaStrategy :: XViaStrategy pass -> DerivStrategy pass
+ Refact.Compat: Warning :: XWarning pass -> [Located (IdP pass)] -> WarningTxt -> WarnDecl pass
+ Refact.Compat: WarningD :: XWarningD p -> WarnDecls p -> HsDecl p
+ Refact.Compat: Warnings :: XWarnings pass -> SourceText -> [LWarnDecl pass] -> WarnDecls pass
+ Refact.Compat: XABExport :: XXABExport p -> ABExport p
+ Refact.Compat: XAmbiguousFieldOcc :: XXAmbiguousFieldOcc pass -> AmbiguousFieldOcc pass
+ Refact.Compat: XAnnDecl :: XXAnnDecl pass -> AnnDecl pass
+ Refact.Compat: XApplicativeArg :: XXApplicativeArg idL -> ApplicativeArg idL
+ Refact.Compat: XBracket :: XXBracket p -> HsBracket p
+ Refact.Compat: XClsInstDecl :: XXClsInstDecl pass -> ClsInstDecl pass
+ Refact.Compat: XCmd :: XXCmd id -> HsCmd id
+ Refact.Compat: XCmdTop :: XXCmdTop p -> HsCmdTop p
+ Refact.Compat: XConDecl :: XXConDecl pass -> ConDecl pass
+ Refact.Compat: XConDeclField :: XXConDeclField pass -> ConDeclField pass
+ Refact.Compat: XDefaultDecl :: XXDefaultDecl pass -> DefaultDecl pass
+ Refact.Compat: XDerivDecl :: XXDerivDecl pass -> DerivDecl pass
+ Refact.Compat: XExpr :: XXExpr p -> HsExpr p
+ Refact.Compat: XFamEqn :: XXFamEqn pass rhs -> FamEqn pass rhs
+ Refact.Compat: XFamilyDecl :: XXFamilyDecl pass -> FamilyDecl pass
+ Refact.Compat: XFamilyResultSig :: XXFamilyResultSig pass -> FamilyResultSig pass
+ Refact.Compat: XFieldOcc :: XXFieldOcc pass -> FieldOcc pass
+ Refact.Compat: XFixitySig :: XXFixitySig pass -> FixitySig pass
+ Refact.Compat: XForeignDecl :: XXForeignDecl pass -> ForeignDecl pass
+ Refact.Compat: XGRHS :: XXGRHS p body -> GRHS p body
+ Refact.Compat: XGRHSs :: XXGRHSs p body -> GRHSs p body
+ Refact.Compat: XHsBindsLR :: XXHsBindsLR idL idR -> HsBindLR idL idR
+ Refact.Compat: XHsDataDefn :: XXHsDataDefn pass -> HsDataDefn pass
+ Refact.Compat: XHsDecl :: XXHsDecl p -> HsDecl p
+ Refact.Compat: XHsDerivingClause :: XXHsDerivingClause pass -> HsDerivingClause pass
+ Refact.Compat: XHsGroup :: XXHsGroup p -> HsGroup p
+ Refact.Compat: XHsIPBinds :: XXHsIPBinds id -> HsIPBinds id
+ Refact.Compat: XHsImplicitBndrs :: XXHsImplicitBndrs pass thing -> HsImplicitBndrs pass thing
+ Refact.Compat: XHsLocalBindsLR :: XXHsLocalBindsLR idL idR -> HsLocalBindsLR idL idR
+ Refact.Compat: XHsType :: XXType pass -> HsType pass
+ Refact.Compat: XHsWildCardBndrs :: XXHsWildCardBndrs pass thing -> HsWildCardBndrs pass thing
+ Refact.Compat: XIE :: XXIE pass -> IE pass
+ Refact.Compat: XIPBind :: XXIPBind id -> IPBind id
+ Refact.Compat: XImportDecl :: XXImportDecl pass -> ImportDecl pass
+ Refact.Compat: XInstDecl :: XXInstDecl pass -> InstDecl pass
+ Refact.Compat: XLHsQTyVars :: XXLHsQTyVars pass -> LHsQTyVars pass
+ Refact.Compat: XLit :: XXLit x -> HsLit x
+ Refact.Compat: XMatch :: XXMatch p body -> Match p body
+ Refact.Compat: XMatchGroup :: XXMatchGroup p body -> MatchGroup p body
+ Refact.Compat: XOverLit :: XXOverLit p -> HsOverLit p
+ Refact.Compat: XParStmtBlock :: XXParStmtBlock idL idR -> ParStmtBlock idL idR
+ Refact.Compat: XPatSynBind :: XXPatSynBind idL idR -> PatSynBind idL idR
+ Refact.Compat: XRoleAnnotDecl :: XXRoleAnnotDecl pass -> RoleAnnotDecl pass
+ Refact.Compat: XRuleBndr :: XXRuleBndr pass -> RuleBndr pass
+ Refact.Compat: XRuleDecl :: XXRuleDecl pass -> RuleDecl pass
+ Refact.Compat: XRuleDecls :: XXRuleDecls pass -> RuleDecls pass
+ Refact.Compat: XSig :: XXSig pass -> Sig pass
+ Refact.Compat: XSplice :: XXSplice id -> HsSplice id
+ Refact.Compat: XSpliceDecl :: XXSpliceDecl p -> SpliceDecl p
+ Refact.Compat: XStandaloneKindSig :: XXStandaloneKindSig pass -> StandaloneKindSig pass
+ Refact.Compat: XStmtLR :: XXStmtLR idL idR body -> StmtLR idL idR body
+ Refact.Compat: XTupArg :: XXTupArg id -> HsTupArg id
+ Refact.Compat: XTyClDecl :: XXTyClDecl pass -> TyClDecl pass
+ Refact.Compat: XTyClGroup :: XXTyClGroup pass -> TyClGroup pass
+ Refact.Compat: XTyVarBndr :: XXTyVarBndr pass -> HsTyVarBndr pass
+ Refact.Compat: XValBindsLR :: XXValBindsLR idL idR -> HsValBindsLR idL idR
+ Refact.Compat: XWarnDecl :: XXWarnDecl pass -> WarnDecl pass
+ Refact.Compat: XWarnDecls :: XXWarnDecls pass -> WarnDecls pass
+ Refact.Compat: [abe_ext] :: ABExport p -> XABE p
+ Refact.Compat: [abe_mono] :: ABExport p -> IdP p
+ Refact.Compat: [abe_poly] :: ABExport p -> IdP p
+ Refact.Compat: [abe_prags] :: ABExport p -> TcSpecPrags
+ Refact.Compat: [abe_wrap] :: ABExport p -> HsWrapper
+ Refact.Compat: [abs_binds] :: HsBindLR idL idR -> LHsBinds idL
+ Refact.Compat: [abs_ev_binds] :: HsBindLR idL idR -> [TcEvBinds]
+ Refact.Compat: [abs_ev_vars] :: HsBindLR idL idR -> [EvVar]
+ Refact.Compat: [abs_exports] :: HsBindLR idL idR -> [ABExport idL]
+ Refact.Compat: [abs_ext] :: HsBindLR idL idR -> XAbsBinds idL idR
+ Refact.Compat: [abs_sig] :: HsBindLR idL idR -> Bool
+ Refact.Compat: [abs_tvs] :: HsBindLR idL idR -> [TyVar]
+ Refact.Compat: [app_arg_pattern] :: ApplicativeArg idL -> LPat idL
+ Refact.Compat: [app_stmts] :: ApplicativeArg idL -> [ExprLStmt idL]
+ Refact.Compat: [arg_expr] :: ApplicativeArg idL -> LHsExpr idL
+ Refact.Compat: [bv_pattern] :: ApplicativeArg idL -> LPat idL
+ Refact.Compat: [cd_fld_doc] :: ConDeclField pass -> Maybe LHsDocString
+ Refact.Compat: [cd_fld_ext] :: ConDeclField pass -> XConDeclField pass
+ Refact.Compat: [cd_fld_names] :: ConDeclField pass -> [LFieldOcc pass]
+ Refact.Compat: [cd_fld_type] :: ConDeclField pass -> LBangType pass
+ Refact.Compat: [cid_binds] :: ClsInstDecl pass -> LHsBinds pass
+ Refact.Compat: [cid_d_ext] :: InstDecl pass -> XClsInstD pass
+ Refact.Compat: [cid_datafam_insts] :: ClsInstDecl pass -> [LDataFamInstDecl pass]
+ Refact.Compat: [cid_ext] :: ClsInstDecl pass -> XCClsInstDecl pass
+ Refact.Compat: [cid_inst] :: InstDecl pass -> ClsInstDecl pass
+ Refact.Compat: [cid_overlap_mode] :: ClsInstDecl pass -> Maybe (Located OverlapMode)
+ Refact.Compat: [cid_poly_ty] :: ClsInstDecl pass -> LHsSigType pass
+ Refact.Compat: [cid_sigs] :: ClsInstDecl pass -> [LSig pass]
+ Refact.Compat: [cid_tyfam_insts] :: ClsInstDecl pass -> [LTyFamInstDecl pass]
+ Refact.Compat: [con_args] :: ConDecl pass -> HsConDeclDetails pass
+ Refact.Compat: [con_doc] :: ConDecl pass -> Maybe LHsDocString
+ Refact.Compat: [con_ex_tvs] :: ConDecl pass -> [LHsTyVarBndr pass]
+ Refact.Compat: [con_ext] :: ConDecl pass -> XConDeclH98 pass
+ Refact.Compat: [con_forall] :: ConDecl pass -> Located Bool
+ Refact.Compat: [con_g_ext] :: ConDecl pass -> XConDeclGADT pass
+ Refact.Compat: [con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)
+ Refact.Compat: [con_name] :: ConDecl pass -> Located (IdP pass)
+ Refact.Compat: [con_names] :: ConDecl pass -> [Located (IdP pass)]
+ Refact.Compat: [con_qvars] :: ConDecl pass -> LHsQTyVars pass
+ Refact.Compat: [con_res_ty] :: ConDecl pass -> LHsType pass
+ Refact.Compat: [dd_ND] :: HsDataDefn pass -> NewOrData
+ Refact.Compat: [dd_cType] :: HsDataDefn pass -> Maybe (Located CType)
+ Refact.Compat: [dd_cons] :: HsDataDefn pass -> [LConDecl pass]
+ Refact.Compat: [dd_ctxt] :: HsDataDefn pass -> LHsContext pass
+ Refact.Compat: [dd_derivs] :: HsDataDefn pass -> HsDeriving pass
+ Refact.Compat: [dd_ext] :: HsDataDefn pass -> XCHsDataDefn pass
+ Refact.Compat: [dd_kindSig] :: HsDataDefn pass -> Maybe (LHsKind pass)
+ Refact.Compat: [deriv_clause_ext] :: HsDerivingClause pass -> XCHsDerivingClause pass
+ Refact.Compat: [deriv_clause_strategy] :: HsDerivingClause pass -> Maybe (LDerivStrategy pass)
+ Refact.Compat: [deriv_clause_tys] :: HsDerivingClause pass -> Located [LHsSigType pass]
+ Refact.Compat: [deriv_ext] :: DerivDecl pass -> XCDerivDecl pass
+ Refact.Compat: [deriv_overlap_mode] :: DerivDecl pass -> Maybe (Located OverlapMode)
+ Refact.Compat: [deriv_strategy] :: DerivDecl pass -> Maybe (LDerivStrategy pass)
+ Refact.Compat: [deriv_type] :: DerivDecl pass -> LHsSigWcType pass
+ Refact.Compat: [dfid_eqn] :: DataFamInstDecl pass -> FamInstEqn pass (HsDataDefn pass)
+ Refact.Compat: [dfid_ext] :: InstDecl pass -> XDataFamInstD pass
+ Refact.Compat: [dfid_inst] :: InstDecl pass -> DataFamInstDecl pass
+ Refact.Compat: [extFieldOcc] :: FieldOcc pass -> XCFieldOcc pass
+ Refact.Compat: [fail_operator] :: ApplicativeArg idL -> SyntaxExpr idL
+ Refact.Compat: [fdExt] :: FamilyDecl pass -> XCFamilyDecl pass
+ Refact.Compat: [fdFixity] :: FamilyDecl pass -> LexicalFixity
+ Refact.Compat: [fdInfo] :: FamilyDecl pass -> FamilyInfo pass
+ Refact.Compat: [fdInjectivityAnn] :: FamilyDecl pass -> Maybe (LInjectivityAnn pass)
+ Refact.Compat: [fdLName] :: FamilyDecl pass -> Located (IdP pass)
+ Refact.Compat: [fdResultSig] :: FamilyDecl pass -> LFamilyResultSig pass
+ Refact.Compat: [fdTyVars] :: FamilyDecl pass -> LHsQTyVars pass
+ Refact.Compat: [fd_e_ext] :: ForeignDecl pass -> XForeignExport pass
+ Refact.Compat: [fd_fe] :: ForeignDecl pass -> ForeignExport
+ Refact.Compat: [fd_fi] :: ForeignDecl pass -> ForeignImport
+ Refact.Compat: [fd_i_ext] :: ForeignDecl pass -> XForeignImport pass
+ Refact.Compat: [fd_name] :: ForeignDecl pass -> Located (IdP pass)
+ Refact.Compat: [fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
+ Refact.Compat: [feqn_bndrs] :: FamEqn pass rhs -> Maybe [LHsTyVarBndr pass]
+ Refact.Compat: [feqn_ext] :: FamEqn pass rhs -> XCFamEqn pass rhs
+ Refact.Compat: [feqn_fixity] :: FamEqn pass rhs -> LexicalFixity
+ Refact.Compat: [feqn_pats] :: FamEqn pass rhs -> HsTyPats pass
+ Refact.Compat: [feqn_rhs] :: FamEqn pass rhs -> rhs
+ Refact.Compat: [feqn_tycon] :: FamEqn pass rhs -> Located (IdP pass)
+ Refact.Compat: [final_expr] :: ApplicativeArg idL -> HsExpr idL
+ Refact.Compat: [flagSpecAction] :: FlagSpec flag -> TurnOnFlag -> DynP ()
+ Refact.Compat: [flagSpecFlag] :: FlagSpec flag -> flag
+ Refact.Compat: [flagSpecGhcMode] :: FlagSpec flag -> GhcFlagMode
+ Refact.Compat: [flagSpecName] :: FlagSpec flag -> String
+ Refact.Compat: [fun_co_fn] :: HsBindLR idL idR -> HsWrapper
+ Refact.Compat: [fun_ext] :: HsBindLR idL idR -> XFunBind idL idR
+ Refact.Compat: [fun_id] :: HsBindLR idL idR -> Located (IdP idL)
+ Refact.Compat: [fun_matches] :: HsBindLR idL idR -> MatchGroup idR (LHsExpr idR)
+ Refact.Compat: [fun_tick] :: HsBindLR idL idR -> [Tickish Id]
+ Refact.Compat: [grhssExt] :: GRHSs p body -> XCGRHSs p body
+ Refact.Compat: [grhssGRHSs] :: GRHSs p body -> [LGRHS p body]
+ Refact.Compat: [grhssLocalBinds] :: GRHSs p body -> LHsLocalBinds p
+ Refact.Compat: [group_ext] :: TyClGroup pass -> XCTyClGroup pass
+ Refact.Compat: [group_instds] :: TyClGroup pass -> [LInstDecl pass]
+ Refact.Compat: [group_kisigs] :: TyClGroup pass -> [LStandaloneKindSig pass]
+ Refact.Compat: [group_roles] :: TyClGroup pass -> [LRoleAnnotDecl pass]
+ Refact.Compat: [group_tyclds] :: TyClGroup pass -> [LTyClDecl pass]
+ Refact.Compat: [hsRecFieldArg] :: HsRecField' id arg -> arg
+ Refact.Compat: [hsRecFieldLbl] :: HsRecField' id arg -> Located id
+ Refact.Compat: [hsRecPun] :: HsRecField' id arg -> Bool
+ Refact.Compat: [hs_annds] :: HsGroup p -> [LAnnDecl p]
+ Refact.Compat: [hs_defds] :: HsGroup p -> [LDefaultDecl p]
+ Refact.Compat: [hs_derivds] :: HsGroup p -> [LDerivDecl p]
+ Refact.Compat: [hs_docs] :: HsGroup p -> [LDocDecl]
+ Refact.Compat: [hs_ext] :: HsGroup p -> XCHsGroup p
+ Refact.Compat: [hs_fixds] :: HsGroup p -> [LFixitySig p]
+ Refact.Compat: [hs_fords] :: HsGroup p -> [LForeignDecl p]
+ Refact.Compat: [hs_ruleds] :: HsGroup p -> [LRuleDecls p]
+ Refact.Compat: [hs_splcds] :: HsGroup p -> [LSpliceDecl p]
+ Refact.Compat: [hs_tyclds] :: HsGroup p -> [TyClGroup p]
+ Refact.Compat: [hs_valds] :: HsGroup p -> HsValBinds p
+ Refact.Compat: [hs_warnds] :: HsGroup p -> [LWarnDecls p]
+ Refact.Compat: [hsib_body] :: HsImplicitBndrs pass thing -> thing
+ Refact.Compat: [hsib_ext] :: HsImplicitBndrs pass thing -> XHsIB pass thing
+ Refact.Compat: [hsmodDecls] :: HsModule pass -> [LHsDecl pass]
+ Refact.Compat: [hsmodDeprecMessage] :: HsModule pass -> Maybe (Located WarningTxt)
+ Refact.Compat: [hsmodExports] :: HsModule pass -> Maybe (Located [LIE pass])
+ Refact.Compat: [hsmodHaddockModHeader] :: HsModule pass -> Maybe LHsDocString
+ Refact.Compat: [hsmodImports] :: HsModule pass -> [LImportDecl pass]
+ Refact.Compat: [hsmodName] :: HsModule pass -> Maybe (Located ModuleName)
+ Refact.Compat: [hsq_explicit] :: LHsQTyVars pass -> [LHsTyVarBndr pass]
+ Refact.Compat: [hsq_ext] :: LHsQTyVars pass -> XHsQTvs pass
+ Refact.Compat: [hst_bndrs] :: HsType pass -> [LHsTyVarBndr pass]
+ Refact.Compat: [hst_body] :: HsType pass -> LHsType pass
+ Refact.Compat: [hst_ctxt] :: HsType pass -> LHsContext pass
+ Refact.Compat: [hst_fvf] :: HsType pass -> ForallVisFlag
+ Refact.Compat: [hst_xforall] :: HsType pass -> XForAllTy pass
+ Refact.Compat: [hst_xqual] :: HsType pass -> XQualTy pass
+ Refact.Compat: [hswc_body] :: HsWildCardBndrs pass thing -> thing
+ Refact.Compat: [hswc_ext] :: HsWildCardBndrs pass thing -> XHsWC pass thing
+ Refact.Compat: [ideclAs] :: ImportDecl pass -> Maybe (Located ModuleName)
+ Refact.Compat: [ideclExt] :: ImportDecl pass -> XCImportDecl pass
+ Refact.Compat: [ideclHiding] :: ImportDecl pass -> Maybe (Bool, Located [LIE pass])
+ Refact.Compat: [ideclImplicit] :: ImportDecl pass -> Bool
+ Refact.Compat: [ideclName] :: ImportDecl pass -> Located ModuleName
+ Refact.Compat: [ideclPkgQual] :: ImportDecl pass -> Maybe StringLiteral
+ Refact.Compat: [ideclQualified] :: ImportDecl pass -> ImportDeclQualifiedStyle
+ Refact.Compat: [ideclSafe] :: ImportDecl pass -> Bool
+ Refact.Compat: [ideclSourceSrc] :: ImportDecl pass -> SourceText
+ Refact.Compat: [ideclSource] :: ImportDecl pass -> Bool
+ Refact.Compat: [is_body_stmt] :: ApplicativeArg idL -> Bool
+ Refact.Compat: [m_ctxt] :: Match p body -> HsMatchContext (NameOrRdrName (IdP p))
+ Refact.Compat: [m_ext] :: Match p body -> XCMatch p body
+ Refact.Compat: [m_grhss] :: Match p body -> GRHSs p body
+ Refact.Compat: [m_pats] :: Match p body -> [LPat p]
+ Refact.Compat: [mc_fixity] :: HsMatchContext id -> LexicalFixity
+ Refact.Compat: [mc_fun] :: HsMatchContext id -> Located id
+ Refact.Compat: [mc_strictness] :: HsMatchContext id -> SrcStrictness
+ Refact.Compat: [mg_alts] :: MatchGroup p body -> Located [LMatch p body]
+ Refact.Compat: [mg_arg_tys] :: MatchGroupTc -> [Type]
+ Refact.Compat: [mg_ext] :: MatchGroup p body -> XMG p body
+ Refact.Compat: [mg_origin] :: MatchGroup p body -> Origin
+ Refact.Compat: [mg_res_ty] :: MatchGroupTc -> Type
+ Refact.Compat: [ol_ext] :: HsOverLit p -> XOverLit p
+ Refact.Compat: [ol_rebindable] :: OverLitTc -> Bool
+ Refact.Compat: [ol_type] :: OverLitTc -> Type
+ Refact.Compat: [ol_val] :: HsOverLit p -> OverLitVal
+ Refact.Compat: [ol_witness] :: HsOverLit p -> HsExpr p
+ Refact.Compat: [pat_ext] :: HsBindLR idL idR -> XPatBind idL idR
+ Refact.Compat: [pat_fvs] :: NPatBindTc -> NameSet
+ Refact.Compat: [pat_lhs] :: HsBindLR idL idR -> LPat idL
+ Refact.Compat: [pat_rhs] :: HsBindLR idL idR -> GRHSs idR (LHsExpr idR)
+ Refact.Compat: [pat_rhs_ty] :: NPatBindTc -> Type
+ Refact.Compat: [pat_ticks] :: HsBindLR idL idR -> ([Tickish Id], [[Tickish Id]])
+ Refact.Compat: [psb_args] :: PatSynBind idL idR -> HsPatSynDetails (Located (IdP idR))
+ Refact.Compat: [psb_def] :: PatSynBind idL idR -> LPat idR
+ Refact.Compat: [psb_dir] :: PatSynBind idL idR -> HsPatSynDir idR
+ Refact.Compat: [psb_ext] :: PatSynBind idL idR -> XPSB idL idR
+ Refact.Compat: [psb_id] :: PatSynBind idL idR -> Located (IdP idL)
+ Refact.Compat: [rcon_con_expr] :: RecordConTc -> PostTcExpr
+ Refact.Compat: [rcon_con_like] :: RecordConTc -> ConLike
+ Refact.Compat: [rcon_con_name] :: HsExpr p -> Located (IdP p)
+ Refact.Compat: [rcon_ext] :: HsExpr p -> XRecordCon p
+ Refact.Compat: [rcon_flds] :: HsExpr p -> HsRecordBinds p
+ Refact.Compat: [rd_act] :: RuleDecl pass -> Activation
+ Refact.Compat: [rd_ext] :: RuleDecl pass -> XHsRule pass
+ Refact.Compat: [rd_lhs] :: RuleDecl pass -> Located (HsExpr pass)
+ Refact.Compat: [rd_name] :: RuleDecl pass -> Located (SourceText, RuleName)
+ Refact.Compat: [rd_rhs] :: RuleDecl pass -> Located (HsExpr pass)
+ Refact.Compat: [rd_tmvs] :: RuleDecl pass -> [LRuleBndr pass]
+ Refact.Compat: [rd_tyvs] :: RuleDecl pass -> Maybe [LHsTyVarBndr (NoGhcTc pass)]
+ Refact.Compat: [rdrNameFieldOcc] :: FieldOcc pass -> Located RdrName
+ Refact.Compat: [rds_ext] :: RuleDecls pass -> XCRuleDecls pass
+ Refact.Compat: [rds_rules] :: RuleDecls pass -> [LRuleDecl pass]
+ Refact.Compat: [rds_src] :: RuleDecls pass -> SourceText
+ Refact.Compat: [recS_bind_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Refact.Compat: [recS_bind_ty] :: RecStmtTc -> Type
+ Refact.Compat: [recS_ext] :: StmtLR idL idR body -> XRecStmt idL idR body
+ Refact.Compat: [recS_later_ids] :: StmtLR idL idR body -> [IdP idR]
+ Refact.Compat: [recS_later_rets] :: RecStmtTc -> [PostTcExpr]
+ Refact.Compat: [recS_mfix_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Refact.Compat: [recS_rec_ids] :: StmtLR idL idR body -> [IdP idR]
+ Refact.Compat: [recS_rec_rets] :: RecStmtTc -> [PostTcExpr]
+ Refact.Compat: [recS_ret_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Refact.Compat: [recS_ret_ty] :: RecStmtTc -> Type
+ Refact.Compat: [recS_stmts] :: StmtLR idL idR body -> [LStmtLR idL idR body]
+ Refact.Compat: [rec_dotdot] :: HsRecFields p arg -> Maybe (Located Int)
+ Refact.Compat: [rec_flds] :: HsRecFields p arg -> [LHsRecField p arg]
+ Refact.Compat: [recordPatSynPatVar] :: RecordPatSynField a -> a
+ Refact.Compat: [recordPatSynSelectorId] :: RecordPatSynField a -> a
+ Refact.Compat: [rupd_cons] :: RecordUpdTc -> [ConLike]
+ Refact.Compat: [rupd_expr] :: HsExpr p -> LHsExpr p
+ Refact.Compat: [rupd_ext] :: HsExpr p -> XRecordUpd p
+ Refact.Compat: [rupd_flds] :: HsExpr p -> [LHsRecUpdField p]
+ Refact.Compat: [rupd_in_tys] :: RecordUpdTc -> [Type]
+ Refact.Compat: [rupd_out_tys] :: RecordUpdTc -> [Type]
+ Refact.Compat: [rupd_wrap] :: RecordUpdTc -> HsWrapper
+ Refact.Compat: [syn_arg_wraps] :: SyntaxExpr p -> [HsWrapper]
+ Refact.Compat: [syn_expr] :: SyntaxExpr p -> HsExpr p
+ Refact.Compat: [syn_res_wrap] :: SyntaxExpr p -> HsWrapper
+ Refact.Compat: [tcdATDefs] :: TyClDecl pass -> [LTyFamDefltDecl pass]
+ Refact.Compat: [tcdATs] :: TyClDecl pass -> [LFamilyDecl pass]
+ Refact.Compat: [tcdCExt] :: TyClDecl pass -> XClassDecl pass
+ Refact.Compat: [tcdCtxt] :: TyClDecl pass -> LHsContext pass
+ Refact.Compat: [tcdDExt] :: TyClDecl pass -> XDataDecl pass
+ Refact.Compat: [tcdDataCusk] :: DataDeclRn -> Bool
+ Refact.Compat: [tcdDataDefn] :: TyClDecl pass -> HsDataDefn pass
+ Refact.Compat: [tcdDocs] :: TyClDecl pass -> [LDocDecl]
+ Refact.Compat: [tcdFDs] :: TyClDecl pass -> [LHsFunDep pass]
+ Refact.Compat: [tcdFExt] :: TyClDecl pass -> XFamDecl pass
+ Refact.Compat: [tcdFVs] :: DataDeclRn -> NameSet
+ Refact.Compat: [tcdFam] :: TyClDecl pass -> FamilyDecl pass
+ Refact.Compat: [tcdFixity] :: TyClDecl pass -> LexicalFixity
+ Refact.Compat: [tcdLName] :: TyClDecl pass -> Located (IdP pass)
+ Refact.Compat: [tcdMeths] :: TyClDecl pass -> LHsBinds pass
+ Refact.Compat: [tcdRhs] :: TyClDecl pass -> LHsType pass
+ Refact.Compat: [tcdSExt] :: TyClDecl pass -> XSynDecl pass
+ Refact.Compat: [tcdSigs] :: TyClDecl pass -> [LSig pass]
+ Refact.Compat: [tcdTyVars] :: TyClDecl pass -> LHsQTyVars pass
+ Refact.Compat: [tfid_eqn] :: TyFamInstDecl pass -> TyFamInstEqn pass
+ Refact.Compat: [tfid_ext] :: InstDecl pass -> XTyFamInstD pass
+ Refact.Compat: [tfid_inst] :: InstDecl pass -> TyFamInstDecl pass
+ Refact.Compat: [trS_bind] :: StmtLR idL idR body -> SyntaxExpr idR
+ Refact.Compat: [trS_bndrs] :: StmtLR idL idR body -> [(IdP idR, IdP idR)]
+ Refact.Compat: [trS_by] :: StmtLR idL idR body -> Maybe (LHsExpr idR)
+ Refact.Compat: [trS_ext] :: StmtLR idL idR body -> XTransStmt idL idR body
+ Refact.Compat: [trS_fmap] :: StmtLR idL idR body -> HsExpr idR
+ Refact.Compat: [trS_form] :: StmtLR idL idR body -> TransForm
+ Refact.Compat: [trS_ret] :: StmtLR idL idR body -> SyntaxExpr idR
+ Refact.Compat: [trS_stmts] :: StmtLR idL idR body -> [ExprLStmt idL]
+ Refact.Compat: [trS_using] :: StmtLR idL idR body -> LHsExpr idR
+ Refact.Compat: [var_ext] :: HsBindLR idL idR -> XVarBind idL idR
+ Refact.Compat: [var_id] :: HsBindLR idL idR -> IdP idL
+ Refact.Compat: [var_inline] :: HsBindLR idL idR -> Bool
+ Refact.Compat: [var_rhs] :: HsBindLR idL idR -> LHsExpr idR
+ Refact.Compat: [wd_ext] :: WarnDecls pass -> XWarnings pass
+ Refact.Compat: [wd_src] :: WarnDecls pass -> SourceText
+ Refact.Compat: [wd_warnings] :: WarnDecls pass -> [LWarnDecl pass]
+ Refact.Compat: [xarg_app_arg_many] :: ApplicativeArg idL -> XApplicativeArgMany idL
+ Refact.Compat: [xarg_app_arg_one] :: ApplicativeArg idL -> XApplicativeArgOne idL
+ Refact.Compat: ambiguousFieldOcc :: FieldOcc GhcTc -> AmbiguousFieldOcc GhcTc
+ Refact.Compat: annProvenanceName_maybe :: AnnProvenance name -> Maybe name
+ Refact.Compat: annSpanToSrcSpan :: AnnSpan -> SrcSpan
+ Refact.Compat: appendDocs :: HsDocString -> HsDocString -> HsDocString
+ Refact.Compat: appendGroups :: forall (p :: Pass). HsGroup (GhcPass p) -> HsGroup (GhcPass p) -> HsGroup (GhcPass p)
+ Refact.Compat: badAnnSpan :: AnnSpan
+ Refact.Compat: chunkify :: [a] -> [[a]]
+ Refact.Compat: class Convertable a b | a -> b
+ Refact.Compat: collectEvVarsPat :: Pat GhcTc -> Bag EvVar
+ Refact.Compat: collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar
+ Refact.Compat: collectHsBindBinders :: (SrcSpanLess (LPat p) ~ Pat p, HasSrcSpan (LPat p)) => HsBindLR p idR -> [IdP p]
+ Refact.Compat: collectHsBindListBinders :: forall (p :: Pass) idR. [LHsBindLR (GhcPass p) idR] -> [IdP (GhcPass p)]
+ Refact.Compat: collectHsBindsBinders :: forall (p :: Pass) idR. LHsBindsLR (GhcPass p) idR -> [IdP (GhcPass p)]
+ Refact.Compat: collectHsIdBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Refact.Compat: collectHsValBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Refact.Compat: collectLStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. LStmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
+ Refact.Compat: collectLStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [LStmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
+ Refact.Compat: collectLocalBinders :: forall (idL :: Pass) (idR :: Pass). HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Refact.Compat: collectMethodBinders :: LHsBindsLR idL idR -> [Located (IdP idL)]
+ Refact.Compat: collectPatBinders :: forall (p :: Pass). LPat (GhcPass p) -> [IdP (GhcPass p)]
+ Refact.Compat: collectPatsBinders :: forall (p :: Pass). [LPat (GhcPass p)] -> [IdP (GhcPass p)]
+ Refact.Compat: collectRuleBndrSigTys :: [RuleBndr pass] -> [LHsSigWcType pass]
+ Refact.Compat: collectStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. StmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
+ Refact.Compat: collectStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [StmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
+ Refact.Compat: combineSrcSpans :: SrcSpan -> SrcSpan -> SrcSpan
+ Refact.Compat: composeSrcSpan :: HasSrcSpan a => Located (SrcSpanLess a) -> a
+ Refact.Compat: concatDocs :: [HsDocString] -> Maybe HsDocString
+ Refact.Compat: convert :: Convertable a b => a -> b
+ Refact.Compat: convertLit :: ConvertIdX a b => HsLit a -> HsLit b
+ Refact.Compat: countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
+ Refact.Compat: data ABExport p
+ Refact.Compat: data AmbiguousFieldOcc pass
+ Refact.Compat: data AnnDecl pass
+ Refact.Compat: data AnnKeywordId
+ Refact.Compat: data AnnProvenance name
+ Refact.Compat: data ApplicativeArg idL
+ Refact.Compat: data ArithSeqInfo id
+ Refact.Compat: data CImportSpec
+ Refact.Compat: data ClsInstDecl pass
+ Refact.Compat: data CmdTopTc
+ Refact.Compat: data ConDecl pass
+ Refact.Compat: data ConDeclField pass
+ Refact.Compat: data DataDeclRn
+ Refact.Compat: data DefaultDecl pass
+ Refact.Compat: data DelayedSplice
+ Refact.Compat: data DerivDecl pass
+ Refact.Compat: data DerivStrategy pass
+ Refact.Compat: data DocDecl
+ Refact.Compat: data FamEqn pass rhs
+ Refact.Compat: data FamilyDecl pass
+ Refact.Compat: data FamilyInfo pass
+ Refact.Compat: data FamilyResultSig pass
+ Refact.Compat: data FastString
+ Refact.Compat: data FieldOcc pass
+ Refact.Compat: data Fixity
+ Refact.Compat: data FixitySig pass
+ Refact.Compat: data FlagSpec flag
+ Refact.Compat: data ForallVisFlag
+ Refact.Compat: data ForeignDecl pass
+ Refact.Compat: data ForeignExport
+ Refact.Compat: data ForeignImport
+ Refact.Compat: data GRHS p body
+ Refact.Compat: data GRHSs p body
+ Refact.Compat: data GenLocated l e
+ Refact.Compat: data GeneralFlag
+ Refact.Compat: data GhcPass (c :: Pass)
+ Refact.Compat: data HsArg tm ty
+ Refact.Compat: data HsArrAppType
+ Refact.Compat: data HsBindLR idL idR
+ Refact.Compat: data HsBracket p
+ Refact.Compat: data HsCmd id
+ Refact.Compat: data HsCmdTop p
+ Refact.Compat: data HsConDetails arg rec
+ Refact.Compat: data HsDataDefn pass
+ Refact.Compat: data HsDecl p
+ Refact.Compat: data HsDerivingClause pass
+ Refact.Compat: data HsDocString
+ Refact.Compat: data HsExpr p
+ Refact.Compat: data HsGroup p
+ Refact.Compat: data HsIPBinds id
+ Refact.Compat: data HsImplBang
+ Refact.Compat: data HsImplicitBndrs pass thing
+ Refact.Compat: data HsLit x
+ Refact.Compat: data HsLocalBindsLR idL idR
+ Refact.Compat: data HsMatchContext id
+ Refact.Compat: data HsModule pass
+ Refact.Compat: data HsOverLit p
+ Refact.Compat: data HsPatSynDir id
+ Refact.Compat: data HsRecField' id arg
+ Refact.Compat: data HsRecFields p arg
+ Refact.Compat: data HsRuleRn
+ Refact.Compat: data HsSplice id
+ Refact.Compat: data HsSplicedThing id
+ Refact.Compat: data HsSrcBang
+ Refact.Compat: data HsStmtContext id
+ Refact.Compat: data HsTupArg id
+ Refact.Compat: data HsTupleSort
+ Refact.Compat: data HsTyLit
+ Refact.Compat: data HsTyVarBndr pass
+ Refact.Compat: data HsType pass
+ Refact.Compat: data HsValBindsLR idL idR
+ Refact.Compat: data HsWildCardBndrs pass thing
+ Refact.Compat: data IE pass
+ Refact.Compat: data IEWildcard
+ Refact.Compat: data IEWrappedName name
+ Refact.Compat: data IPBind id
+ Refact.Compat: data ImportDecl pass
+ Refact.Compat: data ImportDeclQualifiedStyle
+ Refact.Compat: data InjectivityAnn pass
+ Refact.Compat: data InstDecl pass
+ Refact.Compat: data LHsQTyVars pass
+ Refact.Compat: data ListPatTc
+ Refact.Compat: data Match p body
+ Refact.Compat: data MatchGroup p body
+ Refact.Compat: data MatchGroupTc
+ Refact.Compat: data NHsValBindsLR idL
+ Refact.Compat: data NPatBindTc
+ Refact.Compat: data NewHsTypeX
+ Refact.Compat: data NewOrData
+ Refact.Compat: data NoExtCon
+ Refact.Compat: data NoExtField
+ Refact.Compat: data OverLitTc
+ Refact.Compat: data OverLitVal
+ Refact.Compat: data ParStmtBlock idL idR
+ Refact.Compat: data Pass
+ Refact.Compat: data PatSynBind idL idR
+ Refact.Compat: data PendingRnSplice
+ Refact.Compat: data PendingTcSplice
+ Refact.Compat: data RdrName
+ Refact.Compat: data RealSrcSpan
+ Refact.Compat: data RecStmtTc
+ Refact.Compat: data RecordConTc
+ Refact.Compat: data RecordPatSynField a
+ Refact.Compat: data RecordUpdTc
+ Refact.Compat: data RoleAnnotDecl pass
+ Refact.Compat: data RuleBndr pass
+ Refact.Compat: data RuleDecl pass
+ Refact.Compat: data RuleDecls pass
+ Refact.Compat: data Sig pass
+ Refact.Compat: data SourceText
+ Refact.Compat: data SpliceDecl p
+ Refact.Compat: data SpliceDecoration
+ Refact.Compat: data SpliceExplicitFlag
+ Refact.Compat: data SrcStrictness
+ Refact.Compat: data SrcUnpackedness
+ Refact.Compat: data StandaloneKindSig pass
+ Refact.Compat: data StmtLR idL idR body
+ Refact.Compat: data SyntaxExpr p
+ Refact.Compat: data TcSpecPrag
+ Refact.Compat: data TcSpecPrags
+ Refact.Compat: data TransForm
+ Refact.Compat: data TyClDecl pass
+ Refact.Compat: data TyClGroup pass
+ Refact.Compat: data UnboundVar
+ Refact.Compat: data UntypedSpliceFlavour
+ Refact.Compat: data WarnDecl pass
+ Refact.Compat: data WarnDecls pass
+ Refact.Compat: decomposeSrcSpan :: HasSrcSpan a => a -> Located (SrcSpanLess a)
+ Refact.Compat: derivStrategyName :: DerivStrategy a -> SDoc
+ Refact.Compat: docDeclDoc :: DocDecl -> HsDocString
+ Refact.Compat: dropWildCards :: LHsSigWcType pass -> LHsSigType pass
+ Refact.Compat: emptyArgDocMap :: ArgDocMap
+ Refact.Compat: emptyDeclDocMap :: DeclDocMap
+ Refact.Compat: emptyLHsBinds :: LHsBindsLR idL idR
+ Refact.Compat: emptyLHsQTvs :: LHsQTyVars GhcRn
+ Refact.Compat: emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b)
+ Refact.Compat: emptyRdrGroup :: forall (p :: Pass). HsGroup (GhcPass p)
+ Refact.Compat: emptyRecStmt :: forall (idL :: Pass) bodyR. StmtLR (GhcPass idL) GhcPs bodyR
+ Refact.Compat: emptyRecStmtId :: StmtLR GhcTc GhcTc bodyR
+ Refact.Compat: emptyRecStmtName :: StmtLR GhcRn GhcRn bodyR
+ Refact.Compat: emptyRnGroup :: forall (p :: Pass). HsGroup (GhcPass p)
+ Refact.Compat: emptyTransStmt :: StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Refact.Compat: emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
+ Refact.Compat: emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
+ Refact.Compat: eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
+ Refact.Compat: famResultKindSignature :: forall (p :: Pass). FamilyResultSig (GhcPass p) -> Maybe (LHsKind (GhcPass p))
+ Refact.Compat: familyDeclLName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Refact.Compat: familyDeclName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: flattenRuleDecls :: [LRuleDecls pass] -> [LRuleDecl pass]
+ Refact.Compat: foldDerivStrategy :: forall p (pass :: Pass) r. p ~ GhcPass pass => r -> (XViaStrategy p -> r) -> DerivStrategy p -> r
+ Refact.Compat: getBangStrictness :: LHsType a -> HsSrcBang
+ Refact.Compat: getBangType :: LHsType a -> LHsType a
+ Refact.Compat: getConArgs :: ConDecl pass -> HsConDeclDetails pass
+ Refact.Compat: getConNames :: forall (p :: Pass). ConDecl (GhcPass p) -> [Located (IdP (GhcPass p))]
+ Refact.Compat: getLHsInstDeclClass_maybe :: forall (p :: Pass). LHsSigType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
+ Refact.Compat: getLHsInstDeclHead :: forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: getOptions :: DynFlags -> StringBuffer -> FilePath -> [Located String]
+ Refact.Compat: getPatSynBinds :: [(RecFlag, LHsBinds id)] -> [PatSynBind id id]
+ Refact.Compat: gopt_set :: DynFlags -> GeneralFlag -> DynFlags
+ Refact.Compat: gopt_unset :: DynFlags -> GeneralFlag -> DynFlags
+ Refact.Compat: handleGhcException :: ExceptionMonad m => (GhcException -> m a) -> m a -> m a
+ Refact.Compat: hasSpecPrags :: TcSpecPrags -> Bool
+ Refact.Compat: hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
+ Refact.Compat: hsConDeclArgTys :: HsConDeclDetails pass -> [LBangType pass]
+ Refact.Compat: hsConDeclTheta :: Maybe (LHsContext pass) -> [LHsType pass]
+ Refact.Compat: hsConDetailsArgs :: HsConDetails (LHsType a) (Located [LConDeclField a]) -> [LHsType a]
+ Refact.Compat: hsConPatArgs :: HsConPatDetails p -> [LPat p]
+ Refact.Compat: hsDataFamInstBinders :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
+ Refact.Compat: hsDeclHasCusk :: TyClDecl GhcRn -> Bool
+ Refact.Compat: hsDocStringToByteString :: HsDocString -> ByteString
+ Refact.Compat: hsExplicitLTyVarNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
+ Refact.Compat: hsExprNeedsParens :: PprPrec -> HsExpr p -> Bool
+ Refact.Compat: hsForeignDeclsBinders :: [LForeignDecl pass] -> [Located (IdP pass)]
+ Refact.Compat: hsGroupBinders :: HsGroup GhcRn -> [Name]
+ Refact.Compat: hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
+ Refact.Compat: hsIPNameFS :: HsIPName -> FastString
+ Refact.Compat: hsImplicitBody :: forall (p :: Pass) thing. HsImplicitBndrs (GhcPass p) thing -> thing
+ Refact.Compat: hsLMatchPats :: forall (id :: Pass) body. LMatch (GhcPass id) body -> [LPat (GhcPass id)]
+ Refact.Compat: hsLTyClDeclBinders :: forall (p :: Pass). Located (TyClDecl (GhcPass p)) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
+ Refact.Compat: hsLTyVarBndrToType :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: hsLTyVarBndrsToTypes :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [LHsType (GhcPass p)]
+ Refact.Compat: hsLTyVarLocName :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> Located (IdP (GhcPass p))
+ Refact.Compat: hsLTyVarLocNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [Located (IdP (GhcPass p))]
+ Refact.Compat: hsLTyVarName :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: hsLTyVarNames :: forall (p :: Pass). [LHsTyVarBndr (GhcPass p)] -> [IdP (GhcPass p)]
+ Refact.Compat: hsLitNeedsParens :: PprPrec -> HsLit x -> Bool
+ Refact.Compat: hsOverLitNeedsParens :: PprPrec -> HsOverLit x -> Bool
+ Refact.Compat: hsPatSynSelectors :: forall (p :: Pass). HsValBinds (GhcPass p) -> [IdP (GhcPass p)]
+ Refact.Compat: hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr pass]
+ Refact.Compat: hsRecFieldId :: HsRecField GhcTc arg -> Located Id
+ Refact.Compat: hsRecFieldSel :: HsRecField pass arg -> Located (XCFieldOcc pass)
+ Refact.Compat: hsRecFields :: HsRecFields p arg -> [XCFieldOcc p]
+ Refact.Compat: hsRecFieldsArgs :: HsRecFields p arg -> [arg]
+ Refact.Compat: hsRecUpdFieldId :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> Located Id
+ Refact.Compat: hsRecUpdFieldOcc :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc
+ Refact.Compat: hsRecUpdFieldRdr :: forall (p :: Pass). HsRecUpdField (GhcPass p) -> Located RdrName
+ Refact.Compat: hsScopedTvs :: LHsSigType GhcRn -> [Name]
+ Refact.Compat: hsSigDoc :: Sig name -> SDoc
+ Refact.Compat: hsSigType :: forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: hsSigWcType :: LHsSigWcType pass -> LHsType pass
+ Refact.Compat: hsTvbAllKinded :: LHsQTyVars pass -> Bool
+ Refact.Compat: hsTyClForeignBinders :: [TyClGroup GhcRn] -> [LForeignDecl GhcRn] -> [Name]
+ Refact.Compat: hsTyGetAppHead_maybe :: forall (p :: Pass). LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
+ Refact.Compat: hsTyKindSig :: LHsType pass -> Maybe (LHsKind pass)
+ Refact.Compat: hsTyVarName :: forall (p :: Pass). HsTyVarBndr (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: hsTypeNeedsParens :: PprPrec -> HsType pass -> Bool
+ Refact.Compat: hsValBindsImplicits :: forall (idR :: Pass). HsValBindsLR GhcRn (GhcPass idR) -> [(SrcSpan, [Name])]
+ Refact.Compat: hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
+ Refact.Compat: ieLWrappedName :: LIEWrappedName name -> Located name
+ Refact.Compat: ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
+ Refact.Compat: ieWrappedName :: IEWrappedName name -> name
+ Refact.Compat: ignoreParens :: LHsType pass -> LHsType pass
+ Refact.Compat: impliedXFlags :: [(Extension, Bool, Extension)]
+ Refact.Compat: importDeclQualifiedStyle :: Maybe (Located a) -> Maybe (Located a) -> ImportDeclQualifiedStyle
+ Refact.Compat: instDeclDataFamInsts :: forall (p :: Pass). [LInstDecl (GhcPass p)] -> [DataFamInstDecl (GhcPass p)]
+ Refact.Compat: isAtomicHsExpr :: HsExpr id -> Bool
+ Refact.Compat: isBangedHsBind :: HsBind GhcTc -> Bool
+ Refact.Compat: isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool
+ Refact.Compat: isClassDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
+ Refact.Compat: isCompleteMatchSig :: LSig name -> Bool
+ Refact.Compat: isComprehensionContext :: HsStmtContext id -> Bool
+ Refact.Compat: isDataDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isDataFamilyDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isDefaultMethod :: TcSpecPrags -> Bool
+ Refact.Compat: isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool
+ Refact.Compat: isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool
+ Refact.Compat: isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
+ Refact.Compat: isEmptyLHsQTvs :: LHsQTyVars GhcRn -> Bool
+ Refact.Compat: isEmptyLocalBindsPR :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b) -> Bool
+ Refact.Compat: isEmptyLocalBindsTc :: forall (a :: Pass). HsLocalBindsLR (GhcPass a) GhcTc -> Bool
+ Refact.Compat: isEmptyMatchGroup :: MatchGroup id body -> Bool
+ Refact.Compat: isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool
+ Refact.Compat: isFamilyDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isFixityLSig :: LSig name -> Bool
+ Refact.Compat: isHsKindedTyVar :: HsTyVarBndr pass -> Bool
+ Refact.Compat: isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
+ Refact.Compat: isInfixFunBind :: HsBindLR id1 id2 -> Bool
+ Refact.Compat: isInfixMatch :: Match id body -> Bool
+ Refact.Compat: isInlineLSig :: LSig name -> Bool
+ Refact.Compat: isIrrefutableHsPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> Bool
+ Refact.Compat: isLHsForAllTy :: LHsType p -> Bool
+ Refact.Compat: isMinimalLSig :: LSig name -> Bool
+ Refact.Compat: isMonadCompContext :: HsStmtContext id -> Bool
+ Refact.Compat: isMonadFailStmtContext :: HsStmtContext id -> Bool
+ Refact.Compat: isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
+ Refact.Compat: isPatSynCtxt :: HsMatchContext id -> Bool
+ Refact.Compat: isPragLSig :: LSig name -> Bool
+ Refact.Compat: isQuietHsCmd :: HsCmd id -> Bool
+ Refact.Compat: isQuietHsExpr :: HsExpr id -> Bool
+ Refact.Compat: isSCCFunSig :: LSig name -> Bool
+ Refact.Compat: isSingletonMatchGroup :: [LMatch id body] -> Bool
+ Refact.Compat: isSpecInstLSig :: LSig name -> Bool
+ Refact.Compat: isSpecLSig :: LSig name -> Bool
+ Refact.Compat: isSynDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isTypeFamilyDecl :: TyClDecl pass -> Bool
+ Refact.Compat: isTypeLSig :: LSig name -> Bool
+ Refact.Compat: isTypedBracket :: HsBracket id -> Bool
+ Refact.Compat: isTypedSplice :: HsSplice id -> Bool
+ Refact.Compat: isUnliftedHsBind :: HsBind GhcTc -> Bool
+ Refact.Compat: lPatImplicits :: LPat GhcRn -> [(SrcSpan, [Name])]
+ Refact.Compat: lStmtsImplicits :: forall (idR :: Pass) body. [LStmtLR GhcRn (GhcPass idR) (Located (body (GhcPass idR)))] -> [(SrcSpan, [Name])]
+ Refact.Compat: lieWrappedName :: LIEWrappedName name -> name
+ Refact.Compat: looksLazyPatBind :: forall (p :: Pass). HsBind (GhcPass p) -> Bool
+ Refact.Compat: mapDerivStrategy :: forall p (pass :: Pass). p ~ GhcPass pass => (XViaStrategy p -> XViaStrategy p) -> DerivStrategy p -> DerivStrategy p
+ Refact.Compat: matchContextErrString :: Outputable id => HsMatchContext id -> SDoc
+ Refact.Compat: matchGroupArity :: forall (id :: Pass) body. MatchGroup (GhcPass id) body -> Arity
+ Refact.Compat: matchSeparator :: HsMatchContext id -> SDoc
+ Refact.Compat: missingTupArg :: HsTupArg GhcPs
+ Refact.Compat: mkAmbiguousFieldOcc :: Located RdrName -> AmbiguousFieldOcc GhcPs
+ Refact.Compat: mkAnonWildCardTy :: HsType GhcPs
+ Refact.Compat: mkBigLHsPatTup :: [LPat GhcRn] -> LPat GhcRn
+ Refact.Compat: mkBigLHsTup :: forall (id :: Pass). [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: mkBigLHsVarPatTup :: [IdP GhcRn] -> LPat GhcRn
+ Refact.Compat: mkBigLHsVarTup :: forall (id :: Pass). [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: mkBindStmt :: forall (idL :: Pass) (idR :: Pass) bodyR. XBindStmt (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR))) ~ NoExtField => LPat (GhcPass idL) -> Located (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
+ Refact.Compat: mkBodyStmt :: forall bodyR (idL :: Pass). Located (bodyR GhcPs) -> StmtLR (GhcPass idL) GhcPs (Located (bodyR GhcPs))
+ Refact.Compat: mkCharLitPat :: forall (p :: Pass). SourceText -> Char -> OutPat (GhcPass p)
+ Refact.Compat: mkChunkified :: ([a] -> a) -> [a] -> a
+ Refact.Compat: mkClassOpSigs :: [LSig GhcPs] -> [LSig GhcPs]
+ Refact.Compat: mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs GhcRn thing
+ Refact.Compat: mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs GhcRn thing
+ Refact.Compat: mkErr :: DynFlags -> SrcSpan -> String -> Errors
+ Refact.Compat: mkFastString :: String -> FastString
+ Refact.Compat: mkFieldOcc :: Located RdrName -> FieldOcc GhcPs
+ Refact.Compat: mkFunBind :: Origin -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> HsBind GhcPs
+ Refact.Compat: mkGroupByUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Refact.Compat: mkGroupUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Refact.Compat: mkHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: mkHsAppKindTy :: forall (p :: Pass). XAppKindTy (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: mkHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: mkHsAppType :: forall (id :: Pass). NoGhcTc (GhcPass id) ~ GhcRn => LHsExpr (GhcPass id) -> LHsWcType GhcRn -> LHsExpr (GhcPass id)
+ Refact.Compat: mkHsAppTypes :: LHsExpr GhcRn -> [LHsWcType GhcRn] -> LHsExpr GhcRn
+ Refact.Compat: mkHsAppTys :: forall (p :: Pass). LHsType (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
+ Refact.Compat: mkHsCaseAlt :: forall (p :: Pass) body. LPat (GhcPass p) -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
+ Refact.Compat: mkHsCmdIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p) -> HsCmd (GhcPass p)
+ Refact.Compat: mkHsCmdWrap :: forall (p :: Pass). HsWrapper -> HsCmd (GhcPass p) -> HsCmd (GhcPass p)
+ Refact.Compat: mkHsComp :: HsStmtContext Name -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> HsExpr GhcPs
+ Refact.Compat: mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
+ Refact.Compat: mkHsDo :: HsStmtContext Name -> [ExprLStmt GhcPs] -> HsExpr GhcPs
+ Refact.Compat: mkHsDocString :: String -> HsDocString
+ Refact.Compat: mkHsDocStringUtf8ByteString :: ByteString -> HsDocString
+ Refact.Compat: mkHsFractional :: FractionalLit -> HsOverLit GhcPs
+ Refact.Compat: mkHsIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> HsExpr (GhcPass p)
+ Refact.Compat: mkHsImplicitBndrs :: thing -> HsImplicitBndrs GhcPs thing
+ Refact.Compat: mkHsIntegral :: IntegralLit -> HsOverLit GhcPs
+ Refact.Compat: mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs
+ Refact.Compat: mkHsLam :: forall (p :: Pass). XMG (GhcPass p) (LHsExpr (GhcPass p)) ~ NoExtField => [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
+ Refact.Compat: mkHsLams :: [TyVar] -> [EvVar] -> LHsExpr GhcTc -> LHsExpr GhcTc
+ Refact.Compat: mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs
+ Refact.Compat: mkHsOpTy :: forall (p :: Pass). LHsType (GhcPass p) -> Located (IdP (GhcPass p)) -> LHsType (GhcPass p) -> HsType (GhcPass p)
+ Refact.Compat: mkHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: mkHsQTvs :: [LHsTyVarBndr GhcPs] -> LHsQTyVars GhcPs
+ Refact.Compat: mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
+ Refact.Compat: mkHsSigEnv :: (LSig GhcRn -> Maybe ([Located Name], a)) -> [LSig GhcRn] -> NameEnv a
+ Refact.Compat: mkHsString :: forall (p :: Pass). String -> HsLit (GhcPass p)
+ Refact.Compat: mkHsStringPrimLit :: forall (p :: Pass). FastString -> HsLit (GhcPass p)
+ Refact.Compat: mkHsVarBind :: SrcSpan -> RdrName -> LHsExpr GhcPs -> LHsBind GhcPs
+ Refact.Compat: mkHsWildCardBndrs :: thing -> HsWildCardBndrs GhcPs thing
+ Refact.Compat: mkHsWrap :: forall (id :: Pass). HsWrapper -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Refact.Compat: mkHsWrapCo :: forall (id :: Pass). TcCoercionN -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Refact.Compat: mkHsWrapCoR :: forall (id :: Pass). TcCoercionR -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Refact.Compat: mkHsWrapPat :: forall (id :: Pass). HsWrapper -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
+ Refact.Compat: mkHsWrapPatCo :: forall (id :: Pass). TcCoercionN -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
+ Refact.Compat: mkLHsCmdWrap :: forall (p :: Pass). HsWrapper -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p)
+ Refact.Compat: mkLHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: mkLHsSigType :: LHsType GhcPs -> LHsSigType GhcPs
+ Refact.Compat: mkLHsSigWcType :: LHsType GhcPs -> LHsSigWcType GhcPs
+ Refact.Compat: mkLHsTupleExpr :: forall (a :: Pass). [LHsExpr (GhcPass a)] -> LHsExpr (GhcPass a)
+ Refact.Compat: mkLHsVarTuple :: forall (a :: Pass). [IdP (GhcPass a)] -> LHsExpr (GhcPass a)
+ Refact.Compat: mkLHsWrap :: forall (id :: Pass). HsWrapper -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: mkLHsWrapCo :: forall (id :: Pass). TcCoercionN -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: mkLastStmt :: forall bodyR (idR :: Pass) (idL :: Pass). Located (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
+ Refact.Compat: mkMatch :: forall (p :: Pass). HsMatchContext (NameOrRdrName (IdP (GhcPass p))) -> [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> Located (HsLocalBinds (GhcPass p)) -> LMatch (GhcPass p) (LHsExpr (GhcPass p))
+ Refact.Compat: mkMatchGroup :: XMG name (Located (body name)) ~ NoExtField => Origin -> [LMatch name (Located (body name))] -> MatchGroup name (Located (body name))
+ Refact.Compat: mkNPat :: Located (HsOverLit GhcPs) -> Maybe (SyntaxExpr GhcPs) -> Pat GhcPs
+ Refact.Compat: mkNPlusKPat :: Located RdrName -> Located (HsOverLit GhcPs) -> Pat GhcPs
+ Refact.Compat: mkNilPat :: forall (p :: Pass). Type -> OutPat (GhcPass p)
+ Refact.Compat: mkParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
+ Refact.Compat: mkPatSynBind :: Located RdrName -> HsPatSynDetails (Located RdrName) -> LPat GhcPs -> HsPatSynDir GhcPs -> HsBind GhcPs
+ Refact.Compat: mkPrefixConPat :: forall (p :: Pass). DataCon -> [OutPat (GhcPass p)] -> [Type] -> OutPat (GhcPass p)
+ Refact.Compat: mkPrefixFunRhs :: Located id -> HsMatchContext id
+ Refact.Compat: mkRecStmt :: forall (idL :: Pass) bodyR. [LStmtLR (GhcPass idL) GhcPs bodyR] -> StmtLR (GhcPass idL) GhcPs bodyR
+ Refact.Compat: mkRnSyntaxExpr :: Name -> SyntaxExpr GhcRn
+ Refact.Compat: mkSimpleGeneratedFunBind :: SrcSpan -> RdrName -> [LPat GhcPs] -> LHsExpr GhcPs -> LHsBind GhcPs
+ Refact.Compat: mkSimpleMatch :: forall (p :: Pass) body. HsMatchContext (NameOrRdrName (IdP (GhcPass p))) -> [LPat (GhcPass p)] -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
+ Refact.Compat: mkSyntaxExpr :: forall (p :: Pass). HsExpr (GhcPass p) -> SyntaxExpr (GhcPass p)
+ Refact.Compat: mkTcBindStmt :: LPat GhcTc -> Located (bodyR GhcTc) -> StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
+ Refact.Compat: mkTopFunBind :: Origin -> Located Name -> [LMatch GhcRn (LHsExpr GhcRn)] -> HsBind GhcRn
+ Refact.Compat: mkTransformByStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Refact.Compat: mkTransformStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Refact.Compat: mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
+ Refact.Compat: mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
+ Refact.Compat: mkVarBind :: forall (p :: Pass). IdP (GhcPass p) -> LHsExpr (GhcPass p) -> LHsBind (GhcPass p)
+ Refact.Compat: nameOccName :: Name -> OccName
+ Refact.Compat: negateOverLitVal :: OverLitVal -> OverLitVal
+ Refact.Compat: newOrDataToFlavour :: NewOrData -> TyConFlavour
+ Refact.Compat: newtype ArgDocMap
+ Refact.Compat: newtype DataFamInstDecl pass
+ Refact.Compat: newtype DeclDocMap
+ Refact.Compat: newtype HsIPName
+ Refact.Compat: newtype ThModFinalizers
+ Refact.Compat: newtype TyFamInstDecl pass
+ Refact.Compat: nlConPat :: RdrName -> [LPat GhcPs] -> LPat GhcPs
+ Refact.Compat: nlConPatName :: Name -> [LPat GhcRn] -> LPat GhcRn
+ Refact.Compat: nlConVarPat :: RdrName -> [RdrName] -> LPat GhcPs
+ Refact.Compat: nlConVarPatName :: Name -> [Name] -> LPat GhcRn
+ Refact.Compat: nlHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsAppKindTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsKind (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: nlHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: nlHsApps :: forall (id :: Pass). IdP (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsCase :: LHsExpr GhcPs -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
+ Refact.Compat: nlHsDataCon :: DataCon -> LHsExpr GhcTc
+ Refact.Compat: nlHsDo :: HsStmtContext Name -> [LStmt GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
+ Refact.Compat: nlHsFunTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: nlHsIf :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsIntLit :: forall (p :: Pass). Integer -> LHsExpr (GhcPass p)
+ Refact.Compat: nlHsLam :: LMatch GhcPs (LHsExpr GhcPs) -> LHsExpr GhcPs
+ Refact.Compat: nlHsLit :: forall (p :: Pass). HsLit (GhcPass p) -> LHsExpr (GhcPass p)
+ Refact.Compat: nlHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs
+ Refact.Compat: nlHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsParTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: nlHsSyntaxApps :: forall (id :: Pass). SyntaxExpr (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsTyApp :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsTyApps :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsTyConApp :: forall (p :: Pass). IdP (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
+ Refact.Compat: nlHsTyVar :: forall (p :: Pass). IdP (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: nlHsVar :: forall (id :: Pass). IdP (GhcPass id) -> LHsExpr (GhcPass id)
+ Refact.Compat: nlHsVarApps :: forall (id :: Pass). IdP (GhcPass id) -> [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
+ Refact.Compat: nlInfixConPat :: RdrName -> LPat GhcPs -> LPat GhcPs -> LPat GhcPs
+ Refact.Compat: nlList :: [LHsExpr GhcPs] -> LHsExpr GhcPs
+ Refact.Compat: nlLitPat :: HsLit GhcPs -> LPat GhcPs
+ Refact.Compat: nlNullaryConPat :: forall (p :: Pass). IdP (GhcPass p) -> LPat (GhcPass p)
+ Refact.Compat: nlParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
+ Refact.Compat: nlTuplePat :: [LPat GhcPs] -> Boxity -> LPat GhcPs
+ Refact.Compat: nlVarPat :: forall (id :: Pass). IdP (GhcPass id) -> LPat (GhcPass id)
+ Refact.Compat: nlWildConPat :: DataCon -> LPat GhcPs
+ Refact.Compat: nlWildPat :: LPat GhcPs
+ Refact.Compat: nlWildPatName :: LPat GhcRn
+ Refact.Compat: noExpr :: forall (p :: Pass). HsExpr (GhcPass p)
+ Refact.Compat: noExtCon :: NoExtCon -> a
+ Refact.Compat: noExtField :: NoExtField
+ Refact.Compat: noLHsContext :: LHsContext pass
+ Refact.Compat: noSpecPrags :: TcSpecPrags
+ Refact.Compat: noSyntaxExpr :: forall (p :: Pass). SyntaxExpr (GhcPass p)
+ Refact.Compat: numVisibleArgs :: [HsArg tm ty] -> Arity
+ Refact.Compat: occName :: HasOccName name => name -> OccName
+ Refact.Compat: occNameString :: OccName -> String
+ Refact.Compat: onError :: String -> Errors -> a
+ Refact.Compat: overLitType :: HsOverLit GhcTc -> Type
+ Refact.Compat: parenthesizeHsContext :: forall (p :: Pass). PprPrec -> LHsContext (GhcPass p) -> LHsContext (GhcPass p)
+ Refact.Compat: parenthesizeHsExpr :: forall (p :: Pass). PprPrec -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
+ Refact.Compat: parenthesizeHsType :: forall (p :: Pass). PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Refact.Compat: parenthesizePat :: forall (p :: Pass). PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p)
+ Refact.Compat: parseDynamicFilePragma :: MonadIO m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])
+ Refact.Compat: parseModuleName :: SrcSpan -> Parser (Located ModuleName)
+ Refact.Compat: patNeedsParens :: PprPrec -> Pat p -> Bool
+ Refact.Compat: pat_arg_tys :: Pat p -> [Type]
+ Refact.Compat: pat_args :: Pat p -> HsConPatDetails p
+ Refact.Compat: pat_binds :: Pat p -> TcEvBinds
+ Refact.Compat: pat_con :: Pat p -> Located ConLike
+ Refact.Compat: pat_dicts :: Pat p -> [EvVar]
+ Refact.Compat: pat_tvs :: Pat p -> [TyVar]
+ Refact.Compat: pat_wrap :: Pat p -> HsWrapper
+ Refact.Compat: pattern ConPatIn :: () => Located (IdP p) -> HsConPatDetails p -> Pat p
+ Refact.Compat: pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc
+ Refact.Compat: pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan
+ Refact.Compat: pattern AsPat :: () => XAsPat p -> Located (IdP p) -> LPat p -> Pat p
+ Refact.Compat: pattern BangPat :: () => XBangPat p -> LPat p -> Pat p
+ Refact.Compat: pattern CoPat :: () => XCoPat p -> HsWrapper -> Pat p -> Type -> Pat p
+ Refact.Compat: pattern LazyPat :: () => XLazyPat p -> LPat p -> Pat p
+ Refact.Compat: pattern ListPat :: () => XListPat p -> [LPat p] -> Pat p
+ Refact.Compat: pattern LitPat :: () => XLitPat p -> HsLit p -> Pat p
+ Refact.Compat: pattern NPat :: () => XNPat p -> Located (HsOverLit p) -> Maybe (SyntaxExpr p) -> SyntaxExpr p -> Pat p
+ Refact.Compat: pattern NPlusKPat :: () => XNPlusKPat p -> Located (IdP p) -> Located (HsOverLit p) -> HsOverLit p -> SyntaxExpr p -> SyntaxExpr p -> Pat p
+ Refact.Compat: pattern ParPat :: () => XParPat p -> LPat p -> Pat p
+ Refact.Compat: pattern SigPat :: () => XSigPat p -> LPat p -> LHsSigWcType (NoGhcTc p) -> Pat p
+ Refact.Compat: pattern SplicePat :: () => XSplicePat p -> HsSplice p -> Pat p
+ Refact.Compat: pattern SumPat :: () => XSumPat p -> LPat p -> ConTag -> Arity -> Pat p
+ Refact.Compat: pattern TuplePat :: () => XTuplePat p -> [LPat p] -> Boxity -> Pat p
+ Refact.Compat: pattern VarPat :: () => XVarPat p -> Located (IdP p) -> Pat p
+ Refact.Compat: pattern ViewPat :: () => XViewPat p -> LHsExpr p -> LPat p -> Pat p
+ Refact.Compat: pattern WildPat :: () => XWildPat p -> Pat p
+ Refact.Compat: pattern XPat :: () => XXPat p -> Pat p
+ Refact.Compat: placeHolderNamesTc :: NameSet
+ Refact.Compat: plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a)
+ Refact.Compat: pmPprHsLit :: forall (x :: Pass). HsLit (GhcPass x) -> SDoc
+ Refact.Compat: pp_dotdot :: SDoc
+ Refact.Compat: pp_rhs :: Outputable body => HsMatchContext idL -> body -> SDoc
+ Refact.Compat: pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc
+ Refact.Compat: ppr :: Outputable a => a -> SDoc
+ Refact.Compat: pprAStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
+ Refact.Compat: pprAnonWildCard :: SDoc
+ Refact.Compat: pprArg :: forall (idL :: Pass). OutputableBndrId idL => ApplicativeArg (GhcPass idL) -> SDoc
+ Refact.Compat: pprBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Refact.Compat: pprBy :: Outputable body => Maybe body -> SDoc
+ Refact.Compat: pprCmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
+ Refact.Compat: pprCmdArg :: forall (p :: Pass). OutputableBndrId p => HsCmdTop (GhcPass p) -> SDoc
+ Refact.Compat: pprComp :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
+ Refact.Compat: pprConArgs :: forall (p :: Pass). OutputableBndrId p => HsConPatDetails (GhcPass p) -> SDoc
+ Refact.Compat: pprConDeclFields :: forall (p :: Pass). OutputableBndrId p => [LConDeclField (GhcPass p)] -> SDoc
+ Refact.Compat: pprDataFamInstFlavour :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> SDoc
+ Refact.Compat: pprDebugParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprDeclList :: [SDoc] -> SDoc
+ Refact.Compat: pprDo :: forall (p :: Pass) body any. (OutputableBndrId p, Outputable body) => HsStmtContext any -> [LStmt (GhcPass p) body] -> SDoc
+ Refact.Compat: pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
+ Refact.Compat: pprExpr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
+ Refact.Compat: pprFullRuleName :: Located (SourceText, RuleName) -> SDoc
+ Refact.Compat: pprFunBind :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
+ Refact.Compat: pprGRHS :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHS (GhcPass idR) body -> SDoc
+ Refact.Compat: pprGRHSs :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHSs (GhcPass idR) body -> SDoc
+ Refact.Compat: pprHsBracket :: forall (p :: Pass). OutputableBndrId p => HsBracket (GhcPass p) -> SDoc
+ Refact.Compat: pprHsExplicitForAll :: forall (p :: Pass). OutputableBndrId p => ForallVisFlag -> Maybe [LHsTyVarBndr (GhcPass p)] -> SDoc
+ Refact.Compat: pprHsFamInstLHS :: forall (p :: Pass). OutputableBndrId p => IdP (GhcPass p) -> Maybe [LHsTyVarBndr (GhcPass p)] -> HsTyPats (GhcPass p) -> LexicalFixity -> LHsContext (GhcPass p) -> SDoc
+ Refact.Compat: pprHsForAll :: forall (p :: Pass). OutputableBndrId p => ForallVisFlag -> [LHsTyVarBndr (GhcPass p)] -> LHsContext (GhcPass p) -> SDoc
+ Refact.Compat: pprHsForAllExtra :: forall (p :: Pass). OutputableBndrId p => Maybe SrcSpan -> ForallVisFlag -> [LHsTyVarBndr (GhcPass p)] -> LHsContext (GhcPass p) -> SDoc
+ Refact.Compat: pprHsType :: forall (p :: Pass). OutputableBndrId p => HsType (GhcPass p) -> SDoc
+ Refact.Compat: pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc
+ Refact.Compat: pprLCmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
+ Refact.Compat: pprLExpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprLHsBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Refact.Compat: pprLHsBindsForUser :: forall (idL :: Pass) (idR :: Pass) (id2 :: Pass). (OutputableBndrId idL, OutputableBndrId idR, OutputableBndrId id2) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> [LSig (GhcPass id2)] -> [SDoc]
+ Refact.Compat: pprLHsContext :: forall (p :: Pass). OutputableBndrId p => LHsContext (GhcPass p) -> SDoc
+ Refact.Compat: pprMatch :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => Match (GhcPass idR) body -> SDoc
+ Refact.Compat: pprMatchContext :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
+ Refact.Compat: pprMatchContextNoun :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
+ Refact.Compat: pprMatchInCtxt :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable (NameOrRdrName (NameOrRdrName (IdP (GhcPass idR)))), Outputable body) => Match (GhcPass idR) body -> SDoc
+ Refact.Compat: pprMatches :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
+ Refact.Compat: pprMinimalSig :: OutputableBndr name => LBooleanFormula (Located name) -> SDoc
+ Refact.Compat: pprParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> HsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprParendLExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc
+ Refact.Compat: pprPatBind :: forall (bndr :: Pass) (p :: Pass) body. (OutputableBndrId bndr, OutputableBndrId p, Outputable body) => LPat (GhcPass bndr) -> GRHSs (GhcPass p) body -> SDoc
+ Refact.Compat: pprPendingSplice :: forall (p :: Pass). OutputableBndrId p => SplicePointName -> LHsExpr (GhcPass p) -> SDoc
+ Refact.Compat: pprQuals :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
+ Refact.Compat: pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
+ Refact.Compat: pprSplice :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
+ Refact.Compat: pprSpliceDecl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SpliceExplicitFlag -> SDoc
+ Refact.Compat: pprStmt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
+ Refact.Compat: pprStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
+ Refact.Compat: pprStmtInCtxt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => HsStmtContext (IdP (GhcPass idL)) -> StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
+ Refact.Compat: pprTcSpecPrags :: TcSpecPrags -> SDoc
+ Refact.Compat: pprTicks :: SDoc -> SDoc -> SDoc
+ Refact.Compat: pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc
+ Refact.Compat: pprTransformStmt :: forall (p :: Pass). OutputableBndrId p => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) -> Maybe (LHsExpr (GhcPass p)) -> SDoc
+ Refact.Compat: pprTyClDeclFlavour :: forall (p :: Pass). TyClDecl (GhcPass p) -> SDoc
+ Refact.Compat: pprTyFamInstDecl :: forall (p :: Pass). OutputableBndrId p => TopLevelFlag -> TyFamInstDecl (GhcPass p) -> SDoc
+ Refact.Compat: pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc
+ Refact.Compat: ppr_apps :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> [Either (LHsExpr (GhcPass p)) (LHsWcType (NoGhcTc (GhcPass p)))] -> SDoc
+ Refact.Compat: ppr_cmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
+ Refact.Compat: ppr_do_stmts :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => [LStmtLR (GhcPass idL) (GhcPass idR) body] -> SDoc
+ Refact.Compat: ppr_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
+ Refact.Compat: ppr_infix_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> Maybe SDoc
+ Refact.Compat: ppr_lcmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
+ Refact.Compat: ppr_lexpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
+ Refact.Compat: ppr_mbDoc :: Maybe LHsDocString -> SDoc
+ Refact.Compat: ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Refact.Compat: ppr_quasi :: OutputableBndr p => p -> p -> FastString -> SDoc
+ Refact.Compat: ppr_sig :: forall (p :: Pass). OutputableBndrId p => Sig (GhcPass p) -> SDoc
+ Refact.Compat: ppr_splice :: forall (p :: Pass). OutputableBndrId p => SDoc -> IdP (GhcPass p) -> LHsExpr (GhcPass p) -> SDoc -> SDoc
+ Refact.Compat: ppr_splice_decl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
+ Refact.Compat: pragBrackets :: SDoc -> SDoc
+ Refact.Compat: pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc
+ Refact.Compat: rdrNameAmbiguousFieldOcc :: forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
+ Refact.Compat: rdrNameOcc :: RdrName -> OccName
+ Refact.Compat: replaceLWrappedName :: LIEWrappedName name1 -> name2 -> LIEWrappedName name2
+ Refact.Compat: replaceWrappedName :: IEWrappedName name1 -> name2 -> IEWrappedName name2
+ Refact.Compat: resultVariableName :: forall (a :: Pass). FamilyResultSig (GhcPass a) -> Maybe (IdP (GhcPass a))
+ Refact.Compat: roleAnnotDeclName :: forall (p :: Pass). RoleAnnotDecl (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: selectorAmbiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> Id
+ Refact.Compat: setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan
+ Refact.Compat: setRealSrcSpanFile :: FastString -> RealSrcSpan -> RealSrcSpan
+ Refact.Compat: setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan
+ Refact.Compat: showSDocUnsafe :: SDoc -> String
+ Refact.Compat: simpleImportDecl :: forall (p :: Pass). ModuleName -> ImportDecl (GhcPass p)
+ Refact.Compat: splitHsFunType :: LHsType GhcRn -> ([LHsType GhcRn], LHsType GhcRn)
+ Refact.Compat: splitLHsForAllTyInvis :: LHsType pass -> ([LHsTyVarBndr pass], LHsType pass)
+ Refact.Compat: splitLHsInstDeclTy :: LHsSigType GhcRn -> ([Name], LHsContext GhcRn, LHsType GhcRn)
+ Refact.Compat: splitLHsPatSynTy :: LHsType pass -> ([LHsTyVarBndr pass], LHsContext pass, [LHsTyVarBndr pass], LHsContext pass, LHsType pass)
+ Refact.Compat: splitLHsQualTy :: LHsType pass -> (LHsContext pass, LHsType pass)
+ Refact.Compat: splitLHsSigmaTyInvis :: LHsType pass -> ([LHsTyVarBndr pass], LHsContext pass, LHsType pass)
+ Refact.Compat: srcSpanToAnnSpan :: SrcSpan -> AnnSpan
+ Refact.Compat: standaloneKindSigName :: forall (p :: Pass). StandaloneKindSig (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: stringToStringBuffer :: String -> StringBuffer
+ Refact.Compat: tcdName :: forall (p :: Pass). TyClDecl (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: thBrackets :: SDoc -> SDoc -> SDoc
+ Refact.Compat: thTyBrackets :: SDoc -> SDoc
+ Refact.Compat: tupArgPresent :: LHsTupArg id -> Bool
+ Refact.Compat: tyClDeclLName :: forall (p :: Pass). TyClDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Refact.Compat: tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
+ Refact.Compat: tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
+ Refact.Compat: tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
+ Refact.Compat: tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
+ Refact.Compat: tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
+ Refact.Compat: tyFamInstDeclLName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Refact.Compat: tyFamInstDeclName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> IdP (GhcPass p)
+ Refact.Compat: type AnnKeyMap = Map AnnKey [AnnKey]
+ Refact.Compat: type ReplaceWorker a mod = (Annotate a, HasSrcSpan a, Data mod, Data (SrcSpanLess a)) => Anns -> mod -> AnnKeyMap -> Parser a -> Int -> Refactoring SrcSpan -> IO (Anns, mod, AnnKeyMap)
+ Refact.Compat: type BangType pass = HsType pass
+ Refact.Compat: type CmdLStmt id = LStmt id LHsCmd id
+ Refact.Compat: type CmdStmt id = Stmt id LHsCmd id
+ Refact.Compat: type CmdSyntaxTable p = [(Name, HsExpr p)]
+ Refact.Compat: type ConvertIdX a b = (XHsDoublePrim a ~ XHsDoublePrim b, XHsFloatPrim a ~ XHsFloatPrim b, XHsRat a ~ XHsRat b, XHsInteger a ~ XHsInteger b, XHsWord64Prim a ~ XHsWord64Prim b, XHsInt64Prim a ~ XHsInt64Prim b, XHsWordPrim a ~ XHsWordPrim b, XHsIntPrim a ~ XHsIntPrim b, XHsInt a ~ XHsInt b, XHsStringPrim a ~ XHsStringPrim b, XHsString a ~ XHsString b, XHsCharPrim a ~ XHsCharPrim b, XHsChar a ~ XHsChar b, XXLit a ~ XXLit b)
+ Refact.Compat: type ErrorMessages = Bag ErrMsg
+ Refact.Compat: type Errors = ErrorMessages
+ Refact.Compat: type ExprLStmt id = LStmt id LHsExpr id
+ Refact.Compat: type ExprStmt id = Stmt id LHsExpr id
+ Refact.Compat: type FamInstEqn pass rhs = HsImplicitBndrs pass FamEqn pass rhs
+ Refact.Compat: type ForallXABExport (c :: Type -> Constraint) x = (c XABE x, c XXABExport x)
+ Refact.Compat: type ForallXAmbiguousFieldOcc (c :: Type -> Constraint) x = (c XUnambiguous x, c XAmbiguous x, c XXAmbiguousFieldOcc x)
+ Refact.Compat: type ForallXAnnDecl (c :: Type -> Constraint) x = (c XHsAnnotation x, c XXAnnDecl x)
+ Refact.Compat: type ForallXApplicativeArg (c :: Type -> Constraint) x = (c XApplicativeArgOne x, c XApplicativeArgMany x, c XXApplicativeArg x)
+ Refact.Compat: type ForallXBracket (c :: Type -> Constraint) x = (c XExpBr x, c XPatBr x, c XDecBrL x, c XDecBrG x, c XTypBr x, c XVarBr x, c XTExpBr x, c XXBracket x)
+ Refact.Compat: type ForallXClsInstDecl (c :: Type -> Constraint) x = (c XCClsInstDecl x, c XXClsInstDecl x)
+ Refact.Compat: type ForallXCmd (c :: Type -> Constraint) x = (c XCmdArrApp x, c XCmdArrForm x, c XCmdApp x, c XCmdLam x, c XCmdPar x, c XCmdCase x, c XCmdIf x, c XCmdLet x, c XCmdDo x, c XCmdWrap x, c XXCmd x)
+ Refact.Compat: type ForallXCmdTop (c :: Type -> Constraint) x = (c XCmdTop x, c XXCmdTop x)
+ Refact.Compat: type ForallXConDecl (c :: Type -> Constraint) x = (c XConDeclGADT x, c XConDeclH98 x, c XXConDecl x)
+ Refact.Compat: type ForallXConDeclField (c :: Type -> Constraint) x = (c XConDeclField x, c XXConDeclField x)
+ Refact.Compat: type ForallXDefaultDecl (c :: Type -> Constraint) x = (c XCDefaultDecl x, c XXDefaultDecl x)
+ Refact.Compat: type ForallXDerivDecl (c :: Type -> Constraint) x = (c XCDerivDecl x, c XXDerivDecl x)
+ Refact.Compat: type ForallXExpr (c :: Type -> Constraint) x = (c XVar x, c XUnboundVar x, c XConLikeOut x, c XRecFld x, c XOverLabel x, c XIPVar x, c XOverLitE x, c XLitE x, c XLam x, c XLamCase x, c XApp x, c XAppTypeE x, c XOpApp x, c XNegApp x, c XPar x, c XSectionL x, c XSectionR x, c XExplicitTuple x, c XExplicitSum x, c XCase x, c XIf x, c XMultiIf x, c XLet x, c XDo x, c XExplicitList x, c XRecordCon x, c XRecordUpd x, c XExprWithTySig x, c XArithSeq x, c XSCC x, c XCoreAnn x, c XBracket x, c XRnBracketOut x, c XTcBracketOut x, c XSpliceE x, c XProc x, c XStatic x, c XTick x, c XBinTick x, c XTickPragma x, c XWrap x, c XXExpr x)
+ Refact.Compat: type ForallXFamEqn (c :: Type -> Constraint) x r = (c XCFamEqn x r, c XXFamEqn x r)
+ Refact.Compat: type ForallXFamilyDecl (c :: Type -> Constraint) x = (c XCFamilyDecl x, c XXFamilyDecl x)
+ Refact.Compat: type ForallXFamilyResultSig (c :: Type -> Constraint) x = (c XNoSig x, c XCKindSig x, c XTyVarSig x, c XXFamilyResultSig x)
+ Refact.Compat: type ForallXFieldOcc (c :: Type -> Constraint) x = (c XCFieldOcc x, c XXFieldOcc x)
+ Refact.Compat: type ForallXFixitySig (c :: Type -> Constraint) x = (c XFixitySig x, c XXFixitySig x)
+ Refact.Compat: type ForallXForeignDecl (c :: Type -> Constraint) x = (c XForeignImport x, c XForeignExport x, c XXForeignDecl x)
+ Refact.Compat: type ForallXGRHS (c :: Type -> Constraint) x b = (c XCGRHS x b, c XXGRHS x b)
+ Refact.Compat: type ForallXGRHSs (c :: Type -> Constraint) x b = (c XCGRHSs x b, c XXGRHSs x b)
+ Refact.Compat: type ForallXHsBindsLR (c :: Type -> Constraint) x x' = (c XFunBind x x', c XPatBind x x', c XVarBind x x', c XAbsBinds x x', c XPatSynBind x x', c XXHsBindsLR x x')
+ Refact.Compat: type ForallXHsDataDefn (c :: Type -> Constraint) x = (c XCHsDataDefn x, c XXHsDataDefn x)
+ Refact.Compat: type ForallXHsDecl (c :: Type -> Constraint) x = (c XTyClD x, c XInstD x, c XDerivD x, c XValD x, c XSigD x, c XKindSigD x, c XDefD x, c XForD x, c XWarningD x, c XAnnD x, c XRuleD x, c XSpliceD x, c XDocD x, c XRoleAnnotD x, c XXHsDecl x)
+ Refact.Compat: type ForallXHsDerivingClause (c :: Type -> Constraint) x = (c XCHsDerivingClause x, c XXHsDerivingClause x)
+ Refact.Compat: type ForallXHsGroup (c :: Type -> Constraint) x = (c XCHsGroup x, c XXHsGroup x)
+ Refact.Compat: type ForallXHsIPBinds (c :: Type -> Constraint) x = (c XIPBinds x, c XXHsIPBinds x)
+ Refact.Compat: type ForallXHsImplicitBndrs (c :: Type -> Constraint) x b = (c XHsIB x b, c XXHsImplicitBndrs x b)
+ Refact.Compat: type ForallXHsLit (c :: Type -> Constraint) x = (c XHsChar x, c XHsCharPrim x, c XHsDoublePrim x, c XHsFloatPrim x, c XHsInt x, c XHsInt64Prim x, c XHsIntPrim x, c XHsInteger x, c XHsRat x, c XHsString x, c XHsStringPrim x, c XHsWord64Prim x, c XHsWordPrim x, c XXLit x)
+ Refact.Compat: type ForallXHsLocalBindsLR (c :: Type -> Constraint) x x' = (c XHsValBinds x x', c XHsIPBinds x x', c XEmptyLocalBinds x x', c XXHsLocalBindsLR x x')
+ Refact.Compat: type ForallXHsWildCardBndrs (c :: Type -> Constraint) x b = (c XHsWC x b, c XXHsWildCardBndrs x b)
+ Refact.Compat: type ForallXIE (c :: Type -> Constraint) x = (c XIEVar x, c XIEThingAbs x, c XIEThingAll x, c XIEThingWith x, c XIEModuleContents x, c XIEGroup x, c XIEDoc x, c XIEDocNamed x, c XXIE x)
+ Refact.Compat: type ForallXIPBind (c :: Type -> Constraint) x = (c XCIPBind x, c XXIPBind x)
+ Refact.Compat: type ForallXImportDecl (c :: Type -> Constraint) x = (c XCImportDecl x, c XXImportDecl x)
+ Refact.Compat: type ForallXInstDecl (c :: Type -> Constraint) x = (c XClsInstD x, c XDataFamInstD x, c XTyFamInstD x, c XXInstDecl x)
+ Refact.Compat: type ForallXLHsQTyVars (c :: Type -> Constraint) x = (c XHsQTvs x, c XXLHsQTyVars x)
+ Refact.Compat: type ForallXMatch (c :: Type -> Constraint) x b = (c XCMatch x b, c XXMatch x b)
+ Refact.Compat: type ForallXMatchGroup (c :: Type -> Constraint) x b = (c XMG x b, c XXMatchGroup x b)
+ Refact.Compat: type ForallXOverLit (c :: Type -> Constraint) x = (c XOverLit x, c XXOverLit x)
+ Refact.Compat: type ForallXParStmtBlock (c :: Type -> Constraint) x x' = (c XParStmtBlock x x', c XXParStmtBlock x x')
+ Refact.Compat: type ForallXPat (c :: Type -> Constraint) x = (c XWildPat x, c XVarPat x, c XLazyPat x, c XAsPat x, c XParPat x, c XBangPat x, c XListPat x, c XTuplePat x, c XSumPat x, c XViewPat x, c XSplicePat x, c XLitPat x, c XNPat x, c XNPlusKPat x, c XSigPat x, c XCoPat x, c XXPat x)
+ Refact.Compat: type ForallXPatSynBind (c :: Type -> Constraint) x x' = (c XPSB x x', c XXPatSynBind x x')
+ Refact.Compat: type ForallXRoleAnnotDecl (c :: Type -> Constraint) x = (c XCRoleAnnotDecl x, c XXRoleAnnotDecl x)
+ Refact.Compat: type ForallXRuleBndr (c :: Type -> Constraint) x = (c XCRuleBndr x, c XRuleBndrSig x, c XXRuleBndr x)
+ Refact.Compat: type ForallXRuleDecl (c :: Type -> Constraint) x = (c XHsRule x, c XXRuleDecl x)
+ Refact.Compat: type ForallXRuleDecls (c :: Type -> Constraint) x = (c XCRuleDecls x, c XXRuleDecls x)
+ Refact.Compat: type ForallXSig (c :: Type -> Constraint) x = (c XTypeSig x, c XPatSynSig x, c XClassOpSig x, c XIdSig x, c XFixSig x, c XInlineSig x, c XSpecSig x, c XSpecInstSig x, c XMinimalSig x, c XSCCFunSig x, c XCompleteMatchSig x, c XXSig x)
+ Refact.Compat: type ForallXSplice (c :: Type -> Constraint) x = (c XTypedSplice x, c XUntypedSplice x, c XQuasiQuote x, c XSpliced x, c XXSplice x)
+ Refact.Compat: type ForallXSpliceDecl (c :: Type -> Constraint) x = (c XSpliceDecl x, c XXSpliceDecl x)
+ Refact.Compat: type ForallXStmtLR (c :: Type -> Constraint) x x' b = (c XLastStmt x x' b, c XBindStmt x x' b, c XApplicativeStmt x x' b, c XBodyStmt x x' b, c XLetStmt x x' b, c XParStmt x x' b, c XTransStmt x x' b, c XRecStmt x x' b, c XXStmtLR x x' b)
+ Refact.Compat: type ForallXTupArg (c :: Type -> Constraint) x = (c XPresent x, c XMissing x, c XXTupArg x)
+ Refact.Compat: type ForallXTyClDecl (c :: Type -> Constraint) x = (c XFamDecl x, c XSynDecl x, c XDataDecl x, c XClassDecl x, c XXTyClDecl x)
+ Refact.Compat: type ForallXTyClGroup (c :: Type -> Constraint) x = (c XCTyClGroup x, c XXTyClGroup x)
+ Refact.Compat: type ForallXTyVarBndr (c :: Type -> Constraint) x = (c XUserTyVar x, c XKindedTyVar x, c XXTyVarBndr x)
+ Refact.Compat: type ForallXType (c :: Type -> Constraint) x = (c XForAllTy x, c XQualTy x, c XTyVar x, c XAppTy x, c XAppKindTy x, c XFunTy x, c XListTy x, c XTupleTy x, c XSumTy x, c XOpTy x, c XParTy x, c XIParamTy x, c XStarTy x, c XKindSig x, c XSpliceTy x, c XDocTy x, c XBangTy x, c XRecTy x, c XExplicitListTy x, c XExplicitTupleTy x, c XTyLit x, c XWildCardTy x, c XXType x)
+ Refact.Compat: type ForallXValBindsLR (c :: Type -> Constraint) x x' = (c XValBinds x x', c XXValBindsLR x x')
+ Refact.Compat: type ForallXWarnDecl (c :: Type -> Constraint) x = (c XWarning x, c XXWarnDecl x)
+ Refact.Compat: type ForallXWarnDecls (c :: Type -> Constraint) x = (c XWarnings x, c XXWarnDecls x)
+ Refact.Compat: type FunBind = HsMatchContext RdrName
+ Refact.Compat: type GhcPs = GhcPass 'Parsed
+ Refact.Compat: type GhcRn = GhcPass 'Renamed
+ Refact.Compat: type GhcTc = GhcPass 'Typechecked
+ Refact.Compat: type GhcTcId = GhcTc
+ Refact.Compat: type GhciLStmt id = LStmt id LHsExpr id
+ Refact.Compat: type GhciStmt id = Stmt id LHsExpr id
+ Refact.Compat: type GuardLStmt id = LStmt id LHsExpr id
+ Refact.Compat: type GuardStmt id = Stmt id LHsExpr id
+ Refact.Compat: type HsBind id = HsBindLR id id
+ Refact.Compat: type HsConDeclDetails pass = HsConDetails LBangType pass Located [LConDeclField pass]
+ Refact.Compat: type HsConPatDetails p = HsConDetails LPat p HsRecFields p LPat p
+ Refact.Compat: type HsContext pass = [LHsType pass]
+ Refact.Compat: type HsDeriving pass = Located [LHsDerivingClause pass]
+ Refact.Compat: type HsKind pass = HsType pass
+ Refact.Compat: type HsLocalBinds id = HsLocalBindsLR id id
+ Refact.Compat: type HsPatSynDetails arg = HsConDetails arg [RecordPatSynField arg]
+ Refact.Compat: type HsRecField p arg = HsRecField' FieldOcc p arg
+ Refact.Compat: type HsRecUpdField p = HsRecField' AmbiguousFieldOcc p LHsExpr p
+ Refact.Compat: type HsRecordBinds p = HsRecFields p LHsExpr p
+ Refact.Compat: type HsTyPats pass = [LHsTypeArg pass]
+ Refact.Compat: type HsValBinds id = HsValBindsLR id id
+ Refact.Compat: type InPat p = LPat p
+ Refact.Compat: type LAnnDecl pass = Located AnnDecl pass
+ Refact.Compat: type LBangType pass = Located BangType pass
+ Refact.Compat: type LClsInstDecl pass = Located ClsInstDecl pass
+ Refact.Compat: type LConDecl pass = Located ConDecl pass
+ Refact.Compat: type LConDeclField pass = Located ConDeclField pass
+ Refact.Compat: type LDataFamInstDecl pass = Located DataFamInstDecl pass
+ Refact.Compat: type LDefaultDecl pass = Located DefaultDecl pass
+ Refact.Compat: type LDerivDecl pass = Located DerivDecl pass
+ Refact.Compat: type LDerivStrategy pass = Located DerivStrategy pass
+ Refact.Compat: type LDocDecl = Located DocDecl
+ Refact.Compat: type LFamInstEqn pass rhs = Located FamInstEqn pass rhs
+ Refact.Compat: type LFamilyDecl pass = Located FamilyDecl pass
+ Refact.Compat: type LFamilyResultSig pass = Located FamilyResultSig pass
+ Refact.Compat: type LFieldOcc pass = Located FieldOcc pass
+ Refact.Compat: type LFixitySig pass = Located FixitySig pass
+ Refact.Compat: type LForeignDecl pass = Located ForeignDecl pass
+ Refact.Compat: type LGRHS id body = Located GRHS id body
+ Refact.Compat: type LHsBind id = LHsBindLR id id
+ Refact.Compat: type LHsBindLR idL idR = Located HsBindLR idL idR
+ Refact.Compat: type LHsBinds id = LHsBindsLR id id
+ Refact.Compat: type LHsBindsLR idL idR = Bag LHsBindLR idL idR
+ Refact.Compat: type LHsCmd id = Located HsCmd id
+ Refact.Compat: type LHsCmdTop p = Located HsCmdTop p
+ Refact.Compat: type LHsContext pass = Located HsContext pass
+ Refact.Compat: type LHsDecl p = Located HsDecl p
+ Refact.Compat: type LHsDerivingClause pass = Located HsDerivingClause pass
+ Refact.Compat: type LHsDocString = Located HsDocString
+ Refact.Compat: type LHsExpr p = Located HsExpr p
+ Refact.Compat: type LHsFunDep pass = Located FunDep Located IdP pass
+ Refact.Compat: type LHsKind pass = Located HsKind pass
+ Refact.Compat: type LHsLocalBinds id = Located HsLocalBinds id
+ Refact.Compat: type LHsLocalBindsLR idL idR = Located HsLocalBindsLR idL idR
+ Refact.Compat: type LHsRecField p arg = Located HsRecField p arg
+ Refact.Compat: type LHsRecField' p arg = Located HsRecField' p arg
+ Refact.Compat: type LHsRecUpdField p = Located HsRecUpdField p
+ Refact.Compat: type LHsSigType pass = HsImplicitBndrs pass LHsType pass
+ Refact.Compat: type LHsSigWcType pass = HsWildCardBndrs pass LHsSigType pass
+ Refact.Compat: type LHsTupArg id = Located HsTupArg id
+ Refact.Compat: type LHsTyVarBndr pass = Located HsTyVarBndr pass
+ Refact.Compat: type LHsType pass = Located HsType pass
+ Refact.Compat: type LHsTypeArg p = HsArg LHsType p LHsKind p
+ Refact.Compat: type LHsWcType pass = HsWildCardBndrs pass LHsType pass
+ Refact.Compat: type LIE pass = Located IE pass
+ Refact.Compat: type LIEWrappedName name = Located IEWrappedName name
+ Refact.Compat: type LIPBind id = Located IPBind id
+ Refact.Compat: type LIdP p = Located IdP p
+ Refact.Compat: type LImportDecl pass = Located ImportDecl pass
+ Refact.Compat: type LInjectivityAnn pass = Located InjectivityAnn pass
+ Refact.Compat: type LInstDecl pass = Located InstDecl pass
+ Refact.Compat: type LMatch id body = Located Match id body
+ Refact.Compat: type LPat p = XRec p Pat
+ Refact.Compat: type LRoleAnnotDecl pass = Located RoleAnnotDecl pass
+ Refact.Compat: type LRuleBndr pass = Located RuleBndr pass
+ Refact.Compat: type LRuleDecl pass = Located RuleDecl pass
+ Refact.Compat: type LRuleDecls pass = Located RuleDecls pass
+ Refact.Compat: type LSig pass = Located Sig pass
+ Refact.Compat: type LSpliceDecl pass = Located SpliceDecl pass
+ Refact.Compat: type LStandaloneKindSig pass = Located StandaloneKindSig pass
+ Refact.Compat: type LStmt id body = Located StmtLR id id body
+ Refact.Compat: type LStmtLR idL idR body = Located StmtLR idL idR body
+ Refact.Compat: type LTcSpecPrag = Located TcSpecPrag
+ Refact.Compat: type LTyClDecl pass = Located TyClDecl pass
+ Refact.Compat: type LTyFamDefltDecl pass = Located TyFamDefltDecl pass
+ Refact.Compat: type LTyFamInstDecl pass = Located TyFamInstDecl pass
+ Refact.Compat: type LTyFamInstEqn pass = Located TyFamInstEqn pass
+ Refact.Compat: type LWarnDecl pass = Located WarnDecl pass
+ Refact.Compat: type LWarnDecls pass = Located WarnDecls pass
+ Refact.Compat: type Module = Located (HsModule GhcPs)
+ Refact.Compat: type MonadFail' = MonadFail
+ Refact.Compat: type OutPat p = LPat p
+ Refact.Compat: type OutputableBndrId (pass :: Pass) = (OutputableBndr NameOrRdrName IdP GhcPass pass, OutputableBndr IdP GhcPass pass, OutputableBndr NameOrRdrName IdP NoGhcTc GhcPass pass, OutputableBndr IdP NoGhcTc GhcPass pass, NoGhcTc GhcPass pass ~ NoGhcTc NoGhcTc GhcPass pass, OutputableX GhcPass pass, OutputableX NoGhcTc GhcPass pass)
+ Refact.Compat: type OutputableX p = (Outputable XIPBinds p, Outputable XViaStrategy p, Outputable XViaStrategy GhcRn)
+ Refact.Compat: type PostTcExpr = HsExpr GhcTc
+ Refact.Compat: type PostTcTable = [(Name, PostTcExpr)]
+ Refact.Compat: type SplicePointName = Name
+ Refact.Compat: type TyFamDefltDecl = TyFamInstDecl
+ Refact.Compat: type TyFamInstEqn pass = FamInstEqn pass LHsType pass
+ Refact.Compat: type DoGenReplacement ast a = (Data (SrcSpanLess ast), HasSrcSpan ast, Data a) => a -> (ast -> Bool) -> ast -> ast -> StateT ((Anns, AnnKeyMap), Bool) IO ast
+ Refact.Compat: type family SrcSpanLess a
+ Refact.Compat: typeToLHsType :: Type -> LHsType GhcPs
+ Refact.Compat: unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
+ Refact.Compat: unboundVarOcc :: UnboundVar -> OccName
+ Refact.Compat: unguardedGRHSs :: forall body (p :: Pass). Located (body (GhcPass p)) -> GRHSs (GhcPass p) (Located (body (GhcPass p)))
+ Refact.Compat: unguardedRHS :: forall body (p :: Pass). SrcSpan -> Located (body (GhcPass p)) -> [LGRHS (GhcPass p) (Located (body (GhcPass p)))]
+ Refact.Compat: unitRecStmtTc :: RecStmtTc
+ Refact.Compat: unpackHDS :: HsDocString -> String
+ Refact.Compat: unqualQuasiQuote :: RdrName
+ Refact.Compat: xFlags :: [FlagSpec Extension]
+ Refact.Compat: xopt_set :: DynFlags -> Extension -> DynFlags
+ Refact.Compat: xopt_unset :: DynFlags -> Extension -> DynFlags
+ Refact.Utils: foldAnnKey :: forall a. (AnnKey -> a) -> (RealSrcSpan -> AnnConName -> a) -> AnnKey -> a
- Refact.Utils: type Module = (Located (HsModule GhcPs))
+ Refact.Utils: type Module = Located (HsModule GhcPs)

Files

CHANGELOG view
@@ -1,3 +1,7 @@+v0.9.3.0++  * #113, Fix Annotation when context parens are removed+ v0.9.2.0    * #110, Support GHC 9.0.1
apply-refact.cabal view
@@ -1,7 +1,7 @@ cabal-version:       2.4  name:                apply-refact-version:             0.9.2.0+version:             0.9.3.0 synopsis:            Perform refactorings specified by the refact library. description:         Perform refactorings specified by the refact library. It is primarily used with HLint's --refactor flag. license:             BSD-3-Clause@@ -18,7 +18,7 @@                    , tests/examples/*.hs                    , tests/examples/*.hs.refact                    , tests/examples/*.hs.expected-tested-with:         GHC == 9.0.1, GHC == 8.10.3, GHC == 8.8.4, GHC == 8.6.5+tested-with:         GHC == 9.0.1, GHC == 8.10.4, GHC == 8.8.4, GHC == 8.6.5   source-repository head@@ -30,6 +30,7 @@                    , Refact.Apply                    , Refact.Fixity                    , Refact.Internal+                   , Refact.Compat   GHC-Options: -Wall   build-depends: base >=4.12 && < 5                , refact >= 0.2@@ -67,6 +68,7 @@   other-modules:                  Paths_apply_refact                  Refact.Apply+                 Refact.Compat                  Refact.Fixity                  Refact.Internal                  Refact.Options@@ -114,6 +116,7 @@   other-modules:                  Paths_apply_refact                  Refact.Apply+                 Refact.Compat                  Refact.Fixity                  Refact.Internal                  Refact.Options
src/Refact/Apply.hs view
@@ -1,24 +1,24 @@ module Refact.Apply-  ( applyRefactorings-  , applyRefactorings'-  , runRefactoring-  , parseExtensions-  ) where+  ( applyRefactorings,+    applyRefactorings',+    runRefactoring,+    parseExtensions,+  )+where  import Control.Monad (unless) import Data.List (intercalate) import Language.Haskell.GHC.ExactPrint.Types (Anns)+import Refact.Compat (Module) import Refact.Fixity (applyFixities) import Refact.Internal import Refact.Types (Refactoring, SrcSpan)-import Refact.Utils (Module)  -- | Apply a set of refactorings as supplied by HLint-applyRefactorings-  :: Maybe (Int, Int)-  -- ^ Apply hints relevant to a specific position-  -> [[Refactoring SrcSpan]]-  -- ^ 'Refactoring's to apply. Each inner list corresponds to an HLint+applyRefactorings ::+  -- | Apply hints relevant to a specific position+  Maybe (Int, Int) ->+  -- | 'Refactoring's to apply. Each inner list corresponds to an HLint   -- <https://hackage.haskell.org/package/hlint/docs/Language-Haskell-HLint.html#t:Idea Idea>.   -- An @Idea@ may have more than one 'Refactoring'.   --@@ -26,30 +26,32 @@   -- in that order. If two @Idea@s start at the same location, the one with the larger   -- source span comes first. An @Idea@ is filtered out (ignored) if there is an @Idea@   -- prior to it which has an overlapping source span and is not filtered out.-  -> FilePath-  -- ^ Target file-  -> [String]-  -- ^ GHC extensions, e.g., @LambdaCase@, @NoStarIsType@. The list is processed from left+  [[Refactoring SrcSpan]] ->+  -- | Target file+  FilePath ->+  -- | GHC extensions, e.g., @LambdaCase@, @NoStarIsType@. The list is processed from left   -- to right. An extension (e.g., @StarIsType@) may be overridden later (e.g., by @NoStarIsType@).   --   -- These are in addition to the @LANGUAGE@ pragmas in the target file. When they conflict   -- with the @LANGUAGE@ pragmas, pragmas win.-  -> IO String+  [String] ->+  IO String applyRefactorings optionsPos inp file exts = do   let (enabled, disabled, invalid) = parseExtensions exts   unless (null invalid) . fail $ "Unsupported extensions: " ++ intercalate ", " invalid-  (as, m) <- either (onError "apply") (uncurry applyFixities)-              =<< parseModuleWithArgs (enabled, disabled) file+  (as, m) <-+    either (onError "apply") (uncurry applyFixities)+      =<< parseModuleWithArgs (enabled, disabled) file   apply optionsPos False ((mempty,) <$> inp) (Just file) Silent as m  -- | Like 'applyRefactorings', but takes a parsed module rather than a file path to parse.-applyRefactorings'-  :: Maybe (Int, Int)-  -> [[Refactoring SrcSpan]]-  -> Anns-  -- ^ ghc-exactprint AST annotations. This can be obtained from+applyRefactorings' ::+  Maybe (Int, Int) ->+  [[Refactoring SrcSpan]] ->+  -- | ghc-exactprint AST annotations. This can be obtained from   -- 'Language.Haskell.GHC.ExactPrint.Parsers.postParseTransform'.-  -> Module-  -- ^ Parsed module-  -> IO String+  Anns ->+  -- | Parsed module+  Module ->+  IO String applyRefactorings' optionsPos inp = apply optionsPos False ((mempty,) <$> inp) Nothing Silent
+ src/Refact/Compat.hs view
@@ -0,0 +1,408 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE PatternSynonyms #-}++module Refact.Compat (+  -- * ApiAnnotation / GHC.Parser.ApiAnnotation+  AnnKeywordId (..),++  -- * BasicTypes / GHC.Types.Basic+  Fixity (..),+  SourceText (..),++  -- * DynFlags / GHC.Driver.Session+  FlagSpec (..),+  GeneralFlag (..),+  gopt_set,+  gopt_unset,+  parseDynamicFilePragma,+  xopt_set,+  xopt_unset,+  xFlags,++  -- * ErrUtils+  Errors,+  ErrorMessages,+  onError,+  pprErrMsgBagWithLoc,++  -- * FastString / GHC.Data.FastString+  FastString,+  mkFastString,++  -- * HeaderInfo / GHC.Parser.Header+  getOptions,++  -- * HsExpr / GHC.Hs.Expr+  GRHS (..),+  HsExpr (..),+  HsMatchContext (..),+  HsStmtContext (..),+  Match (..),+  MatchGroup (..),+  StmtLR (..),++  -- * HsSyn / GHC.Hs+#if __GLASGOW_HASKELL__ >= 810+  module GHC.Hs,+#else+  module HsSyn,+#endif++  -- * Name / OccName / GHC.Types.Name+  nameOccName,+  occName,+  occNameString,+  ppr,++  -- * Outputable / GHC.Utils.Outputable+  showSDocUnsafe,++  -- * Panic / GHC.Utils.Panic+  handleGhcException,++  -- * RdrName / GHC.Types.Name.Reader+  RdrName (..),+  rdrNameOcc,++  -- * SrcLoc / GHC.Types.SrcLoc+  GenLocated (..),+  pattern RealSrcLoc',+  pattern RealSrcSpan',+  RealSrcSpan (..),+  SrcSpanLess,+  combineSrcSpans,+  composeSrcSpan,+  decomposeSrcSpan,++  -- * StringBuffer+  stringToStringBuffer,++  -- * Misc+  impliedXFlags,++  -- * Non-GHC stuff+  AnnKeyMap,+  FunBind,+  DoGenReplacement,+  Module,+  MonadFail',+  ReplaceWorker,+  annSpanToSrcSpan,+  badAnnSpan,+  mkErr,+  parseModuleName,+  setAnnSpanFile,+  setRealSrcSpanFile,+  setSrcSpanFile,+  srcSpanToAnnSpan,+) where++#if __GLASGOW_HASKELL__ >= 900+import GHC.Data.Bag (unitBag)+import GHC.Data.FastString (FastString, mkFastString)+import GHC.Data.StringBuffer (stringToStringBuffer)+import GHC.Driver.Session hiding (initDynFlags)+import GHC.Parser.Annotation+import GHC.Parser.Header (getOptions)+import GHC.Types.Basic (Fixity (..), SourceText (..))+import GHC.Types.Name (nameOccName, occName, occNameString)+import GHC.Types.Name.Reader (RdrName (..), rdrNameOcc)+import GHC.Types.SrcLoc hiding (spans)+import GHC.Utils.Error+import GHC.Utils.Outputable+  ( ppr,+    showSDocUnsafe,+    pprPanic,+    text,+    vcat,+  )+import GHC.Utils.Panic (handleGhcException)+#else+import ApiAnnotation+#if __GLASGOW_HASKELL__ == 810+import Bag (unitBag)+#endif+import BasicTypes (Fixity (..), SourceText (..))+import ErrUtils+  ( ErrorMessages,+    pprErrMsgBagWithLoc,+#if __GLASGOW_HASKELL__ == 810+    mkPlainErrMsg,+#endif+  )+import DynFlags hiding (initDynFlags)+import FastString (FastString, mkFastString)+import GHC.LanguageExtensions.Type (Extension (..))+import HeaderInfo (getOptions)+import Name (nameOccName)+import OccName (occName, occNameString)+import Outputable+  ( ppr,+    showSDocUnsafe,+#if __GLASGOW_HASKELL__ == 810+    pprPanic,+    text,+    vcat,+#endif+  )+import Panic (handleGhcException)+import RdrName (RdrName (..), rdrNameOcc)+import SrcLoc hiding (spans)+import StringBuffer (stringToStringBuffer)+#endif++#if __GLASGOW_HASKELL__ >= 810+import GHC.Hs hiding (Pat, Stmt)+#elif __GLASGOW_HASKELL__ <= 808+import HsSyn hiding (Pat, Stmt)+#endif++import Control.Monad.Trans.State ( StateT )+import Data.Data ( Data )+import Data.Map.Strict (Map)+import qualified GHC+import Language.Haskell.GHC.ExactPrint.Annotate (Annotate)+import Language.Haskell.GHC.ExactPrint.Delta ( relativiseApiAnns )+import Language.Haskell.GHC.ExactPrint.Parsers (Parser)+import Language.Haskell.GHC.ExactPrint.Types+  ( Anns,+    AnnKey (..),+    AnnSpan,+#if __GLASGOW_HASKELL__ >= 900+    badRealSrcSpan,+#endif+  )+import Refact.Types (Refactoring)++#if __GLASGOW_HASKELL__ <= 806+type MonadFail' = Monad+#else+type MonadFail' = MonadFail+#endif++type AnnKeyMap = Map AnnKey [AnnKey]++#if __GLASGOW_HASKELL__ >= 900+type Module = Located HsModule+#else+type Module = Located (HsModule GhcPs)+#endif++#if __GLASGOW_HASKELL__ >= 810+type Errors = ErrorMessages+onError :: String -> Errors -> a+onError s = pprPanic s . vcat . pprErrMsgBagWithLoc+#else+type Errors = (SrcSpan, String)+onError :: String -> Errors -> a+onError _ = error . show+#endif++#if __GLASGOW_HASKELL__ >= 900+type FunBind = HsMatchContext GhcPs+#else+type FunBind = HsMatchContext RdrName+#endif++pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc+#if __GLASGOW_HASKELL__ >= 900+pattern RealSrcLoc' r <- RealSrcLoc r _ where+  RealSrcLoc' r = RealSrcLoc r Nothing+#else+pattern RealSrcLoc' r <- RealSrcLoc r where+  RealSrcLoc' r = RealSrcLoc r+#endif+{-# COMPLETE RealSrcLoc', UnhelpfulLoc #-}++pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan+#if __GLASGOW_HASKELL__ >= 900+pattern RealSrcSpan' r <- RealSrcSpan r _ where+  RealSrcSpan' r = RealSrcSpan r Nothing+#else+pattern RealSrcSpan' r <- RealSrcSpan r where+  RealSrcSpan' r = RealSrcSpan r+#endif+{-# COMPLETE RealSrcSpan', UnhelpfulSpan #-}++#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900+composeSrcSpan :: a -> a+composeSrcSpan = id++decomposeSrcSpan :: a -> a+decomposeSrcSpan = id++type SrcSpanLess a = a+#endif++badAnnSpan :: AnnSpan+badAnnSpan =+#if __GLASGOW_HASKELL__ >= 900+  badRealSrcSpan+#else+  noSrcSpan+#endif++srcSpanToAnnSpan :: SrcSpan -> AnnSpan+srcSpanToAnnSpan =+#if __GLASGOW_HASKELL__ >= 900+  \case RealSrcSpan l _ -> l; _ -> badRealSrcSpan+#else+  id+#endif++annSpanToSrcSpan :: AnnSpan -> SrcSpan+annSpanToSrcSpan =+#if __GLASGOW_HASKELL__ >= 900+  flip RealSrcSpan Nothing+#else+  id+#endif++setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan+setSrcSpanFile file s+  | RealSrcLoc' start <- srcSpanStart s,+    RealSrcLoc' end <- srcSpanEnd s =+    let start' = mkSrcLoc file (srcLocLine start) (srcLocCol start)+        end' = mkSrcLoc file (srcLocLine end) (srcLocCol end)+     in mkSrcSpan start' end'+setSrcSpanFile _ s = s++setRealSrcSpanFile :: FastString -> RealSrcSpan -> RealSrcSpan+setRealSrcSpanFile file s = mkRealSrcSpan start' end'+  where+    start = realSrcSpanStart s+    end = realSrcSpanEnd s+    start' = mkRealSrcLoc file (srcLocLine start) (srcLocCol start)+    end' = mkRealSrcLoc file (srcLocLine end) (srcLocCol end)++setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan+setAnnSpanFile =+#if __GLASGOW_HASKELL__ >= 900+  setRealSrcSpanFile+#else+  setSrcSpanFile+#endif++mkErr :: DynFlags -> SrcSpan -> String -> Errors+#if __GLASGOW_HASKELL__ >= 810+mkErr df l s = unitBag (mkPlainErrMsg df l (text s))+#else+mkErr = const (,)+#endif++parseModuleName :: SrcSpan -> Parser (Located GHC.ModuleName)+parseModuleName ss _ _ s =+  let newMN =  GHC.L ss (GHC.mkModuleName s)+#if __GLASGOW_HASKELL__ >= 900+      newAnns = relativiseApiAnns newMN (GHC.ApiAnns mempty Nothing mempty mempty)+#else+      newAnns = relativiseApiAnns newMN mempty+#endif+  in pure (newAnns, newMN)++#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900+type DoGenReplacement ast a =+  (Data ast, Data a) =>+  a ->+  (Located ast -> Bool) ->+  Located ast ->+  Located ast ->+  StateT ((Anns, AnnKeyMap), Bool) IO (Located ast)+#else+type DoGenReplacement ast a =+  (Data (SrcSpanLess ast), HasSrcSpan ast, Data a) =>+  a ->+  (ast -> Bool) ->+  ast ->+  ast ->+  StateT ((Anns, AnnKeyMap), Bool) IO ast+#endif++#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900+type ReplaceWorker a mod =+  (Annotate a, Data mod) =>+  Anns ->+  mod ->+  AnnKeyMap ->+  Parser (Located a) ->+  Int ->+  Refactoring SrcSpan ->+  IO (Anns, mod, AnnKeyMap)+#else+type ReplaceWorker a mod =+  (Annotate a, HasSrcSpan a, Data mod, Data (SrcSpanLess a)) =>+  Anns ->+  mod ->+  AnnKeyMap ->+  Parser a ->+  Int ->+  Refactoring SrcSpan ->+  IO (Anns, mod, AnnKeyMap)+#endif++#if __GLASGOW_HASKELL__ < 900+-- | Copied from "Language.Haskell.GhclibParserEx.GHC.Driver.Session", in order to+-- support GHC 8.6+impliedXFlags :: [(Extension, Bool, Extension)]+impliedXFlags+-- See Note [Updating flag description in the User's Guide]+  = [ (RankNTypes,                True, ExplicitForAll)+    , (QuantifiedConstraints,     True, ExplicitForAll)+    , (ScopedTypeVariables,       True, ExplicitForAll)+    , (LiberalTypeSynonyms,       True, ExplicitForAll)+    , (ExistentialQuantification, True, ExplicitForAll)+    , (FlexibleInstances,         True, TypeSynonymInstances)+    , (FunctionalDependencies,    True, MultiParamTypeClasses)+    , (MultiParamTypeClasses,     True, ConstrainedClassMethods)  -- c.f. #7854+    , (TypeFamilyDependencies,    True, TypeFamilies)++    , (RebindableSyntax, False, ImplicitPrelude)      -- NB: turn off!++    , (DerivingVia, True, DerivingStrategies)++    , (GADTs,            True, GADTSyntax)+    , (GADTs,            True, MonoLocalBinds)+    , (TypeFamilies,     True, MonoLocalBinds)++    , (TypeFamilies,     True, KindSignatures)  -- Type families use kind signatures+    , (PolyKinds,        True, KindSignatures)  -- Ditto polymorphic kinds++    -- TypeInType is now just a synonym for a couple of other extensions.+    , (TypeInType,       True, DataKinds)+    , (TypeInType,       True, PolyKinds)+    , (TypeInType,       True, KindSignatures)++    -- AutoDeriveTypeable is not very useful without DeriveDataTypeable+    , (AutoDeriveTypeable, True, DeriveDataTypeable)++    -- We turn this on so that we can export associated type+    -- type synonyms in subordinates (e.g. MyClass(type AssocType))+    , (TypeFamilies,     True, ExplicitNamespaces)+    , (TypeOperators, True, ExplicitNamespaces)++    , (ImpredicativeTypes,  True, RankNTypes)++        -- Record wild-cards implies field disambiguation+        -- Otherwise if you write (C {..}) you may well get+        -- stuff like " 'a' not in scope ", which is a bit silly+        -- if the compiler has just filled in field 'a' of constructor 'C'+    , (RecordWildCards,     True, DisambiguateRecordFields)++    , (ParallelArrays, True, ParallelListComp)++    , (JavaScriptFFI, True, InterruptibleFFI)++    , (DeriveTraversable, True, DeriveFunctor)+    , (DeriveTraversable, True, DeriveFoldable)++    -- Duplicate record fields require field disambiguation+    , (DuplicateRecordFields, True, DisambiguateRecordFields)++    , (TemplateHaskell, True, TemplateHaskellQuotes)+    , (Strict, True, StrictData)+#if __GLASGOW_HASKELL__ >= 810+    , (StandaloneKindSignatures, False, CUSKs)+#endif+  ]+#endif
src/Refact/Fixity.hs view
@@ -1,53 +1,30 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE ViewPatterns #-}  module Refact.Fixity (applyFixities) where -import Refact.Utils--#if __GLASGOW_HASKELL__ >= 810-import GHC.Hs-#else-import HsExpr-import HsExtension hiding (noExt)-#endif--#if __GLASGOW_HASKELL__ >= 900-import GHC.Parser.Annotation-import GHC.Types.Basic (Fixity(..), defaultFixity, compareFixity, negateFixity, FixityDirection(..), SourceText(..))-import GHC.Types.Name.Occurrence-import GHC.Types.Name.Reader-import GHC.Types.SrcLoc-#else-import ApiAnnotation-import BasicTypes (Fixity(..), defaultFixity, compareFixity, negateFixity, FixityDirection(..), SourceText(..))-import RdrName-import OccName-import SrcLoc-#endif-+import Control.Monad.Trans.State import Data.Generics hiding (Fixity) import Data.List-import Data.Maybe-import Language.Haskell.GHC.ExactPrint.Types hiding (GhcPs, GhcTc, GhcRn)--import Control.Monad.Trans.State import qualified Data.Map as Map+import Data.Maybe import Data.Tuple+import qualified GHC+import Language.Haskell.GHC.ExactPrint.Types hiding (GhcPs, GhcRn, GhcTc)+import Refact.Compat (Fixity (..), SourceText (..), occNameString, rdrNameOcc)+import Refact.Utils  -- | Rearrange infix expressions to account for fixity. -- The set of fixities is wired in and includes all fixities in base. applyFixities :: Anns -> Module -> IO (Anns, Module) applyFixities as m = swap <$> runStateT (everywhereM (mkM expFix) m) as -expFix :: LHsExpr GhcPs -> StateT Anns IO (LHsExpr GhcPs)-expFix (L loc (OpApp _ l op r)) =+expFix :: Expr -> StateT Anns IO Expr+expFix (GHC.L loc (GHC.OpApp _ l op r)) =   mkOpAppRn baseFixities loc l op (findFixity baseFixities op) r- expFix e = return e  getIdent :: Expr -> String-getIdent (unLoc -> HsVar _ (L _ n)) = occNameString . rdrNameOcc $ n+getIdent (GHC.unLoc -> GHC.HsVar _ (GHC.L _ n)) = occNameString . rdrNameOcc $ n getIdent _ = error "Must be HsVar"  -- | Move the delta position from one annotation to another:@@ -59,108 +36,109 @@ moveDelta :: Annotation -> AnnKey -> AnnKey -> StateT Anns IO () moveDelta oldAnn oldKey newKey = do   -- If the old annotation has a unary minus operator, add it to the new annotation.-  let newAnnsDP | Just dp <- find ((== G AnnMinus) . fst) (annsDP oldAnn) = [dp]-                | otherwise = []-  modify . Map.insert newKey $ annNone-    { annEntryDelta = annEntryDelta oldAnn-    , annPriorComments = annPriorComments oldAnn-    , annsDP = newAnnsDP-    }+  let newAnnsDP+        | Just dp <- find ((== G GHC.AnnMinus) . fst) (annsDP oldAnn) = [dp]+        | otherwise = []+  modify . Map.insert newKey $+    annNone+      { annEntryDelta = annEntryDelta oldAnn,+        annPriorComments = annPriorComments oldAnn,+        annsDP = newAnnsDP+      }    -- If the old key is still there, reset the value.-  modify $ Map.adjust (\a -> a { annEntryDelta = DP (0,0), annPriorComments = []}) oldKey+  modify $ Map.adjust (\a -> a {annEntryDelta = DP (0, 0), annPriorComments = []}) oldKey  --------------------------- -- Modified from GHC Renamer mkOpAppRn ::-             [(String, Fixity)]-          -> SrcSpan-          -> LHsExpr GhcPs              -- Left operand; already rearrange-          -> LHsExpr GhcPs -> Fixity    -- Operator and fixity-          -> LHsExpr GhcPs              -- Right operand (not an OpApp, but might-                                        -- be a NegApp)-          -> StateT Anns IO (LHsExpr GhcPs)-+  [(String, GHC.Fixity)] ->+  GHC.SrcSpan ->+  Expr -> -- Left operand; already rearrange+  Expr ->+  GHC.Fixity -> -- Operator and fixity+  Expr -> -- Right operand (not an OpApp, but might+  -- be a NegApp)+  StateT Anns IO Expr -- (e11 `op1` e12) `op2` e2-mkOpAppRn fs loc e1@(L _ (OpApp x1 e11 op1 e12)) op2 fix2 e2-  | nofix_error-  = return $ L loc (OpApp noExt e1 op2 e2)-+mkOpAppRn fs loc e1@(GHC.L _ (GHC.OpApp x1 e11 op1 e12)) op2 fix2 e2+  | nofix_error =+    return $ GHC.L loc (GHC.OpApp noExt e1 op2 e2)   | associate_right = do     let oldKey = mkAnnKey e12     oldAnn <- gets $ Map.findWithDefault annNone oldKey     new_e <- mkOpAppRn fs loc' e12 op2 fix2 e2     let newKey = mkAnnKey new_e     moveDelta oldAnn oldKey newKey-    return $ L loc (OpApp x1 e11 op1 new_e)+    return $ GHC.L loc (GHC.OpApp x1 e11 op1 new_e)   where-    loc'= combineLocs e12 e2+    loc' = GHC.combineLocs e12 e2     fix1 = findFixity fs op1-    (nofix_error, associate_right) = compareFixity fix1 fix2+    (nofix_error, associate_right) = GHC.compareFixity fix1 fix2  --------------------------- --      (- neg_arg) `op` e2-mkOpAppRn fs loc e1@(L _ (NegApp _ neg_arg neg_name)) op2 fix2 e2-  | nofix_error-  = return (L loc (OpApp noExt e1 op2 e2))--  | associate_right-  = do+mkOpAppRn fs loc e1@(GHC.L _ (GHC.NegApp _ neg_arg neg_name)) op2 fix2 e2+  | nofix_error =+    return (GHC.L loc (GHC.OpApp noExt e1 op2 e2))+  | associate_right =+    do       let oldKey = mkAnnKey neg_arg       oldAnn <- gets $ Map.findWithDefault annNone oldKey       new_e <- mkOpAppRn fs loc' neg_arg op2 fix2 e2       let newKey = mkAnnKey new_e       moveDelta oldAnn oldKey newKey-      let res = L loc (NegApp noExt new_e neg_name)+      let res = GHC.L loc (GHC.NegApp noExt new_e neg_name)           key = mkAnnKey res-          ak  = AnnKey (srcSpanToAnnSpan loc) (CN "OpApp")+          ak = AnnKey (srcSpanToAnnSpan loc) (CN "OpApp")       opAnn <- gets (fromMaybe annNone . Map.lookup ak)       negAnns <- gets (fromMaybe annNone . Map.lookup (mkAnnKey e1))-      modify $ Map.insert key (annNone { annEntryDelta = annEntryDelta opAnn, annsDP = annsDP negAnns })+      modify $ Map.insert key (annNone {annEntryDelta = annEntryDelta opAnn, annsDP = annsDP negAnns})       modify $ Map.delete (mkAnnKey e1)       return res   where-    loc' = combineLocs neg_arg e2-    (nofix_error, associate_right) = compareFixity negateFixity fix2+    loc' = GHC.combineLocs neg_arg e2+    (nofix_error, associate_right) = GHC.compareFixity GHC.negateFixity fix2  --------------------------- --      e1 `op` - neg_arg-mkOpAppRn _ loc e1 op1 fix1 e2@(L _ NegApp{})     -- NegApp can occur on the right-  | not associate_right                 -- We *want* right association-  = return $ L loc (OpApp noExt e1 op1 e2)+mkOpAppRn _ loc e1 op1 fix1 e2@(GHC.L _ GHC.NegApp {}) -- NegApp can occur on the right+  | not associate_right -- We *want* right association+    =+    return $ GHC.L loc (GHC.OpApp noExt e1 op1 e2)   where-    (_, associate_right) = compareFixity fix1 negateFixity+    (_, associate_right) = GHC.compareFixity fix1 GHC.negateFixity  --------------------------- --      Default case-mkOpAppRn _ loc e1 op _fix e2                  -- Default case, no rearrangment-  = return $ L loc (OpApp noExt e1 op e2)+mkOpAppRn _ loc e1 op _fix e2 -- Default case, no rearrangment+  =+  return $ GHC.L loc (GHC.OpApp noExt e1 op e2) -findFixity :: [(String, Fixity)] -> Expr -> Fixity+findFixity :: [(String, GHC.Fixity)] -> Expr -> GHC.Fixity findFixity fs r = askFix fs (getIdent r) -askFix :: [(String, Fixity)] -> String -> Fixity-askFix xs = \k -> lookupWithDefault defaultFixity k xs-    where-        lookupWithDefault def_v k mp1 = fromMaybe def_v $ lookup k mp1--+askFix :: [(String, GHC.Fixity)] -> String -> GHC.Fixity+askFix xs = \k -> lookupWithDefault GHC.defaultFixity k xs+  where+    lookupWithDefault def_v k mp1 = fromMaybe def_v $ lookup k mp1  -- | All fixities defined in the Prelude.-preludeFixities :: [(String, Fixity)]-preludeFixities = concat-    [infixr_ 9  ["."]-    ,infixl_ 9  ["!!"]-    ,infixr_ 8  ["^","^^","**"]-    ,infixl_ 7  ["*","/","quot","rem","div","mod",":%","%"]-    ,infixl_ 6  ["+","-"]-    ,infixr_ 5  [":","++"]-    ,infix_  4  ["==","/=","<","<=",">=",">","elem","notElem"]-    ,infixr_ 3  ["&&"]-    ,infixr_ 2  ["||"]-    ,infixl_ 1  [">>",">>="]-    ,infixr_ 1  ["=<<"]-    ,infixr_ 0  ["$","$!","seq"]+preludeFixities :: [(String, GHC.Fixity)]+preludeFixities =+  concat+    [ infixr_ 9 ["."],+      infixl_ 9 ["!!"],+      infixr_ 8 ["^", "^^", "**"],+      infixl_ 7 ["*", "/", "quot", "rem", "div", "mod", ":%", "%"],+      infixl_ 6 ["+", "-"],+      infixr_ 5 [":", "++"],+      infix_ 4 ["==", "/=", "<", "<=", ">=", ">", "elem", "notElem"],+      infixr_ 3 ["&&"],+      infixr_ 2 ["||"],+      infixl_ 1 [">>", ">>="],+      infixr_ 1 ["=<<"],+      infixr_ 0 ["$", "$!", "seq"]     ]  -- | All fixities defined in the base package.@@ -168,31 +146,33 @@ --   Note that the @+++@ operator appears in both Control.Arrows and --   Text.ParserCombinators.ReadP. The listed precedence for @+++@ in --   this list is that of Control.Arrows.-baseFixities :: [(String, Fixity)]-baseFixities = preludeFixities ++ concat-    [infixl_ 9 ["!","//","!:"]-    ,infixl_ 8 ["shift","rotate","shiftL","shiftR","rotateL","rotateR"]-    ,infixl_ 7 [".&."]-    ,infixl_ 6 ["xor"]-    ,infix_  6 [":+"]-    ,infixl_ 5 [".|."]-    ,infixr_ 5 ["+:+","<++","<+>"] -- fixity conflict for +++ between ReadP and Arrow-    ,infix_  5 ["\\\\"]-    ,infixl_ 4 ["<$>","<$","<*>","<*","*>","<**>"]-    ,infix_  4 ["elemP","notElemP"]-    ,infixl_ 3 ["<|>"]-    ,infixr_ 3 ["&&&","***"]-    ,infixr_ 2 ["+++","|||"]-    ,infixr_ 1 ["<=<",">=>",">>>","<<<","^<<","<<^","^>>",">>^"]-    ,infixl_ 0 ["on"]-    ,infixr_ 0 ["par","pseq"]-    ]+baseFixities :: [(String, GHC.Fixity)]+baseFixities =+  preludeFixities+    ++ concat+      [ infixl_ 9 ["!", "//", "!:"],+        infixl_ 8 ["shift", "rotate", "shiftL", "shiftR", "rotateL", "rotateR"],+        infixl_ 7 [".&."],+        infixl_ 6 ["xor"],+        infix_ 6 [":+"],+        infixl_ 5 [".|."],+        infixr_ 5 ["+:+", "<++", "<+>"], -- fixity conflict for +++ between ReadP and Arrow+        infix_ 5 ["\\\\"],+        infixl_ 4 ["<$>", "<$", "<*>", "<*", "*>", "<**>"],+        infix_ 4 ["elemP", "notElemP"],+        infixl_ 3 ["<|>"],+        infixr_ 3 ["&&&", "***"],+        infixr_ 2 ["+++", "|||"],+        infixr_ 1 ["<=<", ">=>", ">>>", "<<<", "^<<", "<<^", "^>>", ">>^"],+        infixl_ 0 ["on"],+        infixr_ 0 ["par", "pseq"]+      ] -infixr_, infixl_, infix_ :: Int -> [String] -> [(String,Fixity)]-infixr_ = fixity InfixR-infixl_ = fixity InfixL-infix_  = fixity InfixN+infixr_, infixl_, infix_ :: Int -> [String] -> [(String, GHC.Fixity)]+infixr_ = fixity GHC.InfixR+infixl_ = fixity GHC.InfixL+infix_ = fixity GHC.InfixN  -- Internal: help function for the above definitions.-fixity :: FixityDirection -> Int -> [String] -> [(String, Fixity)]+fixity :: GHC.FixityDirection -> Int -> [String] -> [(String, GHC.Fixity)] fixity a p = map (,Fixity (SourceText "") p a)
src/Refact/Internal.hs view
@@ -1,935 +1,828 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE ExplicitNamespaces #-}-{-# LANGUAGE PatternSynonyms #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE ViewPatterns #-}-module Refact.Internal-  ( apply-  , runRefactoring-  , addExtensionsToFlags-  , parseModuleWithArgs-  , parseExtensions--  -- * Support for runPipe in the main process-  , Verbosity(..)-  , rigidLayout-  , refactOptions-  , type Errors-  , onError-  , mkErr-  )  where--import Control.Exception-import Control.Monad-import Control.Monad.IO.Class (MonadIO(..))-import Control.Monad.Trans.Maybe (MaybeT(..))-import Control.Monad.Trans.State-import Data.Char (isAlphaNum)-import Data.Data-import Data.Foldable (foldlM, for_)-import Data.Functor.Identity (Identity(..))-import Data.Generics (everywhereM, extM, listify, mkM, mkQ, something)-import Data.Generics.Uniplate.Data (transformBi, transformBiM, universeBi)-import Data.IORef.Extra-import qualified Data.Map as Map-import Data.Maybe (catMaybes, fromMaybe, listToMaybe, mapMaybe)-import Data.List.Extra-import Data.Ord (comparing)-import Data.Set (Set)-import qualified Data.Set as Set-import Data.Tuple.Extra-import Debug.Trace--import qualified GHC hiding (parseModule)--#if __GLASGOW_HASKELL__ >= 900-import GHC.Data.Bag-import GHC.Data.StringBuffer (stringToStringBuffer)-import GHC.Driver.Session hiding (initDynFlags)-import GHC.Driver.Types (handleSourceError)-import GHC.Parser.Header (getOptions)-import qualified GHC.Types.Name as GHC-import qualified GHC.Types.Name.Reader as GHC-import GHC.Types.SrcLoc hiding (spans)-import GHC.Utils.Error-import GHC.Utils.Outputable hiding ((<>))-import GHC.Utils.Panic (handleGhcException)-#else-import DynFlags hiding (initDynFlags)-import HeaderInfo (getOptions)-import HscTypes (handleSourceError)-import qualified Name as GHC-import Outputable hiding ((<>))-import Panic (handleGhcException)-import qualified RdrName as GHC-import SrcLoc hiding (spans)-import StringBuffer (stringToStringBuffer)-#endif--#if __GLASGOW_HASKELL__ >= 810-import GHC.Hs.Expr as GHC hiding (Stmt)-import GHC.Hs.ImpExp-import GHC.Hs hiding (Pat, Stmt)-#elif __GLASGOW_HASKELL__ <= 808-import HsExpr as GHC hiding (Stmt)-import HsImpExp-import HsSyn hiding (Pat, Stmt, noExt)-#endif--#if __GLASGOW_HASKELL__ == 810-import Bag-import ErrUtils-#endif--import GHC.IO.Exception (IOErrorType(..))-import GHC.LanguageExtensions.Type (Extension(..))-import Language.Haskell.GHC.ExactPrint-import Language.Haskell.GHC.ExactPrint.Annotate-import Language.Haskell.GHC.ExactPrint.Delta-import Language.Haskell.GHC.ExactPrint.Parsers-import Language.Haskell.GHC.ExactPrint.Print-import Language.Haskell.GHC.ExactPrint.Types hiding (GhcPs, GhcTc, GhcRn)-import Language.Haskell.GHC.ExactPrint.Utils hiding (rs)-import System.IO.Error (mkIOError)-import System.IO.Extra-import System.IO.Unsafe (unsafePerformIO)--import Refact.Types hiding (SrcSpan)-import qualified Refact.Types as R-import Refact.Utils (Stmt, Pat, Name, Decl, M, Module, Expr, Type, FunBind, AnnKeyMap-                    , pattern RealSrcSpan'-                    , modifyAnnKey, replaceAnnKey, Import, toGhcSrcSpan, toGhcSrcSpan'-                    , annSpanToSrcSpan, srcSpanToAnnSpan, setSrcSpanFile, setAnnSpanFile, getAnnSpan)--#if __GLASGOW_HASKELL__ >= 810-type Errors = ErrorMessages-onError :: String -> Errors -> a-onError s = pprPanic s . vcat . pprErrMsgBagWithLoc-#else-type Errors = (SrcSpan, String)-onError :: String -> Errors -> a-onError _ = error . show-#endif--#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900-composeSrcSpan :: a -> a-composeSrcSpan = id--decomposeSrcSpan :: a -> a-decomposeSrcSpan = id--type SrcSpanLess a = a-#endif---- library access to perform the substitutions--refactOptions :: PrintOptions Identity String-refactOptions = stringOptions { epRigidity = RigidLayout }--rigidLayout :: DeltaOptions-rigidLayout = deltaOptions RigidLayout---- | Apply a set of refactorings as supplied by hlint-apply-  :: Maybe (Int, Int)-  -> Bool-  -> [(String, [Refactoring R.SrcSpan])]-  -> Maybe FilePath-  -> Verbosity-  -> Anns-  -> Module-  -> IO String-apply mpos step inp mbfile verb as0 m0 = do-  toGhcSS <--    maybe-      ( case getLoc m0 of-          UnhelpfulSpan s -> fail $ "Module has UnhelpfulSpan: " ++ show s-          RealSrcSpan' s ->-            pure $ toGhcSrcSpan' (srcSpanFile s)-      )-      (pure . toGhcSrcSpan)-      mbfile-  let allRefacts :: [((String, [Refactoring SrcSpan]), R.SrcSpan)]-      allRefacts =-        sortBy cmpSrcSpan-        . map (first . second . map . fmap $ toGhcSS)-        . mapMaybe (sequenceA . (id &&& aggregateSrcSpans . map pos . snd))-        . filter (maybe (const True) (\p -> any ((`spans` p) . pos) . snd) mpos)-        $ inp--      cmpSrcSpan (_, s1) (_, s2) =-        comparing startLine s1 s2 <> -- s1 first if it starts on earlier line-        comparing startCol s1 s2 <>  --             or on earlier column-        comparing endLine s2 s1 <>   -- they start in same place, s2 comes-        comparing endCol s2 s1       -- first if it ends later-        -- else, completely same span, so s1 will be first--  when (verb >= Normal) . traceM $-    "Applying " ++ (show . sum . map (length . snd . fst) $ allRefacts) ++ " hints"-  when (verb == Loud) . traceM $ show (map fst allRefacts)--  (as, m) <- if step-               then fromMaybe (as0, m0) <$> runMaybeT (refactoringLoop as0 m0 allRefacts)-               else evalStateT (runRefactorings verb as0 m0 (first snd <$> allRefacts)) 0-  pure . runIdentity $ exactPrintWithOptions refactOptions m as--spans :: R.SrcSpan -> (Int, Int) -> Bool-spans R.SrcSpan{..} loc = (startLine, startCol) <= loc && loc <= (endLine, endCol)--aggregateSrcSpans :: [R.SrcSpan] -> Maybe R.SrcSpan-aggregateSrcSpans = \case-  [] -> Nothing-  rs -> Just (foldr1 alg rs)-  where-    alg (R.SrcSpan sl1 sc1 el1 ec1) (R.SrcSpan sl2 sc2 el2 ec2) =-      let (sl, sc) = case compare sl1 sl2 of-                      LT -> (sl1, sc1)-                      EQ -> (sl1, min sc1 sc2)-                      GT -> (sl2, sc2)-          (el, ec) = case compare el1 el2 of-                      LT -> (el2, ec2)-                      EQ -> (el2, max ec1 ec2)-                      GT -> (el1, ec1)-       in R.SrcSpan sl sc el ec--runRefactorings-  :: Verbosity-  -> Anns-  -> Module-  -> [([Refactoring SrcSpan], R.SrcSpan)]-  -> StateT Int IO (Anns, Module)-runRefactorings verb as0 m0 ((rs, ss) : rest) = do-  runRefactorings' verb as0 m0 rs >>= \case-    Nothing -> runRefactorings verb as0 m0 rest-    Just (as, m) -> do-      let (overlaps, rest') = span (overlap ss . snd) rest-      when (verb >= Normal) . for_ overlaps $ \(rs', _) ->-        traceM $ "Ignoring " ++ show rs' ++ " due to overlap."-      runRefactorings verb as m rest'-runRefactorings _ as m [] = pure (as, m)--runRefactorings'-  :: Verbosity-  -> Anns-  -> Module-  -> [Refactoring SrcSpan]-  -> StateT Int IO (Maybe (Anns, Module))-runRefactorings' verb as0 m0 rs = do-  seed <- get-  (as, m, keyMap) <- foldlM (uncurry3 runRefactoring) (as0, m0, Map.empty) rs-  if droppedComments as m keyMap-    then-      do-        put seed-        when (verb >= Normal) . traceM $-          "Ignoring " ++ show rs ++ " since applying them would cause comments to be dropped."-        pure Nothing-    else pure $ Just (as, m)--overlap :: R.SrcSpan -> R.SrcSpan -> Bool-overlap s1 s2 =-  -- We know s1 always starts <= s2, due to our sort-  case compare (startLine s2) (endLine s1) of-    LT -> True-    EQ -> startCol s2 <= endCol s1-    GT -> False--data LoopOption = LoopOption-  { desc    :: String-  , perform :: MaybeT IO (Anns, Module)-  }--refactoringLoop-  :: Anns-  -> Module-  -> [((String, [Refactoring SrcSpan]), R.SrcSpan)]-  -> MaybeT IO (Anns, Module)-refactoringLoop as m [] = pure (as, m)-refactoringLoop as m (((_, []), _): rs) = refactoringLoop as m rs-refactoringLoop as0 m0 hints@(((hintDesc, rs), ss): rss) = do-    res <- liftIO . flip evalStateT 0 $ runRefactorings' Silent as0 m0 rs-    let yAction = case res of-          Just (as, m) -> do-            exactPrint m as `seq` pure ()-            refactoringLoop as m $ dropWhile (overlap ss . snd) rss-          Nothing -> do-            liftIO $ putStrLn "Hint skipped since applying it would cause comments to be dropped"-            refactoringLoop as0 m0 rss-        opts =-          [ ("y", LoopOption "Apply current hint" yAction)-          , ("n", LoopOption "Don't apply the current hint" (refactoringLoop as0 m0 rss))-          , ("q", LoopOption "Apply no further hints" (pure (as0, m0)))-          , ("d", LoopOption "Discard previous changes" mzero )-          , ("v", LoopOption "View current file" (liftIO (putStrLn (exactPrint m0 as0))-                                                  >> refactoringLoop as0 m0 hints))-          , ("?", LoopOption "Show this help menu" loopHelp)]-        loopHelp = do-          liftIO . putStrLn . unlines . map mkLine $ opts-          refactoringLoop as0 m0 hints-        mkLine (c, opt) = c ++ " - " ++ desc opt-    inp <- liftIO $ do-      putStrLn hintDesc-      putStrLn $ "Apply hint [" ++ intercalate ", " (map fst opts) ++ "]"-      -- In case that the input also comes from stdin-      withFile "/dev/tty" ReadMode hGetLine-    maybe loopHelp perform (lookup inp opts)--data Verbosity = Silent | Normal | Loud deriving (Eq, Show, Ord)---- ------------------------------------------------------------------------- Perform the substitutions---- | Peform a @Refactoring@.-runRefactoring-  :: Data a-  => Anns-  -> a-  -> AnnKeyMap-  -> Refactoring SrcSpan-  -> StateT Int IO (Anns, a, AnnKeyMap)-runRefactoring as m keyMap = \case-  r@Replace{} -> do-    seed <- get <* modify (+1)-    liftIO $ case rtype r of-      Expr -> replaceWorker as m keyMap parseExpr seed r-      Decl -> replaceWorker as m keyMap parseDecl seed r-      Type -> replaceWorker as m keyMap parseType seed r-      Pattern -> replaceWorker as m keyMap parsePattern seed r-      Stmt -> replaceWorker as m keyMap parseStmt seed r-      Bind -> replaceWorker as m keyMap parseBind seed r-      R.Match ->  replaceWorker as m keyMap parseMatch seed r-      ModuleName -> replaceWorker as m keyMap (parseModuleName (pos r)) seed r-      Import -> replaceWorker as m keyMap parseImport seed r--  ModifyComment{..} -> pure (Map.map go as, m, keyMap)-    where-      go a@Ann{ annPriorComments, annsDP } =-        a { annsDP = map changeComment annsDP-          , annPriorComments = map (first change) annPriorComments }-      changeComment (AnnComment d, dp) = (AnnComment (change d), dp)-      changeComment e = e-      change old@Comment{..}= if ss2pos (annSpanToSrcSpan commentIdentifier) == ss2pos pos-                                          then old { commentContents = newComment}-                                          else old-  Delete{rtype, pos} -> pure (as, f m, keyMap)-    where-      annSpan = srcSpanToAnnSpan pos-      f = case rtype of-        Stmt -> doDeleteStmt ((/= annSpan) . getAnnSpan)-        Import -> doDeleteImport ((/= annSpan) . getAnnSpan)-        _ -> id--  InsertComment{..} -> do-    exprkey <- mkAnnKey <$> findOrError @(HsDecl GhcPs) m (srcSpanToAnnSpan pos)-    pure (insertComment exprkey newComment as, m, keyMap)--  RemoveAsKeyword{..} -> pure (as, removeAsKeyword m, keyMap)-    where-      removeAsKeyword = transformBi go-      go :: LImportDecl GHC.GhcPs -> LImportDecl GHC.GhcPs-      go imp@(GHC.L l i)-        | srcSpanToAnnSpan l == srcSpanToAnnSpan pos = GHC.L l (i { ideclAs = Nothing })-        | otherwise =  imp--droppedComments :: Anns -> Module -> AnnKeyMap -> Bool-droppedComments as m keyMap = any (all (`Set.notMember` allSpans)) spanssWithComments-  where-    spanssWithComments =-      map (\(key, _) -> map keySpan $ key : Map.findWithDefault [] key keyMap)-      . filter (\(_, v) -> notNull (annPriorComments v) || notNull (annFollowingComments v))-      $ Map.toList as--    keySpan (AnnKey ss _) = ss--    allSpans :: Set AnnSpan-    allSpans = Set.fromList . fmap srcSpanToAnnSpan $ universeBi m---- Specialised parsers-mkErr :: GHC.DynFlags -> SrcSpan -> String -> Errors-#if __GLASGOW_HASKELL__ >= 810-mkErr df l s = unitBag (mkPlainErrMsg df l (text s))-#else-mkErr = const (,)-#endif--parseModuleName :: SrcSpan -> Parser (GHC.Located GHC.ModuleName)-parseModuleName ss _ _ s =-  let newMN =  GHC.L ss (GHC.mkModuleName s)-#if __GLASGOW_HASKELL__ >= 900-      newAnns = relativiseApiAnns newMN (GHC.ApiAnns mempty Nothing mempty mempty)-#else-      newAnns = relativiseApiAnns newMN mempty-#endif-  in pure (newAnns, newMN)-parseBind :: Parser (GHC.LHsBind GHC.GhcPs)-parseBind dyn fname s =-  case parseDecl dyn fname s of-    -- Safe as we add no annotations to the ValD-    Right (as, GHC.L l (GHC.ValD _ b)) -> Right (as, GHC.L l b)-    Right (_, GHC.L l _) -> Left (mkErr dyn l "Not a HsBind")-    Left e -> Left e-parseMatch :: Parser (GHC.LMatch GHC.GhcPs (GHC.LHsExpr GHC.GhcPs))-parseMatch dyn fname s =-  case parseBind dyn fname s of-    Right (as, GHC.L l GHC.FunBind{fun_matches}) ->-      case unLoc (GHC.mg_alts fun_matches) of-           [x] -> Right (as, x)-           _   -> Left (mkErr dyn l "Not a single match")-    Right (_, GHC.L l _) -> Left (mkErr dyn l "Not a funbind")-    Left e -> Left e---- Substitute variables into templates--- Finds places in the templates where we need to insert variables.--substTransform :: (Data a, Data b) => b -> [(String, SrcSpan)] -> a -> M a-substTransform m ss = everywhereM (mkM (typeSub m ss)-                                    `extM` identSub m ss-                                    `extM` patSub m ss-                                    `extM` stmtSub m ss-                                    `extM` exprSub m ss-                                    )--stmtSub :: Data a => a -> [(String, SrcSpan)] -> Stmt -> M Stmt-stmtSub m subs old@(GHC.L _ (BodyStmt _ (GHC.L _ (HsVar _ (L _ name))) _ _) ) =-  resolveRdrName m (findOrError m) old subs name-stmtSub _ _ e = pure e--patSub :: Data a => a -> [(String, SrcSpan)] -> Pat -> M Pat-patSub m subs old@(GHC.L _ (VarPat _ (L _ name))) =-  resolveRdrName m (findOrError m) old subs name-patSub _ _ e = pure e--typeSub :: Data a => a -> [(String, SrcSpan)] -> Type -> M Type-typeSub m subs old@(GHC.L _ (HsTyVar _ _ (L _ name))) =-  resolveRdrName m (findOrError m) old subs name-typeSub _ _ e = pure e--exprSub :: Data a => a -> [(String, SrcSpan)] -> Expr -> M Expr-exprSub m subs old@(GHC.L _ (HsVar _ (L _ name))) =-  resolveRdrName m (findOrError m) old subs name-exprSub _ _ e = pure e---- Used for Monad10, Monad11 tests.--- The issue being that in one case the information is attached to a VarPat--- but we need to move the annotations onto the actual name------ This looks convoluted but we can't match directly on a located name as--- it is not specific enough. Instead we match on some bigger context which--- is contains the located name we want to replace.-identSub :: Data a => a -> [(String, SrcSpan)] -> FunBind -> M FunBind-identSub m subs old@(GHC.FunRhs (GHC.L _ name) _ _) =-  resolveRdrName' subst (findOrError m) old subs name-  where-    subst :: FunBind -> Name -> M FunBind-    subst (GHC.FunRhs n b s) new = do-      let fakeExpr :: Located (GHC.Pat GhcPs)-          fakeExpr = GHC.L (getLoc new) (GHC.VarPat noExt new)-      -- Low level version as we need to combine the annotation information-      -- from the template RdrName and the original VarPat.-      modify . first $-        replaceAnnKey (mkAnnKey n) (mkAnnKey fakeExpr) (mkAnnKey new) (mkAnnKey fakeExpr)-      pure $ GHC.FunRhs new b s-    subst o _ = pure o-identSub _ _ e = pure e----- g is usually modifyAnnKey--- f is usually a function which checks the locations are equal-resolveRdrName' :: (a -> b -> M a)  -- How to combine the value to insert and the replaced value-               -> (AnnSpan -> M b)  -- How to find the new value, when given the location it is in-               -> a                 -- The old thing which we are going to possibly replace-               -> [(String, SrcSpan)] -- Substs-               -> GHC.RdrName       -- The name of the position in the template-                                    --we are replacing into-               -> M a-resolveRdrName' g f old subs name =-  case name of-    -- Todo: this should replace anns as well?-    GHC.Unqual (GHC.occNameString . GHC.occName -> oname)-      | Just ss <- lookup oname subs -> f (srcSpanToAnnSpan ss) >>= g old-    _ -> pure old--resolveRdrName :: (Data old, Data a)-               => a-               -> (AnnSpan -> M (Located old))-               -> Located old-               -> [(String, SrcSpan)]-               -> GHC.RdrName-               -> M (Located old)-resolveRdrName m = resolveRdrName' (modifyAnnKey m)--badAnnSpan :: AnnSpan-badAnnSpan =-#if __GLASGOW_HASKELL__ >= 900-  badRealSrcSpan-#else-  GHC.noSrcSpan-#endif--insertComment :: AnnKey -> String-              -> Map.Map AnnKey Annotation-              -> Map.Map AnnKey Annotation-insertComment k s as =-  let comment = Comment s badAnnSpan Nothing in-  Map.adjust (\a@Ann{..} -> a { annPriorComments = annPriorComments ++ [(comment, DP (1,0))]-                          , annEntryDelta = DP (1,0) }) k as----- Substitute the template into the original AST.-#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900-doGenReplacement-  :: forall ast a. (Data ast, Data a)-  => a-  -> (GHC.Located ast -> Bool)-  -> GHC.Located ast-  -> GHC.Located ast-  -> StateT ((Anns, AnnKeyMap), Bool) IO (GHC.Located ast)-#else-doGenReplacement-  :: forall ast a. (Data (SrcSpanLess ast), HasSrcSpan ast, Data a)-  => a-  -> (ast -> Bool)-  -> ast-  -> ast-  -> StateT ((Anns, AnnKeyMap), Bool) IO ast-#endif-doGenReplacement m p new old-  | p old = do-      (anns, keyMap) <- gets fst-      let n = decomposeSrcSpan new-          o = decomposeSrcSpan old-      (newAnns, newKeyMap) <- liftIO $ execStateT (modifyAnnKey m o n) (anns, keyMap)-      put ((newAnns, newKeyMap), True)-      pure new-  -- If "f a = body where local" doesn't satisfy the predicate, but "f a = body" does,-  -- run the replacement on "f a = body", and add "local" back afterwards.-  -- This is useful for hints like "Eta reduce" and "Redundant where".-  | Just Refl <- eqT @(SrcSpanLess ast) @(HsDecl GHC.GhcPs)-  , L _ (ValD xvald newBind@FunBind{}) <- decomposeSrcSpan new-  , Just (oldNoLocal, oldLocal) <- stripLocalBind (decomposeSrcSpan old)-  , newLoc@(RealSrcSpan' newLocReal) <- getLoc new-  , p (composeSrcSpan oldNoLocal) = do-      (anns, keyMap) <- gets fst-      let n = decomposeSrcSpan new-          o = decomposeSrcSpan old-      (intAnns, newKeyMap) <- liftIO $ execStateT (modifyAnnKey m o n) (anns, keyMap)-      let newFile = srcSpanFile newLocReal-          newLocal = transformBi (setSrcSpanFile newFile) oldLocal-          newLocalLoc = getLoc newLocal-          ensureLoc = combineSrcSpans newLocalLoc-          newMG = fun_matches newBind-          L locMG [L locMatch newMatch] = mg_alts newMG-          newGRHSs = m_grhss newMatch-          finalLoc = ensureLoc newLoc-          newWithLocalBinds = setLocalBind newLocal xvald newBind finalLoc-                                           newMG (ensureLoc locMG) newMatch (ensureLoc locMatch) newGRHSs--          -- Ensure the new Anns properly reflects the local binds we added back.-          addLocalBindsToAnns = addAnnWhere-                              . Map.fromList-                              . map (first (expandTemplateLoc . updateFile . expandGRHSLoc))-                              . Map.toList-            where-              addAnnWhere :: Anns -> Anns-              addAnnWhere oldAnns =-                let oldAnns' = Map.toList oldAnns-                    po = \case-#if __GLASGOW_HASKELL__ >= 900-                      (AnnKey loc con, _) ->-                        loc == getAnnSpan old && con == CN "Match" && srcSpanFile loc /= newFile-#else-                      (AnnKey loc@(RealSrcSpan r) con, _) ->-                        loc == getLoc old && con == CN "Match" && srcSpanFile r /= newFile-                      _ -> False-#endif-                    pn = \case-#if __GLASGOW_HASKELL__ >= 900-                      (AnnKey loc con, _) ->-                        loc == srcSpanToAnnSpan finalLoc && con == CN "Match" && srcSpanFile loc == newFile-#else-                      (AnnKey loc@(RealSrcSpan r) con, _) ->-                        loc == finalLoc && con == CN "Match" && srcSpanFile r == newFile-                      _ -> False-#endif-                in fromMaybe oldAnns $ do-                      oldAnn <- snd <$> find po oldAnns'-                      annWhere <- find ((== G GHC.AnnWhere) . fst) (annsDP oldAnn)-                      let newSortKey = fmap (setAnnSpanFile newFile) <$> annSortKey oldAnn-                      newKey <- fst <$> find pn oldAnns'-                      pure $ Map.adjust-                        (\ann -> ann {annsDP = annsDP ann ++ [annWhere], annSortKey = newSortKey})-                        newKey-                        oldAnns--              -- Expand the SrcSpan of the "GRHS" entry in the new file to include the local binds-              expandGRHSLoc = \case-#if __GLASGOW_HASKELL__ >= 900-                AnnKey r@(annSpanToSrcSpan -> loc) con-#else-                AnnKey loc@(RealSrcSpan r) con-#endif-                  | con == CN "GRHS", srcSpanFile r == newFile ->-                    AnnKey (srcSpanToAnnSpan $ ensureLoc loc) con-                other -> other--              -- If an Anns entry corresponds to the local binds, update its file to point to the new file.-              updateFile = \case-                AnnKey loc con-                  | annSpanToSrcSpan loc `isSubspanOf` getLoc oldLocal ->-                    AnnKey (setAnnSpanFile newFile loc) con-                other -> other--              -- For each SrcSpan in the new file that is the entire newLoc, set it to finalLoc-              expandTemplateLoc = \case-                AnnKey loc con-                  | loc == srcSpanToAnnSpan newLoc -> AnnKey (srcSpanToAnnSpan finalLoc) con-                other -> other--          newAnns = addLocalBindsToAnns intAnns-      put ((newAnns, newKeyMap), True)-      pure $ composeSrcSpan newWithLocalBinds-  | otherwise = pure old---- | If the input is a FunBind with a single match, e.g., "foo a = body where x = y"--- return "Just (foo a = body, x = y)". Otherwise return Nothing.-stripLocalBind-  :: LHsDecl GHC.GhcPs-  -> Maybe (LHsDecl GHC.GhcPs, LHsLocalBinds GHC.GhcPs)-stripLocalBind = \case-  L _ (ValD xvald origBind@FunBind{})-    | let origMG = fun_matches origBind-    , L locMG [L locMatch origMatch] <- mg_alts origMG-    , let origGRHSs = m_grhss origMatch-    , [L _ (GRHS _ _ (L loc2 _))] <- grhssGRHSs origGRHSs ->-      let loc1 = getLoc (fun_id origBind)-          newLoc = combineSrcSpans loc1 loc2-          withoutLocalBinds = setLocalBind (noLoc (EmptyLocalBinds noExt)) xvald origBind newLoc origMG locMG-                                           origMatch locMatch origGRHSs-       in Just (withoutLocalBinds, grhssLocalBinds origGRHSs)-  _ -> Nothing---- | Set the local binds in a HsBind.-setLocalBind-  :: LHsLocalBinds GHC.GhcPs-  -> XValD GhcPs-  -> HsBind GhcPs-  -> SrcSpan-  -> MatchGroup GhcPs (LHsExpr GhcPs)-  -> SrcSpan-  -> Match GhcPs (LHsExpr GhcPs)-  -> SrcSpan-  -> GRHSs GhcPs (LHsExpr GhcPs)-  -> LHsDecl GhcPs-setLocalBind newLocalBinds xvald origBind newLoc origMG locMG origMatch locMatch origGRHSs =-    L newLoc (ValD xvald newBind)-  where-    newGRHSs = origGRHSs{grhssLocalBinds = newLocalBinds}-    newMatch = origMatch{m_grhss = newGRHSs}-    newMG = origMG{mg_alts = L locMG [L locMatch newMatch]}-    newBind = origBind{fun_matches = newMG}--#if __GLASGOW_HASKELL__ <= 806 || __GLASGOW_HASKELL__ >= 900-replaceWorker :: (Annotate a, Data mod)-              => Anns-              -> mod-              -> AnnKeyMap-              -> Parser (GHC.Located a)-              -> Int-              -> Refactoring SrcSpan-              -> IO (Anns, mod, AnnKeyMap)-#else-replaceWorker :: (Annotate a, HasSrcSpan a, Data mod, Data (SrcSpanLess a))-              => Anns-              -> mod-              -> AnnKeyMap-              -> Parser a-              -> Int-              -> Refactoring SrcSpan-              -> IO (Anns, mod, AnnKeyMap)-#endif-replaceWorker as m keyMap parser seed Replace{..} = do-  let replExprLocation = srcSpanToAnnSpan pos-      uniqueName = "template" ++ show seed--  (relat, template) <- do-    flags <- maybe (withDynFlags id) pure =<< readIORef dynFlagsRef-    either (onError "replaceWorker") pure $ parser flags uniqueName orig--  (newExpr, (newAnns, newKeyMap)) <--    runStateT-      (substTransform m subts template)-      (mergeAnns as relat, keyMap)-  let lst = listToMaybe . reverse . GHC.occNameString . GHC.rdrNameOcc-#if __GLASGOW_HASKELL__ >= 900-      adjacent (srcSpanEnd -> RealSrcLoc loc1 _) (srcSpanStart -> RealSrcLoc loc2 _) = loc1 == loc2-#else-      adjacent (srcSpanEnd -> RealSrcLoc loc1) (srcSpanStart -> RealSrcLoc loc2) = loc1 == loc2-#endif-      adjacent _ _ = False--      -- Return @True@ if the start position of the two spans are on the same line, and differ-      -- by the given number of columns.-      diffStartCols :: Int -> SrcSpan -> SrcSpan -> Bool-#if __GLASGOW_HASKELL__ >= 900-      diffStartCols x (srcSpanStart -> RealSrcLoc loc1 _) (srcSpanStart -> RealSrcLoc loc2 _) =-#else-      diffStartCols x (srcSpanStart -> RealSrcLoc loc1) (srcSpanStart -> RealSrcLoc loc2) =-#endif-        srcLocLine loc1 == srcLocLine loc2 && srcLocCol loc1 - srcLocCol loc2 == x-      diffStartCols _ _ _ = False--      -- Add a space if needed, so that we avoid refactoring `y = f(x)` into `y = fx`.-      ensureAppSpace :: Anns -> Anns-      ensureAppSpace = fromMaybe id $ do-        (L _ (HsVar _ (L _ newName))) :: LHsExpr GhcPs <- cast newExpr-        hd <- listToMaybe $ case newName of-          GHC.Unqual occName -> GHC.occNameString occName-          GHC.Qual moduleName _ -> GHC.moduleNameString moduleName-          GHC.Orig modu _ -> GHC.moduleNameString (GHC.moduleName modu)-          GHC.Exact name -> GHC.occNameString (GHC.nameOccName name)-        guard $ isAlphaNum hd-        let prev :: [LHsExpr GhcPs] =-              listify-                (\case-                   (L loc (HsVar _ (L _ rdr))) -> maybe False isAlphaNum (lst rdr) && adjacent loc pos-                   _ -> False-                )-                m-        guard . not . null $ prev-        pure . flip Map.adjust (mkAnnKey newExpr) $ \ann ->-          if annEntryDelta ann == DP (0, 0)-            then ann { annEntryDelta = DP (0, 1) }-            else ann--      -- Add a space if needed, so that we avoid refactoring `y = do(foo bar)` into `y = dofoo bar`.-      ensureDoSpace :: Anns -> Anns-      ensureDoSpace = fromMaybe id $ do-        let doBlocks :: [LHsExpr GhcPs] =-              listify-                (\case-                  (L _ HsDo{}) -> True-                  _ -> False-                )-                m-            doBlocks' :: [(SrcSpan, Int)]-            doBlocks' =-              map-                ( \case-                    L loc (HsDo _ MDoExpr{} _) -> (loc, 3)-                    L loc _ -> (loc, 2)-                )-                doBlocks-        _ <- find (\(ss, len) -> diffStartCols len pos ss) doBlocks'-        pure . flip Map.adjust (mkAnnKey newExpr) $ \ann ->-          if annEntryDelta ann == DP (0, 0)-            then ann { annEntryDelta = DP (0, 1) }-            else ann--      replacementPred = (== replExprLocation) . getAnnSpan-      transformation = transformBiM (doGenReplacement m (replacementPred . decomposeSrcSpan) newExpr)-  runStateT (transformation m) ((newAnns, newKeyMap), False) >>= \case-    (finalM, ((ensureDoSpace . ensureAppSpace -> finalAs, finalKeyMap), True)) ->-      pure (finalAs, finalM, finalKeyMap)-    -- Failed to find a replacment so don't make any changes-    _ -> pure (as, m, keyMap)-replaceWorker as m keyMap _ _ _ = pure (as, m, keyMap)--data NotFound = NotFound-  { nfExpected :: String-  , nfActual :: Maybe String-  , nfLoc :: AnnSpan-  }--renderNotFound :: NotFound -> String-renderNotFound NotFound{..} =-  "Expected type not found at the location specified in the refact file.\n"-  ++ "  Expected type: " ++ nfExpected ++ "\n"-  ++ maybe "" (\actual -> "  Actual type: " ++ actual ++ "\n") nfActual-  ++ "  Location: " ++ showSDocUnsafe (ppr nfLoc)---- Find a given type with a given SrcSpan-findInModule :: forall a modu. (Data a, Data modu) => modu -> AnnSpan -> Either NotFound (GHC.Located a)-findInModule m ss = case doTrans m of-  Just a -> Right a-  Nothing ->-    let expected = show (typeRep (Proxy @a))-        actual = listToMaybe $ catMaybes-          [ showType (doTrans m :: Maybe Expr)-          , showType (doTrans m :: Maybe Type)-          , showType (doTrans m :: Maybe Decl)-          , showType (doTrans m :: Maybe Pat)-          , showType (doTrans m :: Maybe Name)-          ]-     in Left $ NotFound expected actual ss-  where-    doTrans :: forall b. Data b => modu -> Maybe (GHC.Located b)-    doTrans = something (mkQ Nothing (findLargestExpression ss))--    showType :: forall b. Typeable b => Maybe (GHC.Located b) -> Maybe String-    showType = fmap $ \_ -> show (typeRep (Proxy @b))--findLargestExpression :: forall a. Data a => AnnSpan -> GHC.Located a -> Maybe (GHC.Located a)-findLargestExpression as e@(getAnnSpan -> l) = if l == as then Just e else Nothing--findOrError-  :: forall a modu m. (Data a, Data modu, MonadIO m)-  => modu -> AnnSpan -> m (GHC.Located a)-findOrError m = either f pure . findInModule m-  where-    f nf = liftIO . throwIO $ mkIOError InappropriateType (renderNotFound nf) Nothing Nothing---- Deletion from a list--doDeleteStmt :: Data a => (Stmt -> Bool) -> a -> a-doDeleteStmt = transformBi . filter--doDeleteImport :: Data a => (Import -> Bool) -> a -> a-doDeleteImport = transformBi . filter--{---- Renaming--doRename :: [(String, String)] -> Module -> Module-doRename ss = everywhere (mkT rename)-  where-    rename :: GHC.OccName -> GHC.OccName-    rename v = GHC.mkOccName n s'-      where-          (s, n) = (GHC.occNameString v, GHC.occNameSpace v)-          s' = fromMaybe s (lookup s ss)--}--addExtensionsToFlags-  :: [Extension] -> [Extension] -> FilePath -> DynFlags-  -> IO (Either String DynFlags)-addExtensionsToFlags es ds fp flags = catchErrors $ do-    (stringToStringBuffer -> buf) <- readFileUTF8' fp-    let opts = getOptions flags buf fp-        withExts = flip (foldl' xopt_unset) ds-                      . flip (foldl' xopt_set) es-                      $ flags-    (withPragmas, _, _) <- parseDynamicFilePragma withExts opts-    pure . Right $ withPragmas `gopt_set` Opt_KeepRawTokenStream-  where-    catchErrors = handleGhcException (pure . Left . show)-                . handleSourceError (pure . Left . show)--parseModuleWithArgs-  :: ([Extension], [Extension])-  -> FilePath-  -> IO (Either Errors (Anns, GHC.ParsedSource))-parseModuleWithArgs (es, ds) fp = ghcWrapper $ do-  initFlags <- initDynFlags fp-  eflags <- liftIO $ addExtensionsToFlags es ds fp initFlags-  case eflags of-    -- TODO: report error properly.-    Left err -> pure . Left $ mkErr initFlags GHC.noSrcSpan err-    Right flags -> do-      liftIO $ writeIORef' dynFlagsRef (Just flags)-      res <- parseModuleApiAnnsWithCppInternal defaultCppOptions flags fp-      pure $ postParseTransform res rigidLayout---- | Parse the input into (enabled extensions, disabled extensions, invalid input).--- Implied extensions are automatically added. For example, @FunctionalDependencies@--- implies @MultiParamTypeClasses@, and @RebindableSyntax@ implies @NoImplicitPrelude@.------ The input is processed from left to right. An extension (e.g., @StarIsType@)--- may be overridden later (e.g., by @NoStarIsType@).------ Extensions that appear earlier in the input will appear later in the output.--- Implied extensions appear in the end. If an extension occurs multiple times in the input,--- the last one is used.------ >>> parseExtensions ["GADTs", "RebindableSyntax", "StarIsType", "GADTs", "InvalidExtension", "NoStarIsType"]--- ([GADTs, RebindableSyntax, GADTSyntax, MonoLocalBinds], [StarIsType, ImplicitPrelude], ["InvalidExtension"])-parseExtensions :: [String] -> ([Extension], [Extension], [String])-parseExtensions = addImplied . foldl' f mempty-  where-    f :: ([Extension], [Extension], [String]) -> String -> ([Extension], [Extension], [String])-    f (ys, ns, is) ('N' : 'o' : s) | Just ext <- readExtension s =-      (delete ext ys, ext : delete ext ns, is)-    f (ys, ns, is) s | Just ext <- readExtension s =-      (ext : delete ext ys, delete ext ns, is)-    f (ys, ns, is) s = (ys, ns, s : is)--    addImplied :: ([Extension], [Extension], [String]) -> ([Extension], [Extension], [String])-    addImplied (ys, ns, is) = (ys ++ impliedOn, ns ++ impliedOff, is)-      where-        impliedOn = [b | ext <- ys, (a, True, b) <- impliedXFlags, a == ext]-        impliedOff = [b | ext <- ys, (a, False, b) <- impliedXFlags, a == ext]--readExtension :: String -> Maybe Extension-readExtension s = flagSpecFlag <$> find ((== s) . flagSpecName) xFlags--#if __GLASGOW_HASKELL__ < 900--- | Copied from "Language.Haskell.GhclibParserEx.GHC.Driver.Session", in order to--- support GHC 8.6-impliedXFlags :: [(Extension, Bool, Extension)]-impliedXFlags--- See Note [Updating flag description in the User's Guide]-  = [ (RankNTypes,                True, ExplicitForAll)-    , (QuantifiedConstraints,     True, ExplicitForAll)-    , (ScopedTypeVariables,       True, ExplicitForAll)-    , (LiberalTypeSynonyms,       True, ExplicitForAll)-    , (ExistentialQuantification, True, ExplicitForAll)-    , (FlexibleInstances,         True, TypeSynonymInstances)-    , (FunctionalDependencies,    True, MultiParamTypeClasses)-    , (MultiParamTypeClasses,     True, ConstrainedClassMethods)  -- c.f. #7854-    , (TypeFamilyDependencies,    True, TypeFamilies)--    , (RebindableSyntax, False, ImplicitPrelude)      -- NB: turn off!--    , (DerivingVia, True, DerivingStrategies)--    , (GADTs,            True, GADTSyntax)-    , (GADTs,            True, MonoLocalBinds)-    , (TypeFamilies,     True, MonoLocalBinds)--    , (TypeFamilies,     True, KindSignatures)  -- Type families use kind signatures-    , (PolyKinds,        True, KindSignatures)  -- Ditto polymorphic kinds--    -- TypeInType is now just a synonym for a couple of other extensions.-    , (TypeInType,       True, DataKinds)-    , (TypeInType,       True, PolyKinds)-    , (TypeInType,       True, KindSignatures)--    -- AutoDeriveTypeable is not very useful without DeriveDataTypeable-    , (AutoDeriveTypeable, True, DeriveDataTypeable)--    -- We turn this on so that we can export associated type-    -- type synonyms in subordinates (e.g. MyClass(type AssocType))-    , (TypeFamilies,     True, ExplicitNamespaces)-    , (TypeOperators, True, ExplicitNamespaces)--    , (ImpredicativeTypes,  True, RankNTypes)--        -- Record wild-cards implies field disambiguation-        -- Otherwise if you write (C {..}) you may well get-        -- stuff like " 'a' not in scope ", which is a bit silly-        -- if the compiler has just filled in field 'a' of constructor 'C'-    , (RecordWildCards,     True, DisambiguateRecordFields)--    , (ParallelArrays, True, ParallelListComp)--    , (JavaScriptFFI, True, InterruptibleFFI)--    , (DeriveTraversable, True, DeriveFunctor)-    , (DeriveTraversable, True, DeriveFoldable)--    -- Duplicate record fields require field disambiguation-    , (DuplicateRecordFields, True, DisambiguateRecordFields)--    , (TemplateHaskell, True, TemplateHaskellQuotes)-    , (Strict, True, StrictData)-#if __GLASGOW_HASKELL__ >= 810-    , (StandaloneKindSignatures, False, CUSKs)-#endif-  ]-#endif---- TODO: This is added to avoid a breaking change. We should remove it and--- directly pass the `DynFlags` as arguments, before the 0.10 release.-dynFlagsRef :: IORef (Maybe DynFlags)+{-# LANGUAGE ExplicitNamespaces #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ViewPatterns #-}++module Refact.Internal+  ( apply,+    runRefactoring,+    addExtensionsToFlags,+    parseModuleWithArgs,+    parseExtensions,++    -- * Support for runPipe in the main process+    Verbosity (..),+    rigidLayout,+    refactOptions,+    type Errors,+    onError,+    mkErr,+  )+where++import Control.Exception+import Control.Monad+import Control.Monad.IO.Class (MonadIO (..))+import Control.Monad.Trans.Maybe (MaybeT (..))+import Control.Monad.Trans.State+import Data.Char (isAlphaNum)+import Data.Data+import Data.Foldable (foldlM, for_)+import Data.Functor.Identity (Identity (..))+import Data.Generics (everywhereM, extM, listify, mkM, mkQ, something)+import Data.Generics.Uniplate.Data (transformBi, transformBiM, universeBi)+import Data.IORef.Extra+import Data.List.Extra+import qualified Data.Map as Map+import Data.Maybe (catMaybes, fromMaybe, listToMaybe, mapMaybe)+import Data.Ord (comparing)+import Data.Set (Set)+import qualified Data.Set as Set+import Data.Tuple.Extra+import Debug.Trace+import qualified GHC+import GHC.IO.Exception (IOErrorType (..))+import GHC.LanguageExtensions.Type (Extension (..))+import Language.Haskell.GHC.ExactPrint+import Language.Haskell.GHC.ExactPrint.Delta+import Language.Haskell.GHC.ExactPrint.Parsers+import Language.Haskell.GHC.ExactPrint.Print+import Language.Haskell.GHC.ExactPrint.Types hiding (GhcPs, GhcRn, GhcTc)+import Language.Haskell.GHC.ExactPrint.Utils hiding (rs)+import Refact.Compat+  ( DoGenReplacement,+    Errors,+    FlagSpec (..),+    FunBind,+    Module,+    RdrName (..),+    ReplaceWorker,+    SrcSpanLess,+    annSpanToSrcSpan,+    badAnnSpan,+    combineSrcSpans,+    composeSrcSpan,+    decomposeSrcSpan,+    getOptions,+    gopt_set,+    handleGhcException,+    impliedXFlags,+    mkErr,+    nameOccName,+    occName,+    occNameString,+    onError,+    parseDynamicFilePragma,+    parseModuleName,+    ppr,+    rdrNameOcc,+    setAnnSpanFile,+    setSrcSpanFile,+    showSDocUnsafe,+    srcSpanToAnnSpan,+    stringToStringBuffer,+    xFlags,+    xopt_set,+    xopt_unset,+    pattern RealSrcLoc',+    pattern RealSrcSpan',+  )+import Refact.Types hiding (SrcSpan)+import qualified Refact.Types as R+import Refact.Utils+  ( AnnKeyMap,+    Decl,+    Expr,+    Import,+    M,+    Name,+    Pat,+    Stmt,+    Type,+    foldAnnKey,+    getAnnSpan,+    modifyAnnKey,+    replaceAnnKey,+    toGhcSrcSpan,+    toGhcSrcSpan',+  )+import System.IO.Error (mkIOError)+import System.IO.Extra+import System.IO.Unsafe (unsafePerformIO)++refactOptions :: PrintOptions Identity String+refactOptions = stringOptions {epRigidity = RigidLayout}++rigidLayout :: DeltaOptions+rigidLayout = deltaOptions RigidLayout++-- | Apply a set of refactorings as supplied by hlint+apply ::+  Maybe (Int, Int) ->+  Bool ->+  [(String, [Refactoring R.SrcSpan])] ->+  Maybe FilePath ->+  Verbosity ->+  Anns ->+  Module ->+  IO String+apply mpos step inp mbfile verb as0 m0 = do+  toGhcSS <-+    maybe+      ( case GHC.getLoc m0 of+          GHC.UnhelpfulSpan s -> fail $ "Module has UnhelpfulSpan: " ++ show s+          RealSrcSpan' s ->+            pure $ toGhcSrcSpan' (GHC.srcSpanFile s)+      )+      (pure . toGhcSrcSpan)+      mbfile+  let allRefacts :: [((String, [Refactoring GHC.SrcSpan]), R.SrcSpan)]+      allRefacts =+        sortBy cmpSrcSpan+          . map (first . second . map . fmap $ toGhcSS)+          . mapMaybe (sequenceA . (id &&& aggregateSrcSpans . map pos . snd))+          . filter (maybe (const True) (\p -> any ((`spans` p) . pos) . snd) mpos)+          $ inp++      cmpSrcSpan (_, s1) (_, s2) =+        comparing startLine s1 s2+          <> comparing startCol s1 s2 -- s1 first if it starts on earlier line+          <> comparing endLine s2 s1 --             or on earlier column+          <> comparing endCol s2 s1 -- they start in same place, s2 comes+          -- first if it ends later+          -- else, completely same span, so s1 will be first+  when (verb >= Normal) . traceM $+    "Applying " ++ (show . sum . map (length . snd . fst) $ allRefacts) ++ " hints"+  when (verb == Loud) . traceM $ show (map fst allRefacts)++  (as, m) <-+    if step+      then fromMaybe (as0, m0) <$> runMaybeT (refactoringLoop as0 m0 allRefacts)+      else evalStateT (runRefactorings verb as0 m0 (first snd <$> allRefacts)) 0+  pure . runIdentity $ exactPrintWithOptions refactOptions m as++spans :: R.SrcSpan -> (Int, Int) -> Bool+spans R.SrcSpan {..} loc = (startLine, startCol) <= loc && loc <= (endLine, endCol)++aggregateSrcSpans :: [R.SrcSpan] -> Maybe R.SrcSpan+aggregateSrcSpans = \case+  [] -> Nothing+  rs -> Just (foldr1 alg rs)+  where+    alg (R.SrcSpan sl1 sc1 el1 ec1) (R.SrcSpan sl2 sc2 el2 ec2) =+      let (sl, sc) = case compare sl1 sl2 of+            LT -> (sl1, sc1)+            EQ -> (sl1, min sc1 sc2)+            GT -> (sl2, sc2)+          (el, ec) = case compare el1 el2 of+            LT -> (el2, ec2)+            EQ -> (el2, max ec1 ec2)+            GT -> (el1, ec1)+       in R.SrcSpan sl sc el ec++runRefactorings ::+  Verbosity ->+  Anns ->+  Module ->+  [([Refactoring GHC.SrcSpan], R.SrcSpan)] ->+  StateT Int IO (Anns, Module)+runRefactorings verb as0 m0 ((rs, ss) : rest) = do+  runRefactorings' verb as0 m0 rs >>= \case+    Nothing -> runRefactorings verb as0 m0 rest+    Just (as, m) -> do+      let (overlaps, rest') = span (overlap ss . snd) rest+      when (verb >= Normal) . for_ overlaps $ \(rs', _) ->+        traceM $ "Ignoring " ++ show rs' ++ " due to overlap."+      runRefactorings verb as m rest'+runRefactorings _ as m [] = pure (as, m)++runRefactorings' ::+  Verbosity ->+  Anns ->+  Module ->+  [Refactoring GHC.SrcSpan] ->+  StateT Int IO (Maybe (Anns, Module))+runRefactorings' verb as0 m0 rs = do+  seed <- get+  (as, m, keyMap) <- foldlM (uncurry3 runRefactoring) (as0, m0, Map.empty) rs+  if droppedComments as m keyMap+    then do+      put seed+      when (verb >= Normal) . traceM $+        "Ignoring " ++ show rs ++ " since applying them would cause comments to be dropped."+      pure Nothing+    else pure $ Just (as, m)++overlap :: R.SrcSpan -> R.SrcSpan -> Bool+overlap s1 s2 =+  -- We know s1 always starts <= s2, due to our sort+  case compare (startLine s2) (endLine s1) of+    LT -> True+    EQ -> startCol s2 <= endCol s1+    GT -> False++data LoopOption = LoopOption+  { desc :: String,+    perform :: MaybeT IO (Anns, Module)+  }++refactoringLoop ::+  Anns ->+  Module ->+  [((String, [Refactoring GHC.SrcSpan]), R.SrcSpan)] ->+  MaybeT IO (Anns, Module)+refactoringLoop as m [] = pure (as, m)+refactoringLoop as m (((_, []), _) : rs) = refactoringLoop as m rs+refactoringLoop as0 m0 hints@(((hintDesc, rs), ss) : rss) = do+  res <- liftIO . flip evalStateT 0 $ runRefactorings' Silent as0 m0 rs+  let yAction = case res of+        Just (as, m) -> do+          exactPrint m as `seq` pure ()+          refactoringLoop as m $ dropWhile (overlap ss . snd) rss+        Nothing -> do+          liftIO $ putStrLn "Hint skipped since applying it would cause comments to be dropped"+          refactoringLoop as0 m0 rss+      opts =+        [ ("y", LoopOption "Apply current hint" yAction),+          ("n", LoopOption "Don't apply the current hint" (refactoringLoop as0 m0 rss)),+          ("q", LoopOption "Apply no further hints" (pure (as0, m0))),+          ("d", LoopOption "Discard previous changes" mzero),+          ( "v",+            LoopOption+              "View current file"+              ( liftIO (putStrLn (exactPrint m0 as0))+                  >> refactoringLoop as0 m0 hints+              )+          ),+          ("?", LoopOption "Show this help menu" loopHelp)+        ]+      loopHelp = do+        liftIO . putStrLn . unlines . map mkLine $ opts+        refactoringLoop as0 m0 hints+      mkLine (c, opt) = c ++ " - " ++ desc opt+  inp <- liftIO $ do+    putStrLn hintDesc+    putStrLn $ "Apply hint [" ++ intercalate ", " (map fst opts) ++ "]"+    -- In case that the input also comes from stdin+    withFile "/dev/tty" ReadMode hGetLine+  maybe loopHelp perform (lookup inp opts)++data Verbosity = Silent | Normal | Loud deriving (Eq, Show, Ord)++-- ---------------------------------------------------------------------++-- Perform the substitutions++-- | Peform a @Refactoring@.+runRefactoring ::+  Data a =>+  Anns ->+  a ->+  AnnKeyMap ->+  Refactoring GHC.SrcSpan ->+  StateT Int IO (Anns, a, AnnKeyMap)+runRefactoring as m keyMap = \case+  r@Replace {} -> do+    seed <- get <* modify (+ 1)+    liftIO $ case rtype r of+      Expr -> replaceWorker as m keyMap parseExpr seed r+      Decl -> replaceWorker as m keyMap parseDecl seed r+      Type -> replaceWorker as m keyMap parseType seed r+      Pattern -> replaceWorker as m keyMap parsePattern seed r+      Stmt -> replaceWorker as m keyMap parseStmt seed r+      Bind -> replaceWorker as m keyMap parseBind seed r+      R.Match -> replaceWorker as m keyMap parseMatch seed r+      ModuleName -> replaceWorker as m keyMap (parseModuleName (pos r)) seed r+      Import -> replaceWorker as m keyMap parseImport seed r+  ModifyComment {..} -> pure (Map.map go as, m, keyMap)+    where+      go a@Ann {annPriorComments, annsDP} =+        a+          { annsDP = map changeComment annsDP,+            annPriorComments = map (first change) annPriorComments+          }+      changeComment (AnnComment d, dp) = (AnnComment (change d), dp)+      changeComment e = e+      change old@Comment {..} =+        if ss2pos (annSpanToSrcSpan commentIdentifier) == ss2pos pos+          then old {commentContents = newComment}+          else old+  Delete {rtype, pos} -> pure (as, f m, keyMap)+    where+      annSpan = srcSpanToAnnSpan pos+      f = case rtype of+        Stmt -> doDeleteStmt ((/= annSpan) . getAnnSpan)+        Import -> doDeleteImport ((/= annSpan) . getAnnSpan)+        _ -> id+  InsertComment {..} -> do+    exprkey <- mkAnnKey <$> findOrError @(GHC.HsDecl GHC.GhcPs) m (srcSpanToAnnSpan pos)+    pure (insertComment exprkey newComment as, m, keyMap)+  RemoveAsKeyword {..} -> pure (as, removeAsKeyword m, keyMap)+    where+      removeAsKeyword = transformBi go+      go :: GHC.LImportDecl GHC.GhcPs -> GHC.LImportDecl GHC.GhcPs+      go imp@(GHC.L l i)+        | srcSpanToAnnSpan l == srcSpanToAnnSpan pos = GHC.L l (i {GHC.ideclAs = Nothing})+        | otherwise = imp++droppedComments :: Anns -> Module -> AnnKeyMap -> Bool+droppedComments as m keyMap = any (all (`Set.notMember` allSpans)) spanssWithComments+  where+    spanssWithComments =+      map (\(key, _) -> map keySpan $ key : Map.findWithDefault [] key keyMap)+        . filter (\(_, v) -> notNull (annPriorComments v) || notNull (annFollowingComments v))+        $ Map.toList as++    keySpan (AnnKey ss _) = ss++    allSpans :: Set AnnSpan+    allSpans = Set.fromList . fmap srcSpanToAnnSpan $ universeBi m++parseBind :: Parser (GHC.LHsBind GHC.GhcPs)+parseBind dyn fname s =+  case parseDecl dyn fname s of+    -- Safe as we add no annotations to the ValD+    Right (as, GHC.L l (GHC.ValD _ b)) -> Right (as, GHC.L l b)+    Right (_, GHC.L l _) -> Left (mkErr dyn l "Not a HsBind")+    Left e -> Left e++parseMatch :: Parser (GHC.LMatch GHC.GhcPs (GHC.LHsExpr GHC.GhcPs))+parseMatch dyn fname s =+  case parseBind dyn fname s of+    Right (as, GHC.L l GHC.FunBind {fun_matches}) ->+      case GHC.unLoc (GHC.mg_alts fun_matches) of+        [x] -> Right (as, x)+        _ -> Left (mkErr dyn l "Not a single match")+    Right (_, GHC.L l _) -> Left (mkErr dyn l "Not a funbind")+    Left e -> Left e++-- Substitute variables into templates+-- Finds places in the templates where we need to insert variables.++substTransform :: (Data a, Data b) => b -> [(String, GHC.SrcSpan)] -> a -> M a+substTransform m ss =+  everywhereM+    ( mkM (typeSub m ss)+        `extM` identSub m ss+        `extM` patSub m ss+        `extM` stmtSub m ss+        `extM` exprSub m ss+    )++stmtSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Stmt -> M Stmt+stmtSub m subs old@(GHC.L _ (GHC.BodyStmt _ (GHC.L _ (GHC.HsVar _ (GHC.L _ name))) _ _)) =+  resolveRdrName m (findOrError m) old subs name+stmtSub _ _ e = pure e++patSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Pat -> M Pat+patSub m subs old@(GHC.L _ (GHC.VarPat _ (GHC.L _ name))) =+  resolveRdrName m (findOrError m) old subs name+patSub _ _ e = pure e++typeSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Type -> M Type+typeSub m subs old@(GHC.L _ (GHC.HsTyVar _ _ (GHC.L _ name))) =+  resolveRdrName m (findOrError m) old subs name+typeSub _ _ e = pure e++exprSub :: Data a => a -> [(String, GHC.SrcSpan)] -> Expr -> M Expr+exprSub m subs old@(GHC.L _ (GHC.HsVar _ (GHC.L _ name))) =+  resolveRdrName m (findOrError m) old subs name+exprSub _ _ e = pure e++-- Used for Monad10, Monad11 tests.+-- The issue being that in one case the information is attached to a VarPat+-- but we need to move the annotations onto the actual name+--+-- This looks convoluted but we can't match directly on a located name as+-- it is not specific enough. Instead we match on some bigger context which+-- is contains the located name we want to replace.+identSub :: Data a => a -> [(String, GHC.SrcSpan)] -> FunBind -> M FunBind+identSub m subs old@(GHC.FunRhs (GHC.L _ name) _ _) =+  resolveRdrName' subst (findOrError m) old subs name+  where+    subst :: FunBind -> Name -> M FunBind+    subst (GHC.FunRhs n b s) new = do+      let fakeExpr :: Pat+          fakeExpr = GHC.L (GHC.getLoc new) (GHC.VarPat noExt new)+      -- Low level version as we need to combine the annotation information+      -- from the template RdrName and the original VarPat.+      modify . first $+        replaceAnnKey (mkAnnKey n) (mkAnnKey fakeExpr) (mkAnnKey new) (mkAnnKey fakeExpr)+      pure $ GHC.FunRhs new b s+    subst o _ = pure o+identSub _ _ e = pure e++-- g is usually modifyAnnKey+-- f is usually a function which checks the locations are equal+resolveRdrName' ::+  (a -> b -> M a) -> -- How to combine the value to insert and the replaced value+  (AnnSpan -> M b) -> -- How to find the new value, when given the location it is in+  a -> -- The old thing which we are going to possibly replace+  [(String, GHC.SrcSpan)] -> -- Substs+  GHC.RdrName -> -- The name of the position in the template+  --we are replacing into+  M a+resolveRdrName' g f old subs name =+  case name of+    -- Todo: this should replace anns as well?+    GHC.Unqual (occNameString . occName -> oname)+      | Just ss <- lookup oname subs -> f (srcSpanToAnnSpan ss) >>= g old+    _ -> pure old++resolveRdrName ::+  (Data old, Data a) =>+  a ->+  (AnnSpan -> M (GHC.Located old)) ->+  GHC.Located old ->+  [(String, GHC.SrcSpan)] ->+  GHC.RdrName ->+  M (GHC.Located old)+resolveRdrName m = resolveRdrName' (modifyAnnKey m)++insertComment ::+  AnnKey ->+  String ->+  Map.Map AnnKey Annotation ->+  Map.Map AnnKey Annotation+insertComment k s as =+  let comment = Comment s badAnnSpan Nothing+   in Map.adjust+        ( \a@Ann {..} ->+            a+              { annPriorComments = annPriorComments ++ [(comment, DP (1, 0))],+                annEntryDelta = DP (1, 0)+              }+        )+        k+        as++-- Substitute the template into the original AST.+doGenReplacement :: forall ast a. DoGenReplacement ast a+doGenReplacement m p new old+  | p old = do+    (anns, keyMap) <- gets fst+    let n = decomposeSrcSpan new+        o = decomposeSrcSpan old+    (newAnns, newKeyMap) <- liftIO $ execStateT (modifyAnnKey m o n) (anns, keyMap)+    put ((newAnns, newKeyMap), True)+    pure new+  -- If "f a = body where local" doesn't satisfy the predicate, but "f a = body" does,+  -- run the replacement on "f a = body", and add "local" back afterwards.+  -- This is useful for hints like "Eta reduce" and "Redundant where".+  | Just Refl <- eqT @(SrcSpanLess ast) @(GHC.HsDecl GHC.GhcPs),+    GHC.L _ (GHC.ValD xvald newBind@GHC.FunBind {}) <- decomposeSrcSpan new,+    Just (oldNoLocal, oldLocal) <- stripLocalBind (decomposeSrcSpan old),+    newLoc@(RealSrcSpan' newLocReal) <- GHC.getLoc new,+    p (composeSrcSpan oldNoLocal) = do+    (anns, keyMap) <- gets fst+    let n = decomposeSrcSpan new+        o = decomposeSrcSpan old+    (intAnns, newKeyMap) <- liftIO $ execStateT (modifyAnnKey m o n) (anns, keyMap)+    let newFile = GHC.srcSpanFile newLocReal+        newLocal = transformBi (setSrcSpanFile newFile) oldLocal+        newLocalLoc = GHC.getLoc newLocal+        ensureLoc = combineSrcSpans newLocalLoc+        newMG = GHC.fun_matches newBind+        GHC.L locMG [GHC.L locMatch newMatch] = GHC.mg_alts newMG+        newGRHSs = GHC.m_grhss newMatch+        finalLoc = ensureLoc newLoc+        newWithLocalBinds =+          setLocalBind+            newLocal+            xvald+            newBind+            finalLoc+            newMG+            (ensureLoc locMG)+            newMatch+            (ensureLoc locMatch)+            newGRHSs++        -- Ensure the new Anns properly reflects the local binds we added back.+        addLocalBindsToAnns =+          addAnnWhere+            . Map.fromList+            . map (first (expandTemplateLoc . updateFile . expandGRHSLoc))+            . Map.toList+          where+            addAnnWhere :: Anns -> Anns+            addAnnWhere oldAnns =+              let oldAnns' = Map.toList oldAnns+                  po = foldAnnKey (const False) $ \r con ->+                    srcSpanToAnnSpan (RealSrcSpan' r) == srcSpanToAnnSpan (GHC.getLoc old)+                      && con == CN "Match"+                      && GHC.srcSpanFile r /= newFile+                  pn = foldAnnKey (const False) $ \r con ->+                    srcSpanToAnnSpan (RealSrcSpan' r) == srcSpanToAnnSpan finalLoc+                      && con == CN "Match"+                      && GHC.srcSpanFile r == newFile+               in fromMaybe oldAnns $ do+                    oldAnn <- snd <$> find (po . fst) oldAnns'+                    annWhere <- find ((== G GHC.AnnWhere) . fst) (annsDP oldAnn)+                    let newSortKey = fmap (setAnnSpanFile newFile) <$> annSortKey oldAnn+                    newKey <- fst <$> find (pn . fst) oldAnns'+                    pure $+                      Map.adjust+                        (\ann -> ann {annsDP = annsDP ann ++ [annWhere], annSortKey = newSortKey})+                        newKey+                        oldAnns++            -- Expand the SrcSpan of the "GRHS" entry in the new file to include the local binds+            expandGRHSLoc = foldAnnKey id $ \r con ->+              if con == CN "GRHS" && GHC.srcSpanFile r == newFile+                then AnnKey (srcSpanToAnnSpan $ ensureLoc $ RealSrcSpan' r) con+                else AnnKey (srcSpanToAnnSpan $ RealSrcSpan' r) con++            -- If an Anns entry corresponds to the local binds, update its file to point to the new file.+            updateFile = \case+              AnnKey loc con+                | annSpanToSrcSpan loc `GHC.isSubspanOf` GHC.getLoc oldLocal ->+                  AnnKey (setAnnSpanFile newFile loc) con+              other -> other++            -- For each SrcSpan in the new file that is the entire newLoc, set it to finalLoc+            expandTemplateLoc = \case+              AnnKey loc con+                | loc == srcSpanToAnnSpan newLoc -> AnnKey (srcSpanToAnnSpan finalLoc) con+              other -> other++        newAnns = addLocalBindsToAnns intAnns+    put ((newAnns, newKeyMap), True)+    pure $ composeSrcSpan newWithLocalBinds+  | otherwise = pure old++-- | If the input is a FunBind with a single match, e.g., "foo a = body where x = y"+-- return "Just (foo a = body, x = y)". Otherwise return Nothing.+stripLocalBind ::+  Decl ->+  Maybe (Decl, GHC.LHsLocalBinds GHC.GhcPs)+stripLocalBind = \case+  GHC.L _ (GHC.ValD xvald origBind@GHC.FunBind {})+    | let origMG = GHC.fun_matches origBind,+      GHC.L locMG [GHC.L locMatch origMatch] <- GHC.mg_alts origMG,+      let origGRHSs = GHC.m_grhss origMatch,+      [GHC.L _ (GHC.GRHS _ _ (GHC.L loc2 _))] <- GHC.grhssGRHSs origGRHSs ->+      let loc1 = GHC.getLoc (GHC.fun_id origBind)+          newLoc = combineSrcSpans loc1 loc2+          withoutLocalBinds =+            setLocalBind+              (GHC.noLoc (GHC.EmptyLocalBinds noExt))+              xvald+              origBind+              newLoc+              origMG+              locMG+              origMatch+              locMatch+              origGRHSs+       in Just (withoutLocalBinds, GHC.grhssLocalBinds origGRHSs)+  _ -> Nothing++-- | Set the local binds in a HsBind.+setLocalBind ::+  GHC.LHsLocalBinds GHC.GhcPs ->+  GHC.XValD GHC.GhcPs ->+  GHC.HsBind GHC.GhcPs ->+  GHC.SrcSpan ->+  GHC.MatchGroup GHC.GhcPs Expr ->+  GHC.SrcSpan ->+  GHC.Match GHC.GhcPs Expr ->+  GHC.SrcSpan ->+  GHC.GRHSs GHC.GhcPs Expr ->+  Decl+setLocalBind newLocalBinds xvald origBind newLoc origMG locMG origMatch locMatch origGRHSs =+  GHC.L newLoc (GHC.ValD xvald newBind)+  where+    newGRHSs = origGRHSs {GHC.grhssLocalBinds = newLocalBinds}+    newMatch = origMatch {GHC.m_grhss = newGRHSs}+    newMG = origMG {GHC.mg_alts = GHC.L locMG [GHC.L locMatch newMatch]}+    newBind = origBind {GHC.fun_matches = newMG}++replaceWorker :: forall a mod. ReplaceWorker a mod+replaceWorker as m keyMap parser seed Replace {..} = do+  let replExprLocation = srcSpanToAnnSpan pos+      uniqueName = "template" ++ show seed++  (relat, template) <- do+    flags <- maybe (withDynFlags id) pure =<< readIORef dynFlagsRef+    either (onError "replaceWorker") pure $ parser flags uniqueName orig++  (newExpr, (newAnns, newKeyMap)) <-+    runStateT+      (substTransform m subts template)+      (mergeAnns as relat, keyMap)+  let lst = listToMaybe . reverse . occNameString . rdrNameOcc+      adjacent (GHC.srcSpanEnd -> RealSrcLoc' loc1) (GHC.srcSpanStart -> RealSrcLoc' loc2) = loc1 == loc2+      adjacent _ _ = False++      -- Return @True@ if the start position of the two spans are on the same line, and differ+      -- by the given number of columns.+      diffStartCols :: Int -> GHC.SrcSpan -> GHC.SrcSpan -> Bool+      diffStartCols x (GHC.srcSpanStart -> RealSrcLoc' loc1) (GHC.srcSpanStart -> RealSrcLoc' loc2) =+        GHC.srcLocLine loc1 == GHC.srcLocLine loc2 && GHC.srcLocCol loc1 - GHC.srcLocCol loc2 == x+      diffStartCols _ _ _ = False++      -- Add a space if needed, so that we avoid refactoring `y = f(x)` into `y = fx`.+      ensureAppSpace :: Anns -> Anns+      ensureAppSpace = fromMaybe id $ do+        (GHC.L _ (GHC.HsVar _ (GHC.L _ newName))) :: Expr <- cast newExpr+        hd <- listToMaybe $ case newName of+          Unqual n -> occNameString n+          Qual moduleName _ -> GHC.moduleNameString moduleName+          Orig modu _ -> GHC.moduleNameString (GHC.moduleName modu)+          Exact name -> occNameString (nameOccName name)+        guard $ isAlphaNum hd+        let prev :: [Expr] =+              listify+                ( \case+                    (GHC.L loc (GHC.HsVar _ (GHC.L _ rdr))) ->+                      maybe False isAlphaNum (lst rdr) && adjacent loc pos+                    _ -> False+                )+                m+        guard . not . null $ prev+        pure . flip Map.adjust (mkAnnKey newExpr) $ \ann ->+          if annEntryDelta ann == DP (0, 0)+            then ann {annEntryDelta = DP (0, 1)}+            else ann++      -- Add a space if needed, so that we avoid refactoring `y = do(foo bar)` into `y = dofoo bar`.+      ensureDoSpace :: Anns -> Anns+      ensureDoSpace = fromMaybe id $ do+        let doBlocks :: [Expr] =+              listify+                ( \case+                    (GHC.L _ GHC.HsDo {}) -> True+                    _ -> False+                )+                m+            doBlocks' :: [(GHC.SrcSpan, Int)]+            doBlocks' =+              map+                ( \case+                    GHC.L loc (GHC.HsDo _ GHC.MDoExpr {} _) -> (loc, 3)+                    GHC.L loc _ -> (loc, 2)+                )+                doBlocks+        _ <- find (\(ss, len) -> diffStartCols len pos ss) doBlocks'+        pure . flip Map.adjust (mkAnnKey newExpr) $ \ann ->+          if annEntryDelta ann == DP (0, 0)+            then ann {annEntryDelta = DP (0, 1)}+            else ann++      replacementPred = (== replExprLocation) . getAnnSpan+      transformation = transformBiM (doGenReplacement m (replacementPred . decomposeSrcSpan) newExpr)+  runStateT (transformation m) ((newAnns, newKeyMap), False) >>= \case+    (finalM, ((ensureDoSpace . ensureAppSpace -> finalAs, finalKeyMap), True)) ->+      pure (finalAs, finalM, finalKeyMap)+    -- Failed to find a replacment so don't make any changes+    _ -> pure (as, m, keyMap)+replaceWorker as m keyMap _ _ _ = pure (as, m, keyMap)++data NotFound = NotFound+  { nfExpected :: String,+    nfActual :: Maybe String,+    nfLoc :: AnnSpan+  }++renderNotFound :: NotFound -> String+renderNotFound NotFound {..} =+  "Expected type not found at the location specified in the refact file.\n"+    ++ "  Expected type: "+    ++ nfExpected+    ++ "\n"+    ++ maybe "" (\actual -> "  Actual type: " ++ actual ++ "\n") nfActual+    ++ "  Location: "+    ++ showSDocUnsafe (ppr nfLoc)++-- Find a given type with a given SrcSpan+findInModule :: forall a modu. (Data a, Data modu) => modu -> AnnSpan -> Either NotFound (GHC.Located a)+findInModule m ss = case doTrans m of+  Just a -> Right a+  Nothing ->+    let expected = show (typeRep (Proxy @a))+        actual =+          listToMaybe $+            catMaybes+              [ showType (doTrans m :: Maybe Expr),+                showType (doTrans m :: Maybe Type),+                showType (doTrans m :: Maybe Decl),+                showType (doTrans m :: Maybe Pat),+                showType (doTrans m :: Maybe Name)+              ]+     in Left $ NotFound expected actual ss+  where+    doTrans :: forall b. Data b => modu -> Maybe (GHC.Located b)+    doTrans = something (mkQ Nothing (findLargestExpression ss))++    showType :: forall b. Typeable b => Maybe (GHC.Located b) -> Maybe String+    showType = fmap $ \_ -> show (typeRep (Proxy @b))++findLargestExpression :: forall a. Data a => AnnSpan -> GHC.Located a -> Maybe (GHC.Located a)+findLargestExpression as e@(getAnnSpan -> l) = if l == as then Just e else Nothing++findOrError ::+  forall a modu m.+  (Data a, Data modu, MonadIO m) =>+  modu ->+  AnnSpan ->+  m (GHC.Located a)+findOrError m = either f pure . findInModule m+  where+    f nf = liftIO . throwIO $ mkIOError InappropriateType (renderNotFound nf) Nothing Nothing++-- Deletion from a list++doDeleteStmt :: Data a => (Stmt -> Bool) -> a -> a+doDeleteStmt = transformBi . filter++doDeleteImport :: Data a => (Import -> Bool) -> a -> a+doDeleteImport = transformBi . filter++{-+-- Renaming++doRename :: [(String, String)] -> Module -> Module+doRename ss = everywhere (mkT rename)+  where+    rename :: GHC.OccName -> GHC.OccName+    rename v = GHC.mkOccName n s'+      where+          (s, n) = (GHC.occNameString v, GHC.occNameSpace v)+          s' = fromMaybe s (lookup s ss)+-}++addExtensionsToFlags ::+  [Extension] ->+  [Extension] ->+  FilePath ->+  GHC.DynFlags ->+  IO (Either String GHC.DynFlags)+addExtensionsToFlags es ds fp flags = catchErrors $ do+  (stringToStringBuffer -> buf) <- readFileUTF8' fp+  let opts = getOptions flags buf fp+      withExts =+        flip (foldl' xopt_unset) ds+          . flip (foldl' xopt_set) es+          $ flags+  (withPragmas, _, _) <- parseDynamicFilePragma withExts opts+  pure . Right $ withPragmas `gopt_set` GHC.Opt_KeepRawTokenStream+  where+    catchErrors =+      handleGhcException (pure . Left . show)+        . GHC.handleSourceError (pure . Left . show)++parseModuleWithArgs ::+  ([Extension], [Extension]) ->+  FilePath ->+  IO (Either Errors (Anns, GHC.ParsedSource))+parseModuleWithArgs (es, ds) fp = ghcWrapper $ do+  initFlags <- initDynFlags fp+  eflags <- liftIO $ addExtensionsToFlags es ds fp initFlags+  case eflags of+    -- TODO: report error properly.+    Left err -> pure . Left $ mkErr initFlags GHC.noSrcSpan err+    Right flags -> do+      liftIO $ writeIORef' dynFlagsRef (Just flags)+      res <- parseModuleApiAnnsWithCppInternal defaultCppOptions flags fp+      pure $ postParseTransform res rigidLayout++-- | Parse the input into (enabled extensions, disabled extensions, invalid input).+-- Implied extensions are automatically added. For example, @FunctionalDependencies@+-- implies @MultiParamTypeClasses@, and @RebindableSyntax@ implies @NoImplicitPrelude@.+--+-- The input is processed from left to right. An extension (e.g., @StarIsType@)+-- may be overridden later (e.g., by @NoStarIsType@).+--+-- Extensions that appear earlier in the input will appear later in the output.+-- Implied extensions appear in the end. If an extension occurs multiple times in the input,+-- the last one is used.+--+-- >>> parseExtensions ["GADTs", "RebindableSyntax", "StarIsType", "GADTs", "InvalidExtension", "NoStarIsType"]+-- ([GADTs, RebindableSyntax, GADTSyntax, MonoLocalBinds], [StarIsType, ImplicitPrelude], ["InvalidExtension"])+parseExtensions :: [String] -> ([Extension], [Extension], [String])+parseExtensions = addImplied . foldl' f mempty+  where+    f :: ([Extension], [Extension], [String]) -> String -> ([Extension], [Extension], [String])+    f (ys, ns, is) ('N' : 'o' : s)+      | Just ext <- readExtension s =+        (delete ext ys, ext : delete ext ns, is)+    f (ys, ns, is) s+      | Just ext <- readExtension s =+        (ext : delete ext ys, delete ext ns, is)+    f (ys, ns, is) s = (ys, ns, s : is)++    addImplied :: ([Extension], [Extension], [String]) -> ([Extension], [Extension], [String])+    addImplied (ys, ns, is) = (ys ++ impliedOn, ns ++ impliedOff, is)+      where+        impliedOn = [b | ext <- ys, (a, True, b) <- impliedXFlags, a == ext]+        impliedOff = [b | ext <- ys, (a, False, b) <- impliedXFlags, a == ext]++readExtension :: String -> Maybe Extension+readExtension s = flagSpecFlag <$> find ((== s) . flagSpecName) xFlags++-- TODO: This is added to avoid a breaking change. We should remove it and+-- directly pass the `DynFlags` as arguments, before the 0.10 release.+dynFlagsRef :: IORef (Maybe GHC.DynFlags) dynFlagsRef = unsafePerformIO $ newIORef Nothing {-# NOINLINE dynFlagsRef #-}
src/Refact/Options.hs view
@@ -1,113 +1,134 @@ {-# LANGUAGE ApplicativeDo #-}-{-# LANGUAGE ConstraintKinds #-}-{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} -module Refact.Options (Options(..), optionsWithHelp) where+module Refact.Options (Options (..), optionsWithHelp) where  import Data.Char (isDigit) import Options.Applicative+import Refact.Compat (MonadFail')+import Refact.Internal (Verbosity (..)) import Text.Read (readMaybe) -import Refact.Internal (Verbosity(..))--#if __GLASGOW_HASKELL__ <= 806-type MonadFail = Monad-#endif- data Options = Options-  { optionsTarget   :: Maybe FilePath -- ^ Where to process hints-  , optionsRefactFile :: Maybe FilePath -- ^ The refactorings to process-  , optionsInplace  :: Bool-  , optionsOutput   :: Maybe FilePath -- ^ Whether to overwrite the file inplace-  , optionsVerbosity :: Verbosity-  , optionsStep :: Bool -- ^ Ask before applying each hint-  , optionsDebug :: Bool-  , optionsRoundtrip :: Bool-  , optionsVersion :: Bool-  , optionsLanguage :: [String]-  , optionsPos     :: Maybe (Int, Int)+  { -- | Where to process hints+    optionsTarget :: Maybe FilePath,+    -- | The refactorings to process+    optionsRefactFile :: Maybe FilePath,+    optionsInplace :: Bool,+    -- | Whether to overwrite the file inplace+    optionsOutput :: Maybe FilePath,+    optionsVerbosity :: Verbosity,+    -- | Ask before applying each hint+    optionsStep :: Bool,+    optionsDebug :: Bool,+    optionsRoundtrip :: Bool,+    optionsVersion :: Bool,+    optionsLanguage :: [String],+    optionsPos :: Maybe (Int, Int)   } - options :: Parser Options options = do   optionsTarget <- optional (argument str (metavar "TARGET"))-  optionsRefactFile <- option (Just <$> str) $ mconcat-    [ long "refact-file"-    , value Nothing-    , help $ "A file which specifies which refactorings to perform. "-          ++ "If not specified, it will be read from stdin, in which case TARGET must be specified."-    ]-  optionsInplace <- switch $ mconcat-    [ long "inplace"-    , short 'i'-    , help "Whether to overwrite the target inplace"-    ]-  optionsOutput <- optional . strOption $ mconcat-    [ long "output"-    , short 'o'-    , help "Name of the file to output to"-    , metavar "FILE"-    ]-  optionsVerbosity <- option (str >>= parseVerbosity) $ mconcat-    [ long "verbosity"-    , short 'v'-    , value Normal-    , help "Specify verbosity, 0, 1 or 2. The default is 1 and 0 is silent."-    ]-  optionsStep <- switch $ mconcat-    [ short 's'-    , long "step"-    , help "Ask before applying each refactoring"-    ]-  optionsDebug <- switch $ mconcat-    [ long "debug"-    , help "Output the GHC AST for debugging"-    , internal-    ]-  optionsRoundtrip <- switch $ mconcat-    [ long "roundtrip"-    , help "Run ghc-exactprint on the file"-    , internal-    ]-  optionsVersion <- switch $ mconcat-    [ long "version"-    , help "Display version number"-    ]-  optionsLanguage <- many . strOption $ mconcat-    [ long "language"-    , short 'X'-    , help "Language extensions (e.g. LambdaCase, RankNTypes)"-    , metavar "Extensions"-    ]-  optionsPos <- option (Just <$> (str >>= parsePos)) $ mconcat-    [ long "pos"-    , value Nothing-    , metavar "<line>,<col>"-    , help "Apply hints relevant to a specific position"-    ]-  pure Options{..}+  optionsRefactFile <-+    option (Just <$> str) $+      mconcat+        [ long "refact-file",+          value Nothing,+          help $+            "A file which specifies which refactorings to perform. "+              ++ "If not specified, it will be read from stdin, in which case TARGET must be specified."+        ]+  optionsInplace <-+    switch $+      mconcat+        [ long "inplace",+          short 'i',+          help "Whether to overwrite the target inplace"+        ]+  optionsOutput <-+    optional . strOption $+      mconcat+        [ long "output",+          short 'o',+          help "Name of the file to output to",+          metavar "FILE"+        ]+  optionsVerbosity <-+    option (str >>= parseVerbosity) $+      mconcat+        [ long "verbosity",+          short 'v',+          value Normal,+          help "Specify verbosity, 0, 1 or 2. The default is 1 and 0 is silent."+        ]+  optionsStep <-+    switch $+      mconcat+        [ short 's',+          long "step",+          help "Ask before applying each refactoring"+        ]+  optionsDebug <-+    switch $+      mconcat+        [ long "debug",+          help "Output the GHC AST for debugging",+          internal+        ]+  optionsRoundtrip <-+    switch $+      mconcat+        [ long "roundtrip",+          help "Run ghc-exactprint on the file",+          internal+        ]+  optionsVersion <-+    switch $+      mconcat+        [ long "version",+          help "Display version number"+        ]+  optionsLanguage <-+    many . strOption $+      mconcat+        [ long "language",+          short 'X',+          help "Language extensions (e.g. LambdaCase, RankNTypes)",+          metavar "Extensions"+        ]+  optionsPos <-+    option (Just <$> (str >>= parsePos)) $+      mconcat+        [ long "pos",+          value Nothing,+          metavar "<line>,<col>",+          help "Apply hints relevant to a specific position"+        ]+  pure Options {..}  optionsWithHelp :: ParserInfo Options-optionsWithHelp = info (helper <*> options) $ mconcat-  [ fullDesc-  , progDesc "Automatically perform refactorings on haskell source files"-  , header "refactor"-  ]+optionsWithHelp =+  info (helper <*> options) $+    mconcat+      [ fullDesc,+        progDesc "Automatically perform refactorings on haskell source files",+        header "refactor"+      ]  parseVerbosity :: Monad m => String -> m Verbosity-parseVerbosity = pure . \case-  "0" -> Silent-  "1" -> Normal-  "2" -> Loud-  _   -> Normal+parseVerbosity =+  pure . \case+    "0" -> Silent+    "1" -> Normal+    "2" -> Loud+    _ -> Normal -parsePos :: MonadFail m => String -> m (Int, Int)+parsePos :: MonadFail' m => String -> m (Int, Int) parsePos s =   case span isDigit s of-    (line, ',':col) ->+    (line, ',' : col) ->       case (,) <$> readMaybe line <*> readMaybe col of         Just l -> pure l         Nothing -> fail "Invalid input"
src/Refact/Run.hs view
@@ -2,43 +2,39 @@  module Refact.Run (refactMain, runPipe) where -import Language.Haskell.GHC.ExactPrint.Utils--import Refact.Apply (parseExtensions)-import qualified Refact.Types as R-import Refact.Types hiding (SrcSpan)-import Refact.Fixity-import Refact.Internal-  ( Verbosity(..)-  , apply-  , onError-  , parseModuleWithArgs-  )-import Refact.Options (Options(..), optionsWithHelp)- import Control.Monad import Data.List hiding (find) import Data.Maybe import Data.Version+import Debug.Trace+import Language.Haskell.GHC.ExactPrint.Utils import Options.Applicative-import System.IO.Extra-import System.FilePath.Find+import Paths_apply_refact+import Refact.Apply (parseExtensions)+import Refact.Fixity+import Refact.Internal+  ( Verbosity (..),+    apply,+    onError,+    parseModuleWithArgs,+  )+import Refact.Options (Options (..), optionsWithHelp)+import Refact.Types hiding (SrcSpan)+import qualified Refact.Types as R import System.Exit+import System.FilePath.Find+import System.IO.Extra import qualified System.PosixCompat.Files as F -import Paths_apply_refact--import Debug.Trace- refactMain :: IO () refactMain = do-  o@Options{..} <- execParser optionsWithHelp+  o@Options {..} <- execParser optionsWithHelp   when optionsVersion (putStr ("v" ++ showVersion version) >> exitSuccess)   unless (isJust optionsTarget || isJust optionsRefactFile) . die $     "Must specify either the target file, or the refact file, or both.\n"-    ++ "If either the target file or the refact file is not specified, "-    ++ "it will be read from stdin.\n"-    ++ "To show usage, run 'refactor -h'."+      ++ "If either the target file or the refact file is not specified, "+      ++ "it will be read from stdin.\n"+      ++ "To show usage, run 'refactor -h'."   case optionsTarget of     Nothing ->       withTempFile $ \fp -> do@@ -70,10 +66,10 @@   where     p x       | "Setup.hs" `isInfixOf` x = False-      | otherwise                 = True+      | otherwise = True -runPipe :: Options -> FilePath  -> IO ()-runPipe Options{..} file = do+runPipe :: Options -> FilePath -> IO ()+runPipe Options {..} file = do   let verb = optionsVerbosity   rawhints <- getHints optionsRefactFile   when (verb == Loud) (traceM "Got raw hints")@@ -81,23 +77,27 @@       n = length inp   when (verb == Loud) (traceM $ "Read " ++ show n ++ " hints") -  output <- if null inp then readFileUTF8' file else do-    when (verb == Loud) (traceM "Parsing module")-    let (enabledExts, disabledExts, invalidExts) = parseExtensions optionsLanguage-    unless (null invalidExts) . when (verb >= Normal) . putStrLn $-      "Invalid extensions: " ++ intercalate ", " invalidExts-    (as, m) <- either (onError "runPipe") (uncurry applyFixities)-                =<< parseModuleWithArgs (enabledExts, disabledExts) file-    when optionsDebug (putStrLn (showAnnData as 0 m))-    apply optionsPos optionsStep inp (Just file) verb as m+  output <-+    if null inp+      then readFileUTF8' file+      else do+        when (verb == Loud) (traceM "Parsing module")+        let (enabledExts, disabledExts, invalidExts) = parseExtensions optionsLanguage+        unless (null invalidExts) . when (verb >= Normal) . putStrLn $+          "Invalid extensions: " ++ intercalate ", " invalidExts+        (as, m) <-+          either (onError "runPipe") (uncurry applyFixities)+            =<< parseModuleWithArgs (enabledExts, disabledExts) file+        when optionsDebug (putStrLn (showAnnData as 0 m))+        apply optionsPos optionsStep inp (Just file) verb as m    if optionsInplace && isJust optionsTarget     then writeFileUTF8 file output     else case optionsOutput of-          Nothing -> putStr output-          Just f  -> do-            when (verb == Loud) (traceM $ "Writing result to " ++ f)-            writeFileUTF8 f output+      Nothing -> putStr output+      Just f -> do+        when (verb == Loud) (traceM $ "Writing result to " ++ f)+        writeFileUTF8 f output  getHints :: Maybe FilePath -> IO String getHints (Just hintFile) = readFileUTF8' hintFile
src/Refact/Utils.hs view
@@ -1,195 +1,165 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} -module Refact.Utils ( -- * Synonyms-                      Module-                    , Stmt-                    , Expr-                    , Decl-                    , Name-                    , Pat-                    , Type-                    , Import-                    , FunBind-                    , AnnKeyMap-                    , pattern RealSrcLoc'-                    , pattern RealSrcSpan'-                    -- * Monad-                    , M-                    -- * Utility+module Refact.Utils+  ( -- * Synonyms+    Module,+    Stmt,+    Expr,+    Decl,+    Name,+    Pat,+    Type,+    Import,+    FunBind,+    AnnKeyMap,+    pattern RealSrcLoc',+    pattern RealSrcSpan', -                    , mergeAnns-                    , modifyAnnKey-                    , replaceAnnKey-                    , getAnnSpan-                    , toGhcSrcSpan-                    , toGhcSrcSpan'-                    , annSpanToSrcSpan-                    , srcSpanToAnnSpan-                    , setAnnSpanFile-                    , setSrcSpanFile-                    , setRealSrcSpanFile-                    , findParent-                    ) where+    -- * Monad+    M, -import Language.Haskell.GHC.ExactPrint-import Language.Haskell.GHC.ExactPrint.Types+    -- * Utility+    mergeAnns,+    modifyAnnKey,+    replaceAnnKey,+    getAnnSpan,+    toGhcSrcSpan,+    toGhcSrcSpan',+    annSpanToSrcSpan,+    srcSpanToAnnSpan,+    setAnnSpanFile,+    setSrcSpanFile,+    setRealSrcSpanFile,+    findParent,+    foldAnnKey,+  )+where +import Control.Monad.Trans.State (StateT, gets, modify) import Data.Bifunctor (bimap) import Data.Data-import Data.Map.Strict (Map)--#if __GLASGOW_HASKELL__ >= 900-import GHC.Data.FastString (FastString)-import qualified GHC.Data.FastString as GHC-import qualified GHC.Parser.Annotation as GHC-import qualified GHC.Types.Name.Reader as GHC-import GHC.Types.SrcLoc-import qualified GHC.Types.SrcLoc as GHC-#else-import FastString (FastString)-import qualified FastString as GHC-import SrcLoc-import qualified SrcLoc as GHC-import qualified RdrName as GHC-import qualified ApiAnnotation as GHC-#endif--import qualified GHC hiding (parseModule)--#if __GLASGOW_HASKELL__ >= 810-import GHC.Hs.Expr as GHC hiding (Stmt)-import GHC.Hs.ImpExp-#else-import HsExpr as GHC hiding (Stmt)-import HsImpExp-#endif--import Control.Monad.Trans.State--import qualified Data.Map as Map-import Data.Maybe--+  ( Data (gmapQi, toConstr),+    Proxy (..),+    splitTyConApp,+    typeOf,+    typeRep,+    typeRepTyCon,+  )+import Data.Generics.Schemes (something)+import qualified Data.Map.Strict as Map+import Data.Maybe (fromMaybe, isJust)+import Data.Typeable (Typeable, eqT, (:~:) (Refl))+import qualified GHC+import Language.Haskell.GHC.ExactPrint+import Language.Haskell.GHC.ExactPrint.Types+import Refact.Compat+  ( AnnKeyMap,+    AnnKeywordId (..),+    FastString,+    FunBind,+    Module,+    annSpanToSrcSpan,+    mkFastString,+    setAnnSpanFile,+    setRealSrcSpanFile,+    setSrcSpanFile,+    srcSpanToAnnSpan,+    pattern RealSrcLoc',+    pattern RealSrcSpan',+  ) import qualified Refact.Types as R--import Data.Generics.Schemes-import Unsafe.Coerce-+import Unsafe.Coerce (unsafeCoerce)  -- Types--- type M a = StateT (Anns, AnnKeyMap) IO a -type AnnKeyMap = Map AnnKey [AnnKey]--#if __GLASGOW_HASKELL__ >= 900-type Module = (GHC.Located GHC.HsModule)-#else-type Module = (GHC.Located (GHC.HsModule GHC.GhcPs))-#endif- type Expr = GHC.Located (GHC.HsExpr GHC.GhcPs)  type Type = GHC.Located (GHC.HsType GHC.GhcPs)  type Decl = GHC.Located (GHC.HsDecl GHC.GhcPs) -type Pat =  GHC.Located (GHC.Pat GHC.GhcPs)+type Pat = GHC.Located (GHC.Pat GHC.GhcPs)  type Name = GHC.Located GHC.RdrName -type Stmt = ExprLStmt GHC.GhcPs--type Import = LImportDecl GHC.GhcPs--#if __GLASGOW_HASKELL__ >= 900-type FunBind = HsMatchContext GHC.GhcPs-#else-type FunBind = HsMatchContext GHC.RdrName-#endif--pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc-#if __GLASGOW_HASKELL__ >= 900-pattern RealSrcLoc' r <- RealSrcLoc r _ where-  RealSrcLoc' r = RealSrcLoc r Nothing-#else-pattern RealSrcLoc' r <- RealSrcLoc r where-  RealSrcLoc' r = RealSrcLoc r-#endif-{-# COMPLETE RealSrcLoc', UnhelpfulLoc #-}+type Stmt = GHC.ExprLStmt GHC.GhcPs -pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan-#if __GLASGOW_HASKELL__ >= 900-pattern RealSrcSpan' r <- RealSrcSpan r _ where-  RealSrcSpan' r = RealSrcSpan r Nothing-#else-pattern RealSrcSpan' r <- RealSrcSpan r where-  RealSrcSpan' r = RealSrcSpan r-#endif-{-# COMPLETE RealSrcSpan', UnhelpfulSpan #-}+type Import = GHC.LImportDecl GHC.GhcPs  -- | Replaces an old expression with a new expression -- -- Note that usually, new, inp and parent are all the same.-replace :: AnnKey  -- The thing we are replacing-        -> AnnKey  -- The thing which has the annotations we need for the new thing-        -> AnnKey  -- The thing which is going to be inserted-        -> AnnKey  -- The "parent", the largest thing which has he same SrcSpan-                   -- Usually the same as inp and new-        -> Anns -> Maybe Anns+replace ::+  AnnKey -> -- The thing we are replacing+  AnnKey -> -- The thing which has the annotations we need for the new thing+  AnnKey -> -- The thing which is going to be inserted+  AnnKey -> -- The "parent", the largest thing which has he same SrcSpan+  -- Usually the same as inp and new+  Anns ->+  Maybe Anns replace old new inp parent anns = do   oldan <- Map.lookup old anns   newan <- Map.lookup new anns-  oldDelta <- annEntryDelta  <$> Map.lookup parent anns+  oldDelta <- annEntryDelta <$> Map.lookup parent anns   return $ Map.insert inp (combine oldDelta new oldan newan) anns  combine :: DeltaPos -> AnnKey -> Annotation -> Annotation -> Annotation combine oldDelta newkey oldann newann =-  Ann { annEntryDelta = newEntryDelta-      , annPriorComments = annPriorComments oldann ++ annPriorComments newann-      , annFollowingComments = annFollowingComments oldann ++ annFollowingComments newann-      , annsDP = removeComma (annsDP newann) ++ extraComma (annsDP oldann)-      , annSortKey = annSortKey newann-      , annCapturedSpan = annCapturedSpan newann}+  Ann+    { annEntryDelta = newEntryDelta,+      annPriorComments = annPriorComments oldann ++ annPriorComments newann,+      annFollowingComments = annFollowingComments oldann ++ annFollowingComments newann,+      annsDP = removeComma (annsDP newann) ++ extraComma (annsDP oldann),+      annSortKey = annSortKey newann,+      annCapturedSpan = annCapturedSpan newann+    }   where     -- Get rid of structural information when replacing, we assume that the     -- structural information is already there in the new expression.-    removeComma = filter (\(kw, _) -> case kw of-                                         G GHC.AnnComma-                                           | AnnKey _ (CN "ArithSeq") <- newkey -> True-                                           | otherwise -> False-                                         AnnSemiSep -> False-                                         _ -> True)+    removeComma =+      filter+        ( \(kw, _) -> case kw of+            G AnnComma+              | AnnKey _ (CN "ArithSeq") <- newkey -> True+              | otherwise -> False+            AnnSemiSep -> False+            _ -> True+        )      -- Make sure to keep structural information in the template.     extraComma [] = []     extraComma (last -> x) = case fst x of-                              G GHC.AnnComma -> [x]-                              AnnSemiSep -> [x]-                              G GHC.AnnSemi -> [x]-                              _ -> []+      G AnnComma -> [x]+      AnnSemiSep -> [x]+      G AnnSemi -> [x]+      _ -> []      -- Keep the same delta if moving onto a new row-    newEntryDelta | deltaRow oldDelta > 0 = oldDelta-                  | otherwise = annEntryDelta oldann-+    newEntryDelta+      | deltaRow oldDelta > 0 = oldDelta+      | otherwise = annEntryDelta oldann  -- | A parent in this case is an element which has the same SrcSpan findParent :: Data a => AnnSpan -> Anns -> a -> Maybe AnnKey findParent ss as = something (findParentWorker ss as)  -- Note that a parent must also have an annotation.-findParentWorker :: forall a . (Data a)-           => AnnSpan -> Anns -> a -> Maybe AnnKey+findParentWorker ::+  forall a.+  (Data a) =>+  AnnSpan ->+  Anns ->+  a ->+  Maybe AnnKey findParentWorker oldSS as a-  | con == typeRepTyCon (typeRep (Proxy :: Proxy (GHC.Located GHC.RdrName))) && x == typeRep (Proxy :: Proxy AnnSpan)-      = if ss == oldSS-            && isJust (Map.lookup (AnnKey ss cn) as)-          then Just $ AnnKey ss cn-          else Nothing+  | con == typeRepTyCon (typeRep (Proxy :: Proxy (GHC.Located GHC.RdrName))) && x == typeRep (Proxy :: Proxy AnnSpan) =+    if ss == oldSS+      && isJust (Map.lookup (AnnKey ss cn) as)+      then Just $ AnnKey ss cn+      else Nothing   | otherwise = Nothing   where     (con, ~[x, _]) = splitTyConApp (typeOf a)@@ -197,59 +167,78 @@     ss = gmapQi 0 unsafeCoerce a     cn = gmapQi 1 (CN . show . toConstr) a -getAnnSpan :: forall a. Located a -> AnnSpan-getAnnSpan = srcSpanToAnnSpan . getLoc--srcSpanToAnnSpan :: SrcSpan -> AnnSpan-srcSpanToAnnSpan =-#if __GLASGOW_HASKELL__ >= 900-  \case GHC.RealSrcSpan l _ -> l; _ -> badRealSrcSpan-#else-  id-#endif--annSpanToSrcSpan :: AnnSpan -> SrcSpan-annSpanToSrcSpan =-#if __GLASGOW_HASKELL__ >= 900-  flip GHC.RealSrcSpan Nothing-#else-  id-#endif+getAnnSpan :: forall a. GHC.Located a -> AnnSpan+getAnnSpan = srcSpanToAnnSpan . GHC.getLoc  -- | Perform the necessary adjustments to annotations when replacing -- one Located thing with another Located thing. -- -- For example, this function will ensure the correct relative position and -- make sure that any trailing semi colons or commas are transferred.-modifyAnnKey-  :: (Data old, Data new, Data mod)-  => mod -> Located old -> Located new -> M (Located new)+modifyAnnKey ::+  (Data old, Data new, Data mod) =>+  mod ->+  GHC.Located old ->+  GHC.Located new ->+  M (GHC.Located new) modifyAnnKey m e1 e2 = do   as <- gets fst   let parentKey = fromMaybe (mkAnnKey e2) (findParent (getAnnSpan e2) as m)-  e2 <$ modify-          ( bimap-              ( recoverBackquotes e1 e2+  e2+    <$ modify+      ( bimap+          ( dropContextParens e1 e2+              . recoverBackquotes e1 e2               . replaceAnnKey (mkAnnKey e1) (mkAnnKey e2) (mkAnnKey e2) parentKey-              )-              (Map.insertWith (++) (mkAnnKey e1) [mkAnnKey e2])           )+          (Map.insertWith (++) (mkAnnKey e1) [mkAnnKey e2])+      ) +-- | When parens are removed for the entire context, e.g.,+--+-- @+--    - f :: (HasCallStack) => ...+--    + f :: HasCallStack => ...+-- @+--+-- We need to remove the `AnnOpenP` and `AnnCloseP` from the corresponding `Annotation`.+dropContextParens ::+  forall old new.+  (Typeable old, Typeable new) =>+  GHC.Located old ->+  GHC.Located new ->+  Anns ->+  Anns+dropContextParens old new anns+  | Just Refl <- eqT @old @(GHC.HsType GHC.GhcPs),+    Just Refl <- eqT @new @(GHC.HsType GHC.GhcPs),+    isParTy old,+    not (isParTy new),+    Just annOld <- Map.lookup key anns,+    (G AnnOpenP, _) : (G AnnCloseP, _) : rest <- annsDP annOld =+    Map.adjust (\x -> x {annsDP = rest}) key anns+  | otherwise = anns+  where+    key = AnnKey (getAnnSpan old) (CN "(:)")+    isParTy = \case (GHC.L _ GHC.HsParTy {}) -> True; _ -> False+ -- | When the template contains a backquoted substitution variable, but the substitute -- is not backquoted, we must add the corresponding 'GHC.AnnBackQuote's. -- -- See tests/examples/Backquotes.hs for an example.-recoverBackquotes :: Located old -> Located new -> Anns -> Anns+recoverBackquotes :: GHC.Located old -> GHC.Located new -> Anns -> Anns recoverBackquotes (getAnnSpan -> old) (getAnnSpan -> new) anns-  | Just annOld <- Map.lookup (AnnKey old (CN "Unqual")) anns-  , ( (G GHC.AnnBackquote, DP (i, j))-    : rest@( (G GHC.AnnVal, _)-           : (G GHC.AnnBackquote, _)-           : _)-    ) <- annsDP annOld-  = let f annNew = case annsDP annNew of-          [(G GHC.AnnVal, DP (i', j'))] ->-            annNew {annsDP = (G GHC.AnnBackquote, DP (i + i', j + j')) : rest}+  | Just annOld <- Map.lookup (AnnKey old (CN "Unqual")) anns,+    ( (G AnnBackquote, DP (i, j))+        : rest@( (G AnnVal, _)+                   : (G AnnBackquote, _)+                   : _+                 )+      ) <-+      annsDP annOld =+    let f annNew = case annsDP annNew of+          [(G AnnVal, DP (i', j'))] ->+            annNew {annsDP = (G AnnBackquote, DP (i + i', j + j')) : rest}           _ -> annNew      in Map.adjust f (AnnKey new (CN "Unqual")) anns   | otherwise = anns@@ -260,36 +249,21 @@   fromMaybe a (replace old new inp deltainfo a)  -- | Convert a @Refact.Types.SrcSpan@ to a @SrcLoc.SrcSpan@-toGhcSrcSpan :: FilePath -> R.SrcSpan -> SrcSpan-toGhcSrcSpan = toGhcSrcSpan' . GHC.mkFastString+toGhcSrcSpan :: FilePath -> R.SrcSpan -> GHC.SrcSpan+toGhcSrcSpan = toGhcSrcSpan' . mkFastString  -- | Convert a @Refact.Types.SrcSpan@ to a @SrcLoc.SrcSpan@-toGhcSrcSpan' :: FastString -> R.SrcSpan -> SrcSpan-toGhcSrcSpan' file R.SrcSpan{..} = mkSrcSpan (f startLine startCol) (f endLine endCol)-  where-    f = mkSrcLoc file--setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan-setSrcSpanFile file s-  | RealSrcLoc' start <- srcSpanStart s-  , RealSrcLoc' end <- srcSpanEnd s-  = let start' = mkSrcLoc file (srcLocLine start) (srcLocCol start)-        end' = mkSrcLoc file (srcLocLine end) (srcLocCol end)-     in mkSrcSpan start' end'-setSrcSpanFile _ s = s--setRealSrcSpanFile :: FastString -> RealSrcSpan -> RealSrcSpan-setRealSrcSpanFile file s = mkRealSrcSpan start' end'+toGhcSrcSpan' :: FastString -> R.SrcSpan -> GHC.SrcSpan+toGhcSrcSpan' file R.SrcSpan {..} = GHC.mkSrcSpan (f startLine startCol) (f endLine endCol)   where-    start = realSrcSpanStart s-    end = realSrcSpanEnd s-    start' = mkRealSrcLoc file (srcLocLine start) (srcLocCol start)-    end' = mkRealSrcLoc file (srcLocLine end) (srcLocCol end)+    f = GHC.mkSrcLoc file -setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan-setAnnSpanFile =-#if __GLASGOW_HASKELL__ >= 900-  setRealSrcSpanFile-#else-  setSrcSpanFile-#endif+foldAnnKey ::+  forall a.+  (AnnKey -> a) ->+  (GHC.RealSrcSpan -> AnnConName -> a) ->+  AnnKey ->+  a+foldAnnKey f g key@(AnnKey (annSpanToSrcSpan -> ss) con) = case ss of+  RealSrcSpan' r -> g r con+  _ -> f key
+ tests/examples/Bracket42.hs view
@@ -0,0 +1,2 @@+foo :: (HasCallStack) => Int+foo = undefined
+ tests/examples/Bracket42.hs.expected view
@@ -0,0 +1,2 @@+foo :: HasCallStack => Int+foo = undefined
+ tests/examples/Bracket42.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket42.hs:1:8-21: Warning: Redundant bracket\nFound:\n  (HasCallStack)\nPerhaps:\n  HasCallStack\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 22}, subts = [("x",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 21})], orig = "x"}])]
+ tests/examples/Bracket43.hs view
@@ -0,0 +1,2 @@+foo :: ((Eq Int)) => Int+foo = undefined
+ tests/examples/Bracket43.hs.expected view
@@ -0,0 +1,2 @@+foo :: (Eq Int) => Int+foo = undefined
+ tests/examples/Bracket43.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket43.hs:1:9-16: Suggestion: Redundant bracket\nFound:\n  ((Eq Int))\nPerhaps:\n  (Eq Int)\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 17}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 16})], orig = "x"}])]
+ tests/examples/Bracket44.hs view
@@ -0,0 +1,2 @@+foo :: ((Eq) Int) => Int+foo = undefined
+ tests/examples/Bracket44.hs.expected view
@@ -0,0 +1,2 @@+foo :: (Eq Int) => Int+foo = undefined
+ tests/examples/Bracket44.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket44.hs:1:9-12: Warning: Redundant bracket\nFound:\n  (Eq)\nPerhaps:\n  Eq\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 13}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 12})], orig = "x"}])]
+ tests/examples/Bracket45.hs view
@@ -0,0 +1,2 @@+foo :: (Eq) (Int) => Int+foo = undefined
+ tests/examples/Bracket45.hs.expected view
@@ -0,0 +1,2 @@+foo :: Eq Int => Int+foo = undefined
+ tests/examples/Bracket45.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket45.hs:1:8-11: Warning: Redundant bracket\nFound:\n  (Eq)\nPerhaps:\n  Eq\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 12}, subts = [("x",SrcSpan {startLine = 1, startCol = 9, endLine = 1, endCol = 11})], orig = "x"}]),("tests/examples/Bracket45.hs:1:13-17: Warning: Redundant bracket\nFound:\n  (Int)\nPerhaps:\n  Int\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 13, endLine = 1, endCol = 18}, subts = [("x",SrcSpan {startLine = 1, startCol = 14, endLine = 1, endCol = 17})], orig = "x"}])]
+ tests/examples/Bracket46.hs view
@@ -0,0 +1,2 @@+foo :: ((HasCallStack)) => Int+foo = undefined
+ tests/examples/Bracket46.hs.expected view
@@ -0,0 +1,2 @@+foo :: HasCallStack => Int+foo = undefined
+ tests/examples/Bracket46.hs.refact view
@@ -0,0 +1,1 @@+[("tests/examples/Bracket46.hs:1:8-23: Warning: Redundant bracket\nFound:\n  ((HasCallStack))\nPerhaps:\n  HasCallStack\n",[Replace {rtype = Type, pos = SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 24}, subts = [("x",SrcSpan {startLine = 1, startCol = 10, endLine = 1, endCol = 22})], orig = "x"}])]