retrie 0.1.1.1 → 1.0.0.0
raw patch · 30 files changed
+858/−742 lines, 30 filesdep ~ansi-terminaldep ~basedep ~ghcPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ansi-terminal, base, ghc, optparse-applicative
API changes (from Hackage documentation)
- Retrie.PatternMap.Class: missingSyntax :: String -> a
- Retrie.PatternMap.Instances: instance Retrie.PatternMap.Instances.RecordFieldToRdrName (HsTypes.AmbiguousFieldOcc HsExtension.GhcPs)
- Retrie.PatternMap.Instances: instance Retrie.PatternMap.Instances.RecordFieldToRdrName (HsTypes.FieldOcc p)
- Retrie.SYB: data (:~:) (a :: k) (b :: k) :: forall k. () => k -> k -> Type
- Retrie.SYB: data (:~~:) (a :: k1) (b :: k2) :: forall k1 k2. () => k1 -> k2 -> Type
- Retrie.Universe: instance Retrie.Universe.Matchable (HsExpr.LHsExpr HsExtension.GhcPs)
- Retrie.Universe: instance Retrie.Universe.Matchable (HsExpr.LStmt HsExtension.GhcPs (HsExpr.LHsExpr HsExtension.GhcPs))
- Retrie.Universe: instance Retrie.Universe.Matchable (HsTypes.LHsType HsExtension.GhcPs)
+ Retrie: AdhocPattern :: String -> RewriteSpec
+ Retrie: AdhocType :: String -> RewriteSpec
+ Retrie: PatternBackward :: QualifiedName -> RewriteSpec
+ Retrie: PatternForward :: QualifiedName -> RewriteSpec
+ Retrie.ExactPrint: tryTransferEntryDPT :: (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
+ Retrie.Expr: bitraverseHsConDetails :: Applicative m => (arg -> m arg') -> (rec -> m rec') -> HsConDetails arg rec -> m (HsConDetails arg' rec')
+ Retrie.Expr: mkConPatIn :: Monad m => Located RdrName -> HsConPatDetails GhcPs -> TransformT m (Located (Pat GhcPs))
+ Retrie.Expr: mkVarPat :: Monad m => Located RdrName -> TransformT m (LPat GhcPs)
+ Retrie.Expr: parenifyP :: Monad m => Context -> Located (Pat GhcPs) -> TransformT m (Located (Pat GhcPs))
+ Retrie.Expr: setAnnsFor :: (Data e, Monad m) => Located e -> [(KeywordId, DeltaPos)] -> TransformT m (Located e)
+ Retrie.Expr: unparenP :: Located (Pat GhcPs) -> Located (Pat GhcPs)
+ Retrie.GHC: ABE :: XABE p -> IdP p -> IdP p -> HsWrapper -> TcSpecPrags -> ABExport p
+ Retrie.GHC: AbsBinds :: XAbsBinds idL idR -> [TyVar] -> [EvVar] -> [ABExport idL] -> [TcEvBinds] -> LHsBinds idL -> Bool -> HsBindLR idL idR
+ Retrie.GHC: Ambiguous :: XAmbiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
+ Retrie.GHC: AnnD :: XAnnD p -> AnnDecl p -> HsDecl p
+ Retrie.GHC: AnyclassStrategy :: DerivStrategy pass
+ Retrie.GHC: ApplicativeArgMany :: XApplicativeArgMany idL -> [ExprLStmt idL] -> HsExpr idL -> LPat idL -> ApplicativeArg idL
+ Retrie.GHC: ApplicativeArgOne :: XApplicativeArgOne idL -> LPat idL -> LHsExpr idL -> Bool -> SyntaxExpr idL -> ApplicativeArg idL
+ Retrie.GHC: ApplicativeStmt :: XApplicativeStmt idL idR body -> [(SyntaxExpr idR, ApplicativeArg idL)] -> Maybe (SyntaxExpr idR) -> StmtLR idL idR body
+ Retrie.GHC: ArgDocMap :: Map Name (Map Int HsDocString) -> ArgDocMap
+ Retrie.GHC: ArithSeq :: XArithSeq p -> Maybe (SyntaxExpr p) -> ArithSeqInfo p -> HsExpr p
+ Retrie.GHC: ArrowExpr :: HsStmtContext id
+ Retrie.GHC: AsPat :: XAsPat p -> Located (IdP p) -> LPat p -> Pat p
+ Retrie.GHC: BangPat :: XBangPat p -> LPat p -> Pat p
+ Retrie.GHC: BindStmt :: XBindStmt idL idR body -> LPat idL -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Retrie.GHC: BodyStmt :: XBodyStmt idL idR body -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Retrie.GHC: CExport :: Located CExportSpec -> Located SourceText -> ForeignExport
+ Retrie.GHC: CFunction :: CCallTarget -> CImportSpec
+ Retrie.GHC: CImport :: Located CCallConv -> Located Safety -> Maybe Header -> CImportSpec -> Located SourceText -> ForeignImport
+ Retrie.GHC: CLabel :: CLabelString -> CImportSpec
+ Retrie.GHC: CWrapper :: CImportSpec
+ Retrie.GHC: CaseAlt :: HsMatchContext id
+ Retrie.GHC: ClassDecl :: XClassDecl pass -> LHsContext pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> [LHsFunDep pass] -> [LSig pass] -> LHsBinds pass -> [LFamilyDecl pass] -> [LTyFamDefltDecl pass] -> [LDocDecl] -> TyClDecl pass
+ Retrie.GHC: ClassOpSig :: XClassOpSig pass -> Bool -> [Located (IdP pass)] -> LHsSigType pass -> Sig pass
+ Retrie.GHC: ClosedTypeFamily :: Maybe [LTyFamInstEqn pass] -> FamilyInfo pass
+ Retrie.GHC: ClsInstD :: XClsInstD pass -> ClsInstDecl pass -> InstDecl pass
+ Retrie.GHC: ClsInstDecl :: XCClsInstDecl pass -> LHsSigType pass -> LHsBinds pass -> [LSig pass] -> [LTyFamInstDecl pass] -> [LDataFamInstDecl pass] -> Maybe (Located OverlapMode) -> ClsInstDecl pass
+ Retrie.GHC: CmdTopTc :: Type -> Type -> CmdSyntaxTable GhcTc -> CmdTopTc
+ Retrie.GHC: CoPat :: XCoPat p -> HsWrapper -> Pat p -> Type -> Pat p
+ Retrie.GHC: CompleteMatchSig :: XCompleteMatchSig pass -> SourceText -> Located [Located (IdP pass)] -> Maybe (Located (IdP pass)) -> Sig pass
+ Retrie.GHC: ConDeclField :: XConDeclField pass -> [LFieldOcc pass] -> LBangType pass -> Maybe LHsDocString -> ConDeclField pass
+ Retrie.GHC: ConDeclGADT :: XConDeclGADT pass -> [Located (IdP pass)] -> Located Bool -> LHsQTyVars pass -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> LHsType pass -> Maybe LHsDocString -> ConDecl pass
+ Retrie.GHC: ConDeclH98 :: XConDeclH98 pass -> Located (IdP pass) -> Located Bool -> [LHsTyVarBndr pass] -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> Maybe LHsDocString -> ConDecl pass
+ Retrie.GHC: ConPatIn :: Located (IdP p) -> HsConPatDetails p -> Pat p
+ Retrie.GHC: ConPatOut :: Located ConLike -> [Type] -> [TyVar] -> [EvVar] -> TcEvBinds -> HsConPatDetails p -> HsWrapper -> Pat p
+ Retrie.GHC: DataDecl :: XDataDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> HsDataDefn pass -> TyClDecl pass
+ Retrie.GHC: DataDeclRn :: Bool -> NameSet -> DataDeclRn
+ Retrie.GHC: DataFamInstD :: XDataFamInstD pass -> DataFamInstDecl pass -> InstDecl pass
+ Retrie.GHC: DataFamInstDecl :: FamInstEqn pass (HsDataDefn pass) -> DataFamInstDecl pass
+ Retrie.GHC: DataFamily :: FamilyInfo pass
+ Retrie.GHC: DataType :: NewOrData
+ Retrie.GHC: DecBrG :: XDecBrG p -> HsGroup p -> HsBracket p
+ Retrie.GHC: DecBrL :: XDecBrL p -> [LHsDecl p] -> HsBracket p
+ Retrie.GHC: DeclDocMap :: Map Name HsDocString -> DeclDocMap
+ Retrie.GHC: DefD :: XDefD p -> DefaultDecl p -> HsDecl p
+ Retrie.GHC: DefaultDecl :: XCDefaultDecl pass -> [LHsType pass] -> DefaultDecl pass
+ Retrie.GHC: DelayedSplice :: TcLclEnv -> LHsExpr GhcRn -> TcType -> LHsExpr GhcTcId -> DelayedSplice
+ Retrie.GHC: DerivD :: XDerivD p -> DerivDecl p -> HsDecl p
+ Retrie.GHC: DerivDecl :: XCDerivDecl pass -> LHsSigWcType pass -> Maybe (LDerivStrategy pass) -> Maybe (Located OverlapMode) -> DerivDecl pass
+ Retrie.GHC: DoExpr :: HsStmtContext id
+ Retrie.GHC: DocCommentNamed :: String -> HsDocString -> DocDecl
+ Retrie.GHC: DocCommentNext :: HsDocString -> DocDecl
+ Retrie.GHC: DocCommentPrev :: HsDocString -> DocDecl
+ Retrie.GHC: DocD :: XDocD p -> DocDecl -> HsDecl p
+ Retrie.GHC: DocGroup :: Int -> HsDocString -> DocDecl
+ Retrie.GHC: EmptyLocalBinds :: XEmptyLocalBinds idL idR -> HsLocalBindsLR idL idR
+ Retrie.GHC: ExpBr :: XExpBr p -> LHsExpr p -> HsBracket p
+ Retrie.GHC: ExplicitBidirectional :: MatchGroup id (LHsExpr id) -> HsPatSynDir id
+ Retrie.GHC: ExplicitList :: XExplicitList p -> Maybe (SyntaxExpr p) -> [LHsExpr p] -> HsExpr p
+ Retrie.GHC: ExplicitSplice :: SpliceExplicitFlag
+ Retrie.GHC: ExplicitSum :: XExplicitSum p -> ConTag -> Arity -> LHsExpr p -> HsExpr p
+ Retrie.GHC: ExplicitTuple :: XExplicitTuple p -> [LHsTupArg p] -> Boxity -> HsExpr p
+ Retrie.GHC: ExprWithTySig :: XExprWithTySig p -> LHsExpr p -> LHsSigWcType (NoGhcTc p) -> HsExpr p
+ Retrie.GHC: FamDecl :: XFamDecl pass -> FamilyDecl pass -> TyClDecl pass
+ Retrie.GHC: FamEqn :: XCFamEqn pass rhs -> Located (IdP pass) -> Maybe [LHsTyVarBndr pass] -> HsTyPats pass -> LexicalFixity -> rhs -> FamEqn pass rhs
+ Retrie.GHC: FamilyDecl :: XCFamilyDecl pass -> FamilyInfo pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LFamilyResultSig pass -> Maybe (LInjectivityAnn pass) -> FamilyDecl pass
+ Retrie.GHC: FieldOcc :: XCFieldOcc pass -> Located RdrName -> FieldOcc pass
+ Retrie.GHC: FixSig :: XFixSig pass -> FixitySig pass -> Sig pass
+ Retrie.GHC: FixitySig :: XFixitySig pass -> [Located (IdP pass)] -> Fixity -> FixitySig pass
+ Retrie.GHC: ForD :: XForD p -> ForeignDecl p -> HsDecl p
+ Retrie.GHC: ForallInvis :: ForallVisFlag
+ Retrie.GHC: ForallVis :: ForallVisFlag
+ Retrie.GHC: ForeignExport :: XForeignExport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignExport -> ForeignDecl pass
+ Retrie.GHC: ForeignImport :: XForeignImport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignImport -> ForeignDecl pass
+ Retrie.GHC: From :: LHsExpr id -> ArithSeqInfo id
+ Retrie.GHC: FromThen :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Retrie.GHC: FromThenTo :: LHsExpr id -> LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Retrie.GHC: FromTo :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
+ Retrie.GHC: FunBind :: XFunBind idL idR -> Located (IdP idL) -> MatchGroup idR (LHsExpr idR) -> HsWrapper -> [Tickish Id] -> HsBindLR idL idR
+ Retrie.GHC: FunRhs :: Located id -> LexicalFixity -> SrcStrictness -> HsMatchContext id
+ Retrie.GHC: GRHS :: XCGRHS p body -> [GuardLStmt p] -> body -> GRHS p body
+ Retrie.GHC: GRHSs :: XCGRHSs p body -> [LGRHS p body] -> LHsLocalBinds p -> GRHSs p body
+ Retrie.GHC: GhciStmtCtxt :: HsStmtContext id
+ Retrie.GHC: GroupForm :: TransForm
+ Retrie.GHC: HasDollar :: SpliceDecoration
+ Retrie.GHC: HasParens :: SpliceDecoration
+ Retrie.GHC: HsAnnotation :: XHsAnnotation pass -> SourceText -> AnnProvenance (IdP pass) -> Located (HsExpr pass) -> AnnDecl pass
+ Retrie.GHC: HsApp :: XApp p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsAppKindTy :: XAppKindTy pass -> LHsType pass -> LHsKind pass -> HsType pass
+ Retrie.GHC: HsAppTy :: XAppTy pass -> LHsType pass -> LHsType pass -> HsType pass
+ Retrie.GHC: HsAppType :: XAppTypeE p -> LHsExpr p -> LHsWcType (NoGhcTc p) -> HsExpr p
+ Retrie.GHC: HsArgPar :: SrcSpan -> HsArg tm ty
+ Retrie.GHC: HsBangTy :: XBangTy pass -> HsSrcBang -> LHsType pass -> HsType pass
+ Retrie.GHC: HsBinTick :: XBinTick p -> Int -> Int -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsBoxedOrConstraintTuple :: HsTupleSort
+ Retrie.GHC: HsBoxedTuple :: HsTupleSort
+ Retrie.GHC: HsBracket :: XBracket p -> HsBracket p -> HsExpr p
+ Retrie.GHC: HsCase :: XCase p -> LHsExpr p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Retrie.GHC: HsChar :: XHsChar x -> Char -> HsLit x
+ Retrie.GHC: HsCharPrim :: XHsCharPrim x -> Char -> HsLit x
+ Retrie.GHC: HsCmdApp :: XCmdApp id -> LHsCmd id -> LHsExpr id -> HsCmd id
+ Retrie.GHC: HsCmdArrApp :: XCmdArrApp id -> LHsExpr id -> LHsExpr id -> HsArrAppType -> Bool -> HsCmd id
+ Retrie.GHC: HsCmdArrForm :: XCmdArrForm id -> LHsExpr id -> LexicalFixity -> Maybe Fixity -> [LHsCmdTop id] -> HsCmd id
+ Retrie.GHC: HsCmdCase :: XCmdCase id -> LHsExpr id -> MatchGroup id (LHsCmd id) -> HsCmd id
+ Retrie.GHC: HsCmdDo :: XCmdDo id -> Located [CmdLStmt id] -> HsCmd id
+ Retrie.GHC: HsCmdIf :: XCmdIf id -> Maybe (SyntaxExpr id) -> LHsExpr id -> LHsCmd id -> LHsCmd id -> HsCmd id
+ Retrie.GHC: HsCmdLam :: XCmdLam id -> MatchGroup id (LHsCmd id) -> HsCmd id
+ Retrie.GHC: HsCmdLet :: XCmdLet id -> LHsLocalBinds id -> LHsCmd id -> HsCmd id
+ Retrie.GHC: HsCmdPar :: XCmdPar id -> LHsCmd id -> HsCmd id
+ Retrie.GHC: HsCmdTop :: XCmdTop p -> LHsCmd p -> HsCmdTop p
+ Retrie.GHC: HsCmdWrap :: XCmdWrap id -> HsWrapper -> HsCmd id -> HsCmd id
+ Retrie.GHC: HsConLikeOut :: XConLikeOut p -> ConLike -> HsExpr p
+ Retrie.GHC: HsConstraintTuple :: HsTupleSort
+ Retrie.GHC: HsCoreAnn :: XCoreAnn p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsDataDefn :: XCHsDataDefn pass -> NewOrData -> LHsContext pass -> Maybe (Located CType) -> Maybe (LHsKind pass) -> [LConDecl pass] -> HsDeriving pass -> HsDataDefn pass
+ Retrie.GHC: HsDerivingClause :: XCHsDerivingClause pass -> Maybe (LDerivStrategy pass) -> Located [LHsSigType pass] -> HsDerivingClause pass
+ Retrie.GHC: HsDo :: XDo p -> HsStmtContext Name -> Located [ExprLStmt p] -> HsExpr p
+ Retrie.GHC: HsDocTy :: XDocTy pass -> LHsType pass -> LHsDocString -> HsType pass
+ Retrie.GHC: HsDoublePrim :: XHsDoublePrim x -> FractionalLit -> HsLit x
+ Retrie.GHC: HsExplicitListTy :: XExplicitListTy pass -> PromotionFlag -> [LHsType pass] -> HsType pass
+ Retrie.GHC: HsExplicitTupleTy :: XExplicitTupleTy pass -> [LHsType pass] -> HsType pass
+ Retrie.GHC: HsFirstOrderApp :: HsArrAppType
+ Retrie.GHC: HsFloatPrim :: XHsFloatPrim x -> FractionalLit -> HsLit x
+ Retrie.GHC: HsForAllTy :: XForAllTy pass -> ForallVisFlag -> [LHsTyVarBndr pass] -> LHsType pass -> HsType pass
+ Retrie.GHC: HsFractional :: !FractionalLit -> OverLitVal
+ Retrie.GHC: HsFunTy :: XFunTy pass -> LHsType pass -> LHsType pass -> HsType pass
+ Retrie.GHC: 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
+ Retrie.GHC: HsHigherOrderApp :: HsArrAppType
+ Retrie.GHC: HsIB :: XHsIB pass thing -> thing -> HsImplicitBndrs pass thing
+ Retrie.GHC: HsIPBinds :: XHsIPBinds idL idR -> HsIPBinds idR -> HsLocalBindsLR idL idR
+ Retrie.GHC: HsIPName :: FastString -> HsIPName
+ Retrie.GHC: HsIPVar :: XIPVar p -> HsIPName -> HsExpr p
+ Retrie.GHC: HsIParamTy :: XIParamTy pass -> Located HsIPName -> LHsType pass -> HsType pass
+ Retrie.GHC: HsIf :: XIf p -> Maybe (SyntaxExpr p) -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsInt :: XHsInt x -> IntegralLit -> HsLit x
+ Retrie.GHC: HsInt64Prim :: XHsInt64Prim x -> Integer -> HsLit x
+ Retrie.GHC: HsIntPrim :: XHsIntPrim x -> Integer -> HsLit x
+ Retrie.GHC: HsInteger :: XHsInteger x -> Integer -> Type -> HsLit x
+ Retrie.GHC: HsIntegral :: !IntegralLit -> OverLitVal
+ Retrie.GHC: HsIsString :: !SourceText -> !FastString -> OverLitVal
+ Retrie.GHC: HsKindSig :: XKindSig pass -> LHsType pass -> LHsKind pass -> HsType pass
+ Retrie.GHC: HsLam :: XLam p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Retrie.GHC: HsLamCase :: XLamCase p -> MatchGroup p (LHsExpr p) -> HsExpr p
+ Retrie.GHC: HsLazy :: HsImplBang
+ Retrie.GHC: HsLet :: XLet p -> LHsLocalBinds p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsListTy :: XListTy pass -> LHsType pass -> HsType pass
+ Retrie.GHC: HsLit :: XLitE p -> HsLit p -> HsExpr p
+ Retrie.GHC: HsMultiIf :: XMultiIf p -> [LGRHS p (LHsExpr p)] -> HsExpr p
+ Retrie.GHC: HsNumTy :: SourceText -> Integer -> HsTyLit
+ Retrie.GHC: HsOpTy :: XOpTy pass -> LHsType pass -> Located (IdP pass) -> LHsType pass -> HsType pass
+ Retrie.GHC: HsOverLabel :: XOverLabel p -> Maybe (IdP p) -> FastString -> HsExpr p
+ Retrie.GHC: HsOverLit :: XOverLitE p -> HsOverLit p -> HsExpr p
+ Retrie.GHC: HsPar :: XPar p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsParTy :: XParTy pass -> LHsType pass -> HsType pass
+ Retrie.GHC: HsProc :: XProc p -> LPat p -> LHsCmdTop p -> HsExpr p
+ Retrie.GHC: HsQTvs :: XHsQTvs pass -> [LHsTyVarBndr pass] -> LHsQTyVars pass
+ Retrie.GHC: HsQualTy :: XQualTy pass -> LHsContext pass -> LHsType pass -> HsType pass
+ Retrie.GHC: HsQuasiQuote :: XQuasiQuote id -> IdP id -> IdP id -> SrcSpan -> FastString -> HsSplice id
+ Retrie.GHC: HsRat :: XHsRat x -> FractionalLit -> Type -> HsLit x
+ Retrie.GHC: HsRecField :: Located id -> arg -> Bool -> HsRecField' id arg
+ Retrie.GHC: HsRecFields :: [LHsRecField p arg] -> Maybe (Located Int) -> HsRecFields p arg
+ Retrie.GHC: HsRecFld :: XRecFld p -> AmbiguousFieldOcc p -> HsExpr p
+ Retrie.GHC: HsRecTy :: XRecTy pass -> [LConDeclField pass] -> HsType pass
+ Retrie.GHC: HsRnBracketOut :: XRnBracketOut p -> HsBracket GhcRn -> [PendingRnSplice] -> HsExpr p
+ Retrie.GHC: HsRule :: XHsRule pass -> Located (SourceText, RuleName) -> Activation -> Maybe [LHsTyVarBndr (NoGhcTc pass)] -> [LRuleBndr pass] -> Located (HsExpr pass) -> Located (HsExpr pass) -> RuleDecl pass
+ Retrie.GHC: HsRuleRn :: NameSet -> NameSet -> HsRuleRn
+ Retrie.GHC: HsRules :: XCRuleDecls pass -> SourceText -> [LRuleDecl pass] -> RuleDecls pass
+ Retrie.GHC: HsSCC :: XSCC p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsSpliceE :: XSpliceE p -> HsSplice p -> HsExpr p
+ Retrie.GHC: HsSpliceTy :: XSpliceTy pass -> HsSplice pass -> HsType pass
+ Retrie.GHC: HsSpliced :: XSpliced id -> ThModFinalizers -> HsSplicedThing id -> HsSplice id
+ Retrie.GHC: HsSplicedExpr :: HsExpr id -> HsSplicedThing id
+ Retrie.GHC: HsSplicedPat :: Pat id -> HsSplicedThing id
+ Retrie.GHC: HsSplicedT :: DelayedSplice -> HsSplice id
+ Retrie.GHC: HsSplicedTy :: HsType id -> HsSplicedThing id
+ Retrie.GHC: HsSrcBang :: SourceText -> SrcUnpackedness -> SrcStrictness -> HsSrcBang
+ Retrie.GHC: HsStarTy :: XStarTy pass -> Bool -> HsType pass
+ Retrie.GHC: HsStatic :: XStatic p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsStrTy :: SourceText -> FastString -> HsTyLit
+ Retrie.GHC: HsStrict :: HsImplBang
+ Retrie.GHC: HsString :: XHsString x -> FastString -> HsLit x
+ Retrie.GHC: HsStringPrim :: XHsStringPrim x -> ByteString -> HsLit x
+ Retrie.GHC: HsSumTy :: XSumTy pass -> [LHsType pass] -> HsType pass
+ Retrie.GHC: HsTcBracketOut :: XTcBracketOut p -> HsBracket GhcRn -> [PendingTcSplice] -> HsExpr p
+ Retrie.GHC: HsTick :: XTick p -> Tickish (IdP p) -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsTickPragma :: XTickPragma p -> SourceText -> (StringLiteral, (Int, Int), (Int, Int)) -> ((SourceText, SourceText), (SourceText, SourceText)) -> LHsExpr p -> HsExpr p
+ Retrie.GHC: HsTupleTy :: XTupleTy pass -> HsTupleSort -> [LHsType pass] -> HsType pass
+ Retrie.GHC: HsTyLit :: XTyLit pass -> HsTyLit -> HsType pass
+ Retrie.GHC: HsTyVar :: XTyVar pass -> PromotionFlag -> Located (IdP pass) -> HsType pass
+ Retrie.GHC: HsTypeArg :: SrcSpan -> ty -> HsArg tm ty
+ Retrie.GHC: HsTypedSplice :: XTypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
+ Retrie.GHC: HsUnboundVar :: XUnboundVar p -> UnboundVar -> HsExpr p
+ Retrie.GHC: HsUnboxedTuple :: HsTupleSort
+ Retrie.GHC: HsUnpack :: Maybe Coercion -> HsImplBang
+ Retrie.GHC: HsUntypedSplice :: XUntypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
+ Retrie.GHC: HsValArg :: tm -> HsArg tm ty
+ Retrie.GHC: HsValBinds :: XHsValBinds idL idR -> HsValBindsLR idL idR -> HsLocalBindsLR idL idR
+ Retrie.GHC: HsVar :: XVar p -> Located (IdP p) -> HsExpr p
+ Retrie.GHC: HsWC :: XHsWC pass thing -> thing -> HsWildCardBndrs pass thing
+ Retrie.GHC: HsWildCardTy :: XWildCardTy pass -> HsType pass
+ Retrie.GHC: HsWord64Prim :: XHsWord64Prim x -> Integer -> HsLit x
+ Retrie.GHC: HsWordPrim :: XHsWordPrim x -> Integer -> HsLit x
+ Retrie.GHC: HsWrap :: XWrap p -> HsWrapper -> HsExpr p -> HsExpr p
+ Retrie.GHC: IEDoc :: XIEDoc pass -> HsDocString -> IE pass
+ Retrie.GHC: IEDocNamed :: XIEDocNamed pass -> String -> IE pass
+ Retrie.GHC: IEGroup :: XIEGroup pass -> Int -> HsDocString -> IE pass
+ Retrie.GHC: IEModuleContents :: XIEModuleContents pass -> Located ModuleName -> IE pass
+ Retrie.GHC: IEName :: Located name -> IEWrappedName name
+ Retrie.GHC: IEPattern :: Located name -> IEWrappedName name
+ Retrie.GHC: IEThingAbs :: XIEThingAbs pass -> LIEWrappedName (IdP pass) -> IE pass
+ Retrie.GHC: IEThingAll :: XIEThingAll pass -> LIEWrappedName (IdP pass) -> IE pass
+ Retrie.GHC: IEThingWith :: XIEThingWith pass -> LIEWrappedName (IdP pass) -> IEWildcard -> [LIEWrappedName (IdP pass)] -> [Located (FieldLbl (IdP pass))] -> IE pass
+ Retrie.GHC: IEType :: Located name -> IEWrappedName name
+ Retrie.GHC: IEVar :: XIEVar pass -> LIEWrappedName (IdP pass) -> IE pass
+ Retrie.GHC: IEWildcard :: Int -> IEWildcard
+ Retrie.GHC: IPBind :: XCIPBind id -> Either (Located HsIPName) (IdP id) -> LHsExpr id -> IPBind id
+ Retrie.GHC: IPBinds :: XIPBinds id -> [LIPBind id] -> HsIPBinds id
+ Retrie.GHC: IdSig :: XIdSig pass -> Id -> Sig pass
+ Retrie.GHC: IfAlt :: HsMatchContext id
+ Retrie.GHC: ImplicitBidirectional :: HsPatSynDir id
+ Retrie.GHC: ImplicitSplice :: SpliceExplicitFlag
+ Retrie.GHC: ImportDecl :: XCImportDecl pass -> SourceText -> Located ModuleName -> Maybe StringLiteral -> Bool -> Bool -> ImportDeclQualifiedStyle -> Bool -> Maybe (Located ModuleName) -> Maybe (Bool, Located [LIE pass]) -> ImportDecl pass
+ Retrie.GHC: InfixCon :: arg -> arg -> HsConDetails arg rec
+ Retrie.GHC: InjectivityAnn :: Located (IdP pass) -> [Located (IdP pass)] -> InjectivityAnn pass
+ Retrie.GHC: InlineSig :: XInlineSig pass -> Located (IdP pass) -> InlinePragma -> Sig pass
+ Retrie.GHC: InstD :: XInstD p -> InstDecl p -> HsDecl p
+ Retrie.GHC: IsDefaultMethod :: TcSpecPrags
+ Retrie.GHC: KindSig :: XCKindSig pass -> LHsKind pass -> FamilyResultSig pass
+ Retrie.GHC: KindSigD :: XKindSigD p -> StandaloneKindSig p -> HsDecl p
+ Retrie.GHC: KindedTyVar :: XKindedTyVar pass -> Located (IdP pass) -> LHsKind pass -> HsTyVarBndr pass
+ Retrie.GHC: LambdaExpr :: HsMatchContext id
+ Retrie.GHC: LastStmt :: XLastStmt idL idR body -> body -> Bool -> SyntaxExpr idR -> StmtLR idL idR body
+ Retrie.GHC: LazyPat :: XLazyPat p -> LPat p -> Pat p
+ Retrie.GHC: LetStmt :: XLetStmt idL idR body -> LHsLocalBindsLR idL idR -> StmtLR idL idR body
+ Retrie.GHC: ListComp :: HsStmtContext id
+ Retrie.GHC: ListPat :: XListPat p -> [LPat p] -> Pat p
+ Retrie.GHC: ListPatTc :: Type -> Maybe (Type, SyntaxExpr GhcTc) -> ListPatTc
+ Retrie.GHC: LitPat :: XLitPat p -> HsLit p -> Pat p
+ Retrie.GHC: MDoExpr :: HsStmtContext id
+ Retrie.GHC: MG :: XMG p body -> Located [LMatch p body] -> Origin -> MatchGroup p body
+ Retrie.GHC: Match :: XCMatch p body -> HsMatchContext (NameOrRdrName (IdP p)) -> [LPat p] -> GRHSs p body -> Match p body
+ Retrie.GHC: MatchGroupTc :: [Type] -> Type -> MatchGroupTc
+ Retrie.GHC: MinimalSig :: XMinimalSig pass -> SourceText -> LBooleanFormula (Located (IdP pass)) -> Sig pass
+ Retrie.GHC: Missing :: XMissing id -> HsTupArg id
+ Retrie.GHC: ModuleAnnProvenance :: AnnProvenance name
+ Retrie.GHC: MonadComp :: HsStmtContext id
+ Retrie.GHC: NHsCoreTy :: Type -> NewHsTypeX
+ Retrie.GHC: NPat :: XNPat p -> Located (HsOverLit p) -> Maybe (SyntaxExpr p) -> SyntaxExpr p -> Pat p
+ Retrie.GHC: NPatBindTc :: NameSet -> Type -> NPatBindTc
+ Retrie.GHC: NPlusKPat :: XNPlusKPat p -> Located (IdP p) -> Located (HsOverLit p) -> HsOverLit p -> SyntaxExpr p -> SyntaxExpr p -> Pat p
+ Retrie.GHC: NValBinds :: [(RecFlag, LHsBinds idL)] -> [LSig GhcRn] -> NHsValBindsLR idL
+ Retrie.GHC: NegApp :: XNegApp p -> LHsExpr p -> SyntaxExpr p -> HsExpr p
+ Retrie.GHC: NewType :: NewOrData
+ Retrie.GHC: NewtypeStrategy :: DerivStrategy pass
+ Retrie.GHC: NoExtField :: NoExtField
+ Retrie.GHC: NoIEWildcard :: IEWildcard
+ Retrie.GHC: NoParens :: SpliceDecoration
+ Retrie.GHC: NoSig :: XNoSig pass -> FamilyResultSig pass
+ Retrie.GHC: NoSrcStrict :: SrcStrictness
+ Retrie.GHC: NoSrcUnpack :: SrcUnpackedness
+ Retrie.GHC: NotQualified :: ImportDeclQualifiedStyle
+ Retrie.GHC: OpApp :: XOpApp p -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: OpenTypeFamily :: FamilyInfo pass
+ Retrie.GHC: OutOfScope :: OccName -> GlobalRdrEnv -> UnboundVar
+ Retrie.GHC: OverLit :: XOverLit p -> OverLitVal -> HsExpr p -> HsOverLit p
+ Retrie.GHC: OverLitTc :: Bool -> Type -> OverLitTc
+ Retrie.GHC: PSB :: XPSB idL idR -> Located (IdP idL) -> HsPatSynDetails (Located (IdP idR)) -> LPat idR -> HsPatSynDir idR -> PatSynBind idL idR
+ Retrie.GHC: ParPat :: XParPat p -> LPat p -> Pat p
+ Retrie.GHC: ParStmt :: XParStmt idL idR body -> [ParStmtBlock idL idR] -> HsExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Retrie.GHC: ParStmtBlock :: XParStmtBlock idL idR -> [ExprLStmt idL] -> [IdP idR] -> SyntaxExpr idR -> ParStmtBlock idL idR
+ Retrie.GHC: ParStmtCtxt :: HsStmtContext id -> HsStmtContext id
+ Retrie.GHC: Parsed :: Pass
+ Retrie.GHC: PatBind :: XPatBind idL idR -> LPat idL -> GRHSs idR (LHsExpr idR) -> ([Tickish Id], [[Tickish Id]]) -> HsBindLR idL idR
+ Retrie.GHC: PatBindGuards :: HsMatchContext id
+ Retrie.GHC: PatBindRhs :: HsMatchContext id
+ Retrie.GHC: PatBr :: XPatBr p -> LPat p -> HsBracket p
+ Retrie.GHC: PatGuard :: HsMatchContext id -> HsStmtContext id
+ Retrie.GHC: PatSyn :: HsMatchContext id
+ Retrie.GHC: PatSynBind :: XPatSynBind idL idR -> PatSynBind idL idR -> HsBindLR idL idR
+ Retrie.GHC: PatSynSig :: XPatSynSig pass -> [Located (IdP pass)] -> LHsSigType pass -> Sig pass
+ Retrie.GHC: PendingRnSplice :: UntypedSpliceFlavour -> SplicePointName -> LHsExpr GhcRn -> PendingRnSplice
+ Retrie.GHC: PendingTcSplice :: SplicePointName -> LHsExpr GhcTc -> PendingTcSplice
+ Retrie.GHC: PrefixCon :: [arg] -> HsConDetails arg rec
+ Retrie.GHC: Present :: XPresent id -> LHsExpr id -> HsTupArg id
+ Retrie.GHC: ProcExpr :: HsMatchContext id
+ Retrie.GHC: QualifiedPost :: ImportDeclQualifiedStyle
+ Retrie.GHC: QualifiedPre :: ImportDeclQualifiedStyle
+ Retrie.GHC: RecCon :: rec -> HsConDetails arg rec
+ Retrie.GHC: RecStmt :: XRecStmt idL idR body -> [LStmtLR idL idR body] -> [IdP idR] -> [IdP idR] -> SyntaxExpr idR -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
+ Retrie.GHC: RecStmtTc :: Type -> [PostTcExpr] -> [PostTcExpr] -> Type -> RecStmtTc
+ Retrie.GHC: RecUpd :: HsMatchContext id
+ Retrie.GHC: RecordCon :: XRecordCon p -> Located (IdP p) -> HsRecordBinds p -> HsExpr p
+ Retrie.GHC: RecordConTc :: ConLike -> PostTcExpr -> RecordConTc
+ Retrie.GHC: RecordPatSynField :: a -> a -> RecordPatSynField a
+ Retrie.GHC: RecordUpd :: XRecordUpd p -> LHsExpr p -> [LHsRecUpdField p] -> HsExpr p
+ Retrie.GHC: RecordUpdTc :: [ConLike] -> [Type] -> [Type] -> HsWrapper -> RecordUpdTc
+ Retrie.GHC: Renamed :: Pass
+ Retrie.GHC: RoleAnnotD :: XRoleAnnotD p -> RoleAnnotDecl p -> HsDecl p
+ Retrie.GHC: RoleAnnotDecl :: XCRoleAnnotDecl pass -> Located (IdP pass) -> [Located (Maybe Role)] -> RoleAnnotDecl pass
+ Retrie.GHC: RuleBndr :: XCRuleBndr pass -> Located (IdP pass) -> RuleBndr pass
+ Retrie.GHC: RuleBndrSig :: XRuleBndrSig pass -> Located (IdP pass) -> LHsSigWcType pass -> RuleBndr pass
+ Retrie.GHC: RuleD :: XRuleD p -> RuleDecls p -> HsDecl p
+ Retrie.GHC: SCCFunSig :: XSCCFunSig pass -> SourceText -> Located (IdP pass) -> Maybe (Located StringLiteral) -> Sig pass
+ Retrie.GHC: SectionL :: XSectionL p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: SectionR :: XSectionR p -> LHsExpr p -> LHsExpr p -> HsExpr p
+ Retrie.GHC: SigD :: XSigD p -> Sig p -> HsDecl p
+ Retrie.GHC: SigPat :: XSigPat p -> LPat p -> LHsSigWcType (NoGhcTc p) -> Pat p
+ Retrie.GHC: SpecInstSig :: XSpecInstSig pass -> SourceText -> LHsSigType pass -> Sig pass
+ Retrie.GHC: SpecPrag :: Id -> HsWrapper -> InlinePragma -> TcSpecPrag
+ Retrie.GHC: SpecPrags :: [LTcSpecPrag] -> TcSpecPrags
+ Retrie.GHC: SpecSig :: XSpecSig pass -> Located (IdP pass) -> [LHsSigType pass] -> InlinePragma -> Sig pass
+ Retrie.GHC: SpliceD :: XSpliceD p -> SpliceDecl p -> HsDecl p
+ Retrie.GHC: SpliceDecl :: XSpliceDecl p -> Located (HsSplice p) -> SpliceExplicitFlag -> SpliceDecl p
+ Retrie.GHC: SplicePat :: XSplicePat p -> HsSplice p -> Pat p
+ Retrie.GHC: SrcLazy :: SrcStrictness
+ Retrie.GHC: SrcNoUnpack :: SrcUnpackedness
+ Retrie.GHC: SrcStrict :: SrcStrictness
+ Retrie.GHC: SrcUnpack :: SrcUnpackedness
+ Retrie.GHC: StandaloneKindSig :: XStandaloneKindSig pass -> Located (IdP pass) -> LHsSigType pass -> StandaloneKindSig pass
+ Retrie.GHC: StmtCtxt :: HsStmtContext id -> HsMatchContext id
+ Retrie.GHC: StockStrategy :: DerivStrategy pass
+ Retrie.GHC: SumPat :: XSumPat p -> LPat p -> ConTag -> Arity -> Pat p
+ Retrie.GHC: SynDecl :: XSynDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LHsType pass -> TyClDecl pass
+ Retrie.GHC: SyntaxExpr :: HsExpr p -> [HsWrapper] -> HsWrapper -> SyntaxExpr p
+ Retrie.GHC: TExpBr :: XTExpBr p -> LHsExpr p -> HsBracket p
+ Retrie.GHC: ThModFinalizers :: [ForeignRef (Q ())] -> ThModFinalizers
+ Retrie.GHC: ThPatQuote :: HsMatchContext id
+ Retrie.GHC: ThPatSplice :: HsMatchContext id
+ Retrie.GHC: ThenForm :: TransForm
+ Retrie.GHC: 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
+ Retrie.GHC: TransStmtCtxt :: HsStmtContext id -> HsStmtContext id
+ Retrie.GHC: TrueExprHole :: OccName -> UnboundVar
+ Retrie.GHC: TuplePat :: XTuplePat p -> [LPat p] -> Boxity -> Pat p
+ Retrie.GHC: TyClD :: XTyClD p -> TyClDecl p -> HsDecl p
+ Retrie.GHC: TyClGroup :: XCTyClGroup pass -> [LTyClDecl pass] -> [LRoleAnnotDecl pass] -> [LStandaloneKindSig pass] -> [LInstDecl pass] -> TyClGroup pass
+ Retrie.GHC: TyFamInstD :: XTyFamInstD pass -> TyFamInstDecl pass -> InstDecl pass
+ Retrie.GHC: TyFamInstDecl :: TyFamInstEqn pass -> TyFamInstDecl pass
+ Retrie.GHC: TyVarSig :: XTyVarSig pass -> LHsTyVarBndr pass -> FamilyResultSig pass
+ Retrie.GHC: TypBr :: XTypBr p -> LHsType p -> HsBracket p
+ Retrie.GHC: TypeAnnProvenance :: Located name -> AnnProvenance name
+ Retrie.GHC: TypeSig :: XTypeSig pass -> [Located (IdP pass)] -> LHsSigWcType pass -> Sig pass
+ Retrie.GHC: Typechecked :: Pass
+ Retrie.GHC: Unambiguous :: XUnambiguous pass -> Located RdrName -> AmbiguousFieldOcc pass
+ Retrie.GHC: Unidirectional :: HsPatSynDir id
+ Retrie.GHC: UntypedDeclSplice :: UntypedSpliceFlavour
+ Retrie.GHC: UntypedExpSplice :: UntypedSpliceFlavour
+ Retrie.GHC: UntypedPatSplice :: UntypedSpliceFlavour
+ Retrie.GHC: UntypedTypeSplice :: UntypedSpliceFlavour
+ Retrie.GHC: UserTyVar :: XUserTyVar pass -> Located (IdP pass) -> HsTyVarBndr pass
+ Retrie.GHC: ValBinds :: XValBinds idL idR -> LHsBindsLR idL idR -> [LSig idR] -> HsValBindsLR idL idR
+ Retrie.GHC: ValD :: XValD p -> HsBind p -> HsDecl p
+ Retrie.GHC: ValueAnnProvenance :: Located name -> AnnProvenance name
+ Retrie.GHC: VarBind :: XVarBind idL idR -> IdP idL -> LHsExpr idR -> Bool -> HsBindLR idL idR
+ Retrie.GHC: VarBr :: XVarBr p -> Bool -> IdP p -> HsBracket p
+ Retrie.GHC: VarPat :: XVarPat p -> Located (IdP p) -> Pat p
+ Retrie.GHC: ViaStrategy :: XViaStrategy pass -> DerivStrategy pass
+ Retrie.GHC: ViewPat :: XViewPat p -> LHsExpr p -> LPat p -> Pat p
+ Retrie.GHC: Warning :: XWarning pass -> [Located (IdP pass)] -> WarningTxt -> WarnDecl pass
+ Retrie.GHC: WarningD :: XWarningD p -> WarnDecls p -> HsDecl p
+ Retrie.GHC: Warnings :: XWarnings pass -> SourceText -> [LWarnDecl pass] -> WarnDecls pass
+ Retrie.GHC: WildPat :: XWildPat p -> Pat p
+ Retrie.GHC: XABExport :: XXABExport p -> ABExport p
+ Retrie.GHC: XAmbiguousFieldOcc :: XXAmbiguousFieldOcc pass -> AmbiguousFieldOcc pass
+ Retrie.GHC: XAnnDecl :: XXAnnDecl pass -> AnnDecl pass
+ Retrie.GHC: XApplicativeArg :: XXApplicativeArg idL -> ApplicativeArg idL
+ Retrie.GHC: XBracket :: XXBracket p -> HsBracket p
+ Retrie.GHC: XClsInstDecl :: XXClsInstDecl pass -> ClsInstDecl pass
+ Retrie.GHC: XCmd :: XXCmd id -> HsCmd id
+ Retrie.GHC: XCmdTop :: XXCmdTop p -> HsCmdTop p
+ Retrie.GHC: XConDecl :: XXConDecl pass -> ConDecl pass
+ Retrie.GHC: XConDeclField :: XXConDeclField pass -> ConDeclField pass
+ Retrie.GHC: XDefaultDecl :: XXDefaultDecl pass -> DefaultDecl pass
+ Retrie.GHC: XDerivDecl :: XXDerivDecl pass -> DerivDecl pass
+ Retrie.GHC: XExpr :: XXExpr p -> HsExpr p
+ Retrie.GHC: XFamEqn :: XXFamEqn pass rhs -> FamEqn pass rhs
+ Retrie.GHC: XFamilyDecl :: XXFamilyDecl pass -> FamilyDecl pass
+ Retrie.GHC: XFamilyResultSig :: XXFamilyResultSig pass -> FamilyResultSig pass
+ Retrie.GHC: XFieldOcc :: XXFieldOcc pass -> FieldOcc pass
+ Retrie.GHC: XFixitySig :: XXFixitySig pass -> FixitySig pass
+ Retrie.GHC: XForeignDecl :: XXForeignDecl pass -> ForeignDecl pass
+ Retrie.GHC: XGRHS :: XXGRHS p body -> GRHS p body
+ Retrie.GHC: XGRHSs :: XXGRHSs p body -> GRHSs p body
+ Retrie.GHC: XHsBindsLR :: XXHsBindsLR idL idR -> HsBindLR idL idR
+ Retrie.GHC: XHsDataDefn :: XXHsDataDefn pass -> HsDataDefn pass
+ Retrie.GHC: XHsDecl :: XXHsDecl p -> HsDecl p
+ Retrie.GHC: XHsDerivingClause :: XXHsDerivingClause pass -> HsDerivingClause pass
+ Retrie.GHC: XHsGroup :: XXHsGroup p -> HsGroup p
+ Retrie.GHC: XHsIPBinds :: XXHsIPBinds id -> HsIPBinds id
+ Retrie.GHC: XHsImplicitBndrs :: XXHsImplicitBndrs pass thing -> HsImplicitBndrs pass thing
+ Retrie.GHC: XHsLocalBindsLR :: XXHsLocalBindsLR idL idR -> HsLocalBindsLR idL idR
+ Retrie.GHC: XHsType :: XXType pass -> HsType pass
+ Retrie.GHC: XHsWildCardBndrs :: XXHsWildCardBndrs pass thing -> HsWildCardBndrs pass thing
+ Retrie.GHC: XIE :: XXIE pass -> IE pass
+ Retrie.GHC: XIPBind :: XXIPBind id -> IPBind id
+ Retrie.GHC: XImportDecl :: XXImportDecl pass -> ImportDecl pass
+ Retrie.GHC: XInstDecl :: XXInstDecl pass -> InstDecl pass
+ Retrie.GHC: XLHsQTyVars :: XXLHsQTyVars pass -> LHsQTyVars pass
+ Retrie.GHC: XLit :: XXLit x -> HsLit x
+ Retrie.GHC: XMatch :: XXMatch p body -> Match p body
+ Retrie.GHC: XMatchGroup :: XXMatchGroup p body -> MatchGroup p body
+ Retrie.GHC: XOverLit :: XXOverLit p -> HsOverLit p
+ Retrie.GHC: XParStmtBlock :: XXParStmtBlock idL idR -> ParStmtBlock idL idR
+ Retrie.GHC: XPat :: XXPat p -> Pat p
+ Retrie.GHC: XPatSynBind :: XXPatSynBind idL idR -> PatSynBind idL idR
+ Retrie.GHC: XRoleAnnotDecl :: XXRoleAnnotDecl pass -> RoleAnnotDecl pass
+ Retrie.GHC: XRuleBndr :: XXRuleBndr pass -> RuleBndr pass
+ Retrie.GHC: XRuleDecl :: XXRuleDecl pass -> RuleDecl pass
+ Retrie.GHC: XRuleDecls :: XXRuleDecls pass -> RuleDecls pass
+ Retrie.GHC: XSig :: XXSig pass -> Sig pass
+ Retrie.GHC: XSplice :: XXSplice id -> HsSplice id
+ Retrie.GHC: XSpliceDecl :: XXSpliceDecl p -> SpliceDecl p
+ Retrie.GHC: XStandaloneKindSig :: XXStandaloneKindSig pass -> StandaloneKindSig pass
+ Retrie.GHC: XStmtLR :: XXStmtLR idL idR body -> StmtLR idL idR body
+ Retrie.GHC: XTupArg :: XXTupArg id -> HsTupArg id
+ Retrie.GHC: XTyClDecl :: XXTyClDecl pass -> TyClDecl pass
+ Retrie.GHC: XTyClGroup :: XXTyClGroup pass -> TyClGroup pass
+ Retrie.GHC: XTyVarBndr :: XXTyVarBndr pass -> HsTyVarBndr pass
+ Retrie.GHC: XValBindsLR :: XXValBindsLR idL idR -> HsValBindsLR idL idR
+ Retrie.GHC: XWarnDecl :: XXWarnDecl pass -> WarnDecl pass
+ Retrie.GHC: XWarnDecls :: XXWarnDecls pass -> WarnDecls pass
+ Retrie.GHC: [abe_ext] :: ABExport p -> XABE p
+ Retrie.GHC: [abe_mono] :: ABExport p -> IdP p
+ Retrie.GHC: [abe_poly] :: ABExport p -> IdP p
+ Retrie.GHC: [abe_prags] :: ABExport p -> TcSpecPrags
+ Retrie.GHC: [abe_wrap] :: ABExport p -> HsWrapper
+ Retrie.GHC: [abs_binds] :: HsBindLR idL idR -> LHsBinds idL
+ Retrie.GHC: [abs_ev_binds] :: HsBindLR idL idR -> [TcEvBinds]
+ Retrie.GHC: [abs_ev_vars] :: HsBindLR idL idR -> [EvVar]
+ Retrie.GHC: [abs_exports] :: HsBindLR idL idR -> [ABExport idL]
+ Retrie.GHC: [abs_ext] :: HsBindLR idL idR -> XAbsBinds idL idR
+ Retrie.GHC: [abs_sig] :: HsBindLR idL idR -> Bool
+ Retrie.GHC: [abs_tvs] :: HsBindLR idL idR -> [TyVar]
+ Retrie.GHC: [app_arg_pattern] :: ApplicativeArg idL -> LPat idL
+ Retrie.GHC: [app_stmts] :: ApplicativeArg idL -> [ExprLStmt idL]
+ Retrie.GHC: [arg_expr] :: ApplicativeArg idL -> LHsExpr idL
+ Retrie.GHC: [bv_pattern] :: ApplicativeArg idL -> LPat idL
+ Retrie.GHC: [cd_fld_doc] :: ConDeclField pass -> Maybe LHsDocString
+ Retrie.GHC: [cd_fld_ext] :: ConDeclField pass -> XConDeclField pass
+ Retrie.GHC: [cd_fld_names] :: ConDeclField pass -> [LFieldOcc pass]
+ Retrie.GHC: [cd_fld_type] :: ConDeclField pass -> LBangType pass
+ Retrie.GHC: [cid_binds] :: ClsInstDecl pass -> LHsBinds pass
+ Retrie.GHC: [cid_d_ext] :: InstDecl pass -> XClsInstD pass
+ Retrie.GHC: [cid_datafam_insts] :: ClsInstDecl pass -> [LDataFamInstDecl pass]
+ Retrie.GHC: [cid_ext] :: ClsInstDecl pass -> XCClsInstDecl pass
+ Retrie.GHC: [cid_inst] :: InstDecl pass -> ClsInstDecl pass
+ Retrie.GHC: [cid_overlap_mode] :: ClsInstDecl pass -> Maybe (Located OverlapMode)
+ Retrie.GHC: [cid_poly_ty] :: ClsInstDecl pass -> LHsSigType pass
+ Retrie.GHC: [cid_sigs] :: ClsInstDecl pass -> [LSig pass]
+ Retrie.GHC: [cid_tyfam_insts] :: ClsInstDecl pass -> [LTyFamInstDecl pass]
+ Retrie.GHC: [con_args] :: ConDecl pass -> HsConDeclDetails pass
+ Retrie.GHC: [con_doc] :: ConDecl pass -> Maybe LHsDocString
+ Retrie.GHC: [con_ex_tvs] :: ConDecl pass -> [LHsTyVarBndr pass]
+ Retrie.GHC: [con_ext] :: ConDecl pass -> XConDeclH98 pass
+ Retrie.GHC: [con_forall] :: ConDecl pass -> Located Bool
+ Retrie.GHC: [con_g_ext] :: ConDecl pass -> XConDeclGADT pass
+ Retrie.GHC: [con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)
+ Retrie.GHC: [con_name] :: ConDecl pass -> Located (IdP pass)
+ Retrie.GHC: [con_names] :: ConDecl pass -> [Located (IdP pass)]
+ Retrie.GHC: [con_qvars] :: ConDecl pass -> LHsQTyVars pass
+ Retrie.GHC: [con_res_ty] :: ConDecl pass -> LHsType pass
+ Retrie.GHC: [dd_ND] :: HsDataDefn pass -> NewOrData
+ Retrie.GHC: [dd_cType] :: HsDataDefn pass -> Maybe (Located CType)
+ Retrie.GHC: [dd_cons] :: HsDataDefn pass -> [LConDecl pass]
+ Retrie.GHC: [dd_ctxt] :: HsDataDefn pass -> LHsContext pass
+ Retrie.GHC: [dd_derivs] :: HsDataDefn pass -> HsDeriving pass
+ Retrie.GHC: [dd_ext] :: HsDataDefn pass -> XCHsDataDefn pass
+ Retrie.GHC: [dd_kindSig] :: HsDataDefn pass -> Maybe (LHsKind pass)
+ Retrie.GHC: [deriv_clause_ext] :: HsDerivingClause pass -> XCHsDerivingClause pass
+ Retrie.GHC: [deriv_clause_strategy] :: HsDerivingClause pass -> Maybe (LDerivStrategy pass)
+ Retrie.GHC: [deriv_clause_tys] :: HsDerivingClause pass -> Located [LHsSigType pass]
+ Retrie.GHC: [deriv_ext] :: DerivDecl pass -> XCDerivDecl pass
+ Retrie.GHC: [deriv_overlap_mode] :: DerivDecl pass -> Maybe (Located OverlapMode)
+ Retrie.GHC: [deriv_strategy] :: DerivDecl pass -> Maybe (LDerivStrategy pass)
+ Retrie.GHC: [deriv_type] :: DerivDecl pass -> LHsSigWcType pass
+ Retrie.GHC: [dfid_eqn] :: DataFamInstDecl pass -> FamInstEqn pass (HsDataDefn pass)
+ Retrie.GHC: [dfid_ext] :: InstDecl pass -> XDataFamInstD pass
+ Retrie.GHC: [dfid_inst] :: InstDecl pass -> DataFamInstDecl pass
+ Retrie.GHC: [extFieldOcc] :: FieldOcc pass -> XCFieldOcc pass
+ Retrie.GHC: [fail_operator] :: ApplicativeArg idL -> SyntaxExpr idL
+ Retrie.GHC: [fdExt] :: FamilyDecl pass -> XCFamilyDecl pass
+ Retrie.GHC: [fdFixity] :: FamilyDecl pass -> LexicalFixity
+ Retrie.GHC: [fdInfo] :: FamilyDecl pass -> FamilyInfo pass
+ Retrie.GHC: [fdInjectivityAnn] :: FamilyDecl pass -> Maybe (LInjectivityAnn pass)
+ Retrie.GHC: [fdLName] :: FamilyDecl pass -> Located (IdP pass)
+ Retrie.GHC: [fdResultSig] :: FamilyDecl pass -> LFamilyResultSig pass
+ Retrie.GHC: [fdTyVars] :: FamilyDecl pass -> LHsQTyVars pass
+ Retrie.GHC: [fd_e_ext] :: ForeignDecl pass -> XForeignExport pass
+ Retrie.GHC: [fd_fe] :: ForeignDecl pass -> ForeignExport
+ Retrie.GHC: [fd_fi] :: ForeignDecl pass -> ForeignImport
+ Retrie.GHC: [fd_i_ext] :: ForeignDecl pass -> XForeignImport pass
+ Retrie.GHC: [fd_name] :: ForeignDecl pass -> Located (IdP pass)
+ Retrie.GHC: [fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
+ Retrie.GHC: [feqn_bndrs] :: FamEqn pass rhs -> Maybe [LHsTyVarBndr pass]
+ Retrie.GHC: [feqn_ext] :: FamEqn pass rhs -> XCFamEqn pass rhs
+ Retrie.GHC: [feqn_fixity] :: FamEqn pass rhs -> LexicalFixity
+ Retrie.GHC: [feqn_pats] :: FamEqn pass rhs -> HsTyPats pass
+ Retrie.GHC: [feqn_rhs] :: FamEqn pass rhs -> rhs
+ Retrie.GHC: [feqn_tycon] :: FamEqn pass rhs -> Located (IdP pass)
+ Retrie.GHC: [final_expr] :: ApplicativeArg idL -> HsExpr idL
+ Retrie.GHC: [fun_co_fn] :: HsBindLR idL idR -> HsWrapper
+ Retrie.GHC: [fun_ext] :: HsBindLR idL idR -> XFunBind idL idR
+ Retrie.GHC: [fun_id] :: HsBindLR idL idR -> Located (IdP idL)
+ Retrie.GHC: [fun_matches] :: HsBindLR idL idR -> MatchGroup idR (LHsExpr idR)
+ Retrie.GHC: [fun_tick] :: HsBindLR idL idR -> [Tickish Id]
+ Retrie.GHC: [grhssExt] :: GRHSs p body -> XCGRHSs p body
+ Retrie.GHC: [grhssGRHSs] :: GRHSs p body -> [LGRHS p body]
+ Retrie.GHC: [grhssLocalBinds] :: GRHSs p body -> LHsLocalBinds p
+ Retrie.GHC: [group_ext] :: TyClGroup pass -> XCTyClGroup pass
+ Retrie.GHC: [group_instds] :: TyClGroup pass -> [LInstDecl pass]
+ Retrie.GHC: [group_kisigs] :: TyClGroup pass -> [LStandaloneKindSig pass]
+ Retrie.GHC: [group_roles] :: TyClGroup pass -> [LRoleAnnotDecl pass]
+ Retrie.GHC: [group_tyclds] :: TyClGroup pass -> [LTyClDecl pass]
+ Retrie.GHC: [hsRecFieldArg] :: HsRecField' id arg -> arg
+ Retrie.GHC: [hsRecFieldLbl] :: HsRecField' id arg -> Located id
+ Retrie.GHC: [hsRecPun] :: HsRecField' id arg -> Bool
+ Retrie.GHC: [hs_annds] :: HsGroup p -> [LAnnDecl p]
+ Retrie.GHC: [hs_defds] :: HsGroup p -> [LDefaultDecl p]
+ Retrie.GHC: [hs_derivds] :: HsGroup p -> [LDerivDecl p]
+ Retrie.GHC: [hs_docs] :: HsGroup p -> [LDocDecl]
+ Retrie.GHC: [hs_ext] :: HsGroup p -> XCHsGroup p
+ Retrie.GHC: [hs_fixds] :: HsGroup p -> [LFixitySig p]
+ Retrie.GHC: [hs_fords] :: HsGroup p -> [LForeignDecl p]
+ Retrie.GHC: [hs_ruleds] :: HsGroup p -> [LRuleDecls p]
+ Retrie.GHC: [hs_splcds] :: HsGroup p -> [LSpliceDecl p]
+ Retrie.GHC: [hs_tyclds] :: HsGroup p -> [TyClGroup p]
+ Retrie.GHC: [hs_valds] :: HsGroup p -> HsValBinds p
+ Retrie.GHC: [hs_warnds] :: HsGroup p -> [LWarnDecls p]
+ Retrie.GHC: [hsib_body] :: HsImplicitBndrs pass thing -> thing
+ Retrie.GHC: [hsib_ext] :: HsImplicitBndrs pass thing -> XHsIB pass thing
+ Retrie.GHC: [hsq_explicit] :: LHsQTyVars pass -> [LHsTyVarBndr pass]
+ Retrie.GHC: [hsq_ext] :: LHsQTyVars pass -> XHsQTvs pass
+ Retrie.GHC: [hst_bndrs] :: HsType pass -> [LHsTyVarBndr pass]
+ Retrie.GHC: [hst_body] :: HsType pass -> LHsType pass
+ Retrie.GHC: [hst_ctxt] :: HsType pass -> LHsContext pass
+ Retrie.GHC: [hst_fvf] :: HsType pass -> ForallVisFlag
+ Retrie.GHC: [hst_xforall] :: HsType pass -> XForAllTy pass
+ Retrie.GHC: [hst_xqual] :: HsType pass -> XQualTy pass
+ Retrie.GHC: [hswc_body] :: HsWildCardBndrs pass thing -> thing
+ Retrie.GHC: [hswc_ext] :: HsWildCardBndrs pass thing -> XHsWC pass thing
+ Retrie.GHC: [ideclAs] :: ImportDecl pass -> Maybe (Located ModuleName)
+ Retrie.GHC: [ideclExt] :: ImportDecl pass -> XCImportDecl pass
+ Retrie.GHC: [ideclHiding] :: ImportDecl pass -> Maybe (Bool, Located [LIE pass])
+ Retrie.GHC: [ideclImplicit] :: ImportDecl pass -> Bool
+ Retrie.GHC: [ideclName] :: ImportDecl pass -> Located ModuleName
+ Retrie.GHC: [ideclPkgQual] :: ImportDecl pass -> Maybe StringLiteral
+ Retrie.GHC: [ideclQualified] :: ImportDecl pass -> ImportDeclQualifiedStyle
+ Retrie.GHC: [ideclSafe] :: ImportDecl pass -> Bool
+ Retrie.GHC: [ideclSourceSrc] :: ImportDecl pass -> SourceText
+ Retrie.GHC: [ideclSource] :: ImportDecl pass -> Bool
+ Retrie.GHC: [is_body_stmt] :: ApplicativeArg idL -> Bool
+ Retrie.GHC: [m_ctxt] :: Match p body -> HsMatchContext (NameOrRdrName (IdP p))
+ Retrie.GHC: [m_ext] :: Match p body -> XCMatch p body
+ Retrie.GHC: [m_grhss] :: Match p body -> GRHSs p body
+ Retrie.GHC: [m_pats] :: Match p body -> [LPat p]
+ Retrie.GHC: [mc_fixity] :: HsMatchContext id -> LexicalFixity
+ Retrie.GHC: [mc_fun] :: HsMatchContext id -> Located id
+ Retrie.GHC: [mc_strictness] :: HsMatchContext id -> SrcStrictness
+ Retrie.GHC: [mg_alts] :: MatchGroup p body -> Located [LMatch p body]
+ Retrie.GHC: [mg_arg_tys] :: MatchGroupTc -> [Type]
+ Retrie.GHC: [mg_ext] :: MatchGroup p body -> XMG p body
+ Retrie.GHC: [mg_origin] :: MatchGroup p body -> Origin
+ Retrie.GHC: [mg_res_ty] :: MatchGroupTc -> Type
+ Retrie.GHC: [ol_ext] :: HsOverLit p -> XOverLit p
+ Retrie.GHC: [ol_rebindable] :: OverLitTc -> Bool
+ Retrie.GHC: [ol_type] :: OverLitTc -> Type
+ Retrie.GHC: [ol_val] :: HsOverLit p -> OverLitVal
+ Retrie.GHC: [ol_witness] :: HsOverLit p -> HsExpr p
+ Retrie.GHC: [pat_arg_tys] :: Pat p -> [Type]
+ Retrie.GHC: [pat_args] :: Pat p -> HsConPatDetails p
+ Retrie.GHC: [pat_binds] :: Pat p -> TcEvBinds
+ Retrie.GHC: [pat_con] :: Pat p -> Located ConLike
+ Retrie.GHC: [pat_dicts] :: Pat p -> [EvVar]
+ Retrie.GHC: [pat_ext] :: HsBindLR idL idR -> XPatBind idL idR
+ Retrie.GHC: [pat_fvs] :: NPatBindTc -> NameSet
+ Retrie.GHC: [pat_lhs] :: HsBindLR idL idR -> LPat idL
+ Retrie.GHC: [pat_rhs] :: HsBindLR idL idR -> GRHSs idR (LHsExpr idR)
+ Retrie.GHC: [pat_rhs_ty] :: NPatBindTc -> Type
+ Retrie.GHC: [pat_ticks] :: HsBindLR idL idR -> ([Tickish Id], [[Tickish Id]])
+ Retrie.GHC: [pat_tvs] :: Pat p -> [TyVar]
+ Retrie.GHC: [pat_wrap] :: Pat p -> HsWrapper
+ Retrie.GHC: [psb_args] :: PatSynBind idL idR -> HsPatSynDetails (Located (IdP idR))
+ Retrie.GHC: [psb_def] :: PatSynBind idL idR -> LPat idR
+ Retrie.GHC: [psb_dir] :: PatSynBind idL idR -> HsPatSynDir idR
+ Retrie.GHC: [psb_ext] :: PatSynBind idL idR -> XPSB idL idR
+ Retrie.GHC: [psb_id] :: PatSynBind idL idR -> Located (IdP idL)
+ Retrie.GHC: [rcon_con_expr] :: RecordConTc -> PostTcExpr
+ Retrie.GHC: [rcon_con_like] :: RecordConTc -> ConLike
+ Retrie.GHC: [rcon_con_name] :: HsExpr p -> Located (IdP p)
+ Retrie.GHC: [rcon_ext] :: HsExpr p -> XRecordCon p
+ Retrie.GHC: [rcon_flds] :: HsExpr p -> HsRecordBinds p
+ Retrie.GHC: [rd_act] :: RuleDecl pass -> Activation
+ Retrie.GHC: [rd_ext] :: RuleDecl pass -> XHsRule pass
+ Retrie.GHC: [rd_lhs] :: RuleDecl pass -> Located (HsExpr pass)
+ Retrie.GHC: [rd_name] :: RuleDecl pass -> Located (SourceText, RuleName)
+ Retrie.GHC: [rd_rhs] :: RuleDecl pass -> Located (HsExpr pass)
+ Retrie.GHC: [rd_tmvs] :: RuleDecl pass -> [LRuleBndr pass]
+ Retrie.GHC: [rd_tyvs] :: RuleDecl pass -> Maybe [LHsTyVarBndr (NoGhcTc pass)]
+ Retrie.GHC: [rdrNameFieldOcc] :: FieldOcc pass -> Located RdrName
+ Retrie.GHC: [rds_ext] :: RuleDecls pass -> XCRuleDecls pass
+ Retrie.GHC: [rds_rules] :: RuleDecls pass -> [LRuleDecl pass]
+ Retrie.GHC: [rds_src] :: RuleDecls pass -> SourceText
+ Retrie.GHC: [recS_bind_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Retrie.GHC: [recS_bind_ty] :: RecStmtTc -> Type
+ Retrie.GHC: [recS_ext] :: StmtLR idL idR body -> XRecStmt idL idR body
+ Retrie.GHC: [recS_later_ids] :: StmtLR idL idR body -> [IdP idR]
+ Retrie.GHC: [recS_later_rets] :: RecStmtTc -> [PostTcExpr]
+ Retrie.GHC: [recS_mfix_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Retrie.GHC: [recS_rec_ids] :: StmtLR idL idR body -> [IdP idR]
+ Retrie.GHC: [recS_rec_rets] :: RecStmtTc -> [PostTcExpr]
+ Retrie.GHC: [recS_ret_fn] :: StmtLR idL idR body -> SyntaxExpr idR
+ Retrie.GHC: [recS_ret_ty] :: RecStmtTc -> Type
+ Retrie.GHC: [recS_stmts] :: StmtLR idL idR body -> [LStmtLR idL idR body]
+ Retrie.GHC: [rec_dotdot] :: HsRecFields p arg -> Maybe (Located Int)
+ Retrie.GHC: [rec_flds] :: HsRecFields p arg -> [LHsRecField p arg]
+ Retrie.GHC: [recordPatSynPatVar] :: RecordPatSynField a -> a
+ Retrie.GHC: [recordPatSynSelectorId] :: RecordPatSynField a -> a
+ Retrie.GHC: [rupd_cons] :: RecordUpdTc -> [ConLike]
+ Retrie.GHC: [rupd_expr] :: HsExpr p -> LHsExpr p
+ Retrie.GHC: [rupd_ext] :: HsExpr p -> XRecordUpd p
+ Retrie.GHC: [rupd_flds] :: HsExpr p -> [LHsRecUpdField p]
+ Retrie.GHC: [rupd_in_tys] :: RecordUpdTc -> [Type]
+ Retrie.GHC: [rupd_out_tys] :: RecordUpdTc -> [Type]
+ Retrie.GHC: [rupd_wrap] :: RecordUpdTc -> HsWrapper
+ Retrie.GHC: [syn_arg_wraps] :: SyntaxExpr p -> [HsWrapper]
+ Retrie.GHC: [syn_expr] :: SyntaxExpr p -> HsExpr p
+ Retrie.GHC: [syn_res_wrap] :: SyntaxExpr p -> HsWrapper
+ Retrie.GHC: [tcdATDefs] :: TyClDecl pass -> [LTyFamDefltDecl pass]
+ Retrie.GHC: [tcdATs] :: TyClDecl pass -> [LFamilyDecl pass]
+ Retrie.GHC: [tcdCExt] :: TyClDecl pass -> XClassDecl pass
+ Retrie.GHC: [tcdCtxt] :: TyClDecl pass -> LHsContext pass
+ Retrie.GHC: [tcdDExt] :: TyClDecl pass -> XDataDecl pass
+ Retrie.GHC: [tcdDataCusk] :: DataDeclRn -> Bool
+ Retrie.GHC: [tcdDataDefn] :: TyClDecl pass -> HsDataDefn pass
+ Retrie.GHC: [tcdDocs] :: TyClDecl pass -> [LDocDecl]
+ Retrie.GHC: [tcdFDs] :: TyClDecl pass -> [LHsFunDep pass]
+ Retrie.GHC: [tcdFExt] :: TyClDecl pass -> XFamDecl pass
+ Retrie.GHC: [tcdFVs] :: DataDeclRn -> NameSet
+ Retrie.GHC: [tcdFam] :: TyClDecl pass -> FamilyDecl pass
+ Retrie.GHC: [tcdFixity] :: TyClDecl pass -> LexicalFixity
+ Retrie.GHC: [tcdLName] :: TyClDecl pass -> Located (IdP pass)
+ Retrie.GHC: [tcdMeths] :: TyClDecl pass -> LHsBinds pass
+ Retrie.GHC: [tcdRhs] :: TyClDecl pass -> LHsType pass
+ Retrie.GHC: [tcdSExt] :: TyClDecl pass -> XSynDecl pass
+ Retrie.GHC: [tcdSigs] :: TyClDecl pass -> [LSig pass]
+ Retrie.GHC: [tcdTyVars] :: TyClDecl pass -> LHsQTyVars pass
+ Retrie.GHC: [tfid_eqn] :: TyFamInstDecl pass -> TyFamInstEqn pass
+ Retrie.GHC: [tfid_ext] :: InstDecl pass -> XTyFamInstD pass
+ Retrie.GHC: [tfid_inst] :: InstDecl pass -> TyFamInstDecl pass
+ Retrie.GHC: [trS_bind] :: StmtLR idL idR body -> SyntaxExpr idR
+ Retrie.GHC: [trS_bndrs] :: StmtLR idL idR body -> [(IdP idR, IdP idR)]
+ Retrie.GHC: [trS_by] :: StmtLR idL idR body -> Maybe (LHsExpr idR)
+ Retrie.GHC: [trS_ext] :: StmtLR idL idR body -> XTransStmt idL idR body
+ Retrie.GHC: [trS_fmap] :: StmtLR idL idR body -> HsExpr idR
+ Retrie.GHC: [trS_form] :: StmtLR idL idR body -> TransForm
+ Retrie.GHC: [trS_ret] :: StmtLR idL idR body -> SyntaxExpr idR
+ Retrie.GHC: [trS_stmts] :: StmtLR idL idR body -> [ExprLStmt idL]
+ Retrie.GHC: [trS_using] :: StmtLR idL idR body -> LHsExpr idR
+ Retrie.GHC: [var_ext] :: HsBindLR idL idR -> XVarBind idL idR
+ Retrie.GHC: [var_id] :: HsBindLR idL idR -> IdP idL
+ Retrie.GHC: [var_inline] :: HsBindLR idL idR -> Bool
+ Retrie.GHC: [var_rhs] :: HsBindLR idL idR -> LHsExpr idR
+ Retrie.GHC: [wd_ext] :: WarnDecls pass -> XWarnings pass
+ Retrie.GHC: [wd_src] :: WarnDecls pass -> SourceText
+ Retrie.GHC: [wd_warnings] :: WarnDecls pass -> [LWarnDecl pass]
+ Retrie.GHC: [xarg_app_arg_many] :: ApplicativeArg idL -> XApplicativeArgMany idL
+ Retrie.GHC: [xarg_app_arg_one] :: ApplicativeArg idL -> XApplicativeArgOne idL
+ Retrie.GHC: ambiguousFieldOcc :: FieldOcc GhcTc -> AmbiguousFieldOcc GhcTc
+ Retrie.GHC: annProvenanceName_maybe :: AnnProvenance name -> Maybe name
+ Retrie.GHC: appendDocs :: HsDocString -> HsDocString -> HsDocString
+ Retrie.GHC: appendGroups :: forall (p :: Pass). HsGroup (GhcPass p) -> HsGroup (GhcPass p) -> HsGroup (GhcPass p)
+ Retrie.GHC: cLPat :: Located (Pat (GhcPass p)) -> LPat (GhcPass p)
+ Retrie.GHC: chunkify :: [a] -> [[a]]
+ Retrie.GHC: class Convertable a b | a -> b
+ Retrie.GHC: collectEvVarsPat :: Pat GhcTc -> Bag EvVar
+ Retrie.GHC: collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar
+ Retrie.GHC: collectHsBindBinders :: (SrcSpanLess (LPat p) ~ Pat p, HasSrcSpan (LPat p)) => HsBindLR p idR -> [IdP p]
+ Retrie.GHC: collectHsBindListBinders :: forall (p :: Pass) idR. [LHsBindLR (GhcPass p) idR] -> [IdP (GhcPass p)]
+ Retrie.GHC: collectHsBindsBinders :: forall (p :: Pass) idR. LHsBindsLR (GhcPass p) idR -> [IdP (GhcPass p)]
+ Retrie.GHC: collectHsIdBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectHsValBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectLStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. LStmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectLStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [LStmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectLocalBinders :: forall (idL :: Pass) (idR :: Pass). HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectMethodBinders :: LHsBindsLR idL idR -> [Located (IdP idL)]
+ Retrie.GHC: collectPatBinders :: forall (p :: Pass). LPat (GhcPass p) -> [IdP (GhcPass p)]
+ Retrie.GHC: collectPatsBinders :: forall (p :: Pass). [LPat (GhcPass p)] -> [IdP (GhcPass p)]
+ Retrie.GHC: collectRuleBndrSigTys :: [RuleBndr pass] -> [LHsSigWcType pass]
+ Retrie.GHC: collectStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. StmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
+ Retrie.GHC: collectStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [StmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
+ Retrie.GHC: concatDocs :: [HsDocString] -> Maybe HsDocString
+ Retrie.GHC: convert :: Convertable a b => a -> b
+ Retrie.GHC: convertLit :: ConvertIdX a b => HsLit a -> HsLit b
+ Retrie.GHC: countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
+ Retrie.GHC: dLPat :: LPat (GhcPass p) -> Maybe (Located (Pat (GhcPass p)))
+ Retrie.GHC: dLPatUnsafe :: LPat (GhcPass p) -> Located (Pat (GhcPass p))
+ Retrie.GHC: data ABExport p
+ Retrie.GHC: data AmbiguousFieldOcc pass
+ Retrie.GHC: data AnnDecl pass
+ Retrie.GHC: data AnnProvenance name
+ Retrie.GHC: data ApplicativeArg idL
+ Retrie.GHC: data ArithSeqInfo id
+ Retrie.GHC: data CImportSpec
+ Retrie.GHC: data ClsInstDecl pass
+ Retrie.GHC: data CmdTopTc
+ Retrie.GHC: data ConDecl pass
+ Retrie.GHC: data ConDeclField pass
+ Retrie.GHC: data DataDeclRn
+ Retrie.GHC: data DefaultDecl pass
+ Retrie.GHC: data DelayedSplice
+ Retrie.GHC: data DerivDecl pass
+ Retrie.GHC: data DerivStrategy pass
+ Retrie.GHC: data DocDecl
+ Retrie.GHC: data FamEqn pass rhs
+ Retrie.GHC: data FamilyDecl pass
+ Retrie.GHC: data FamilyInfo pass
+ Retrie.GHC: data FamilyResultSig pass
+ Retrie.GHC: data FieldOcc pass
+ Retrie.GHC: data Fixity
+ Retrie.GHC: data FixitySig pass
+ Retrie.GHC: data ForallVisFlag
+ Retrie.GHC: data ForeignDecl pass
+ Retrie.GHC: data ForeignExport
+ Retrie.GHC: data ForeignImport
+ Retrie.GHC: data GRHS p body
+ Retrie.GHC: data GRHSs p body
+ Retrie.GHC: data GhcPass (c :: Pass)
+ Retrie.GHC: data HsArg tm ty
+ Retrie.GHC: data HsArrAppType
+ Retrie.GHC: data HsBindLR idL idR
+ Retrie.GHC: data HsBracket p
+ Retrie.GHC: data HsCmd id
+ Retrie.GHC: data HsCmdTop p
+ Retrie.GHC: data HsConDetails arg rec
+ Retrie.GHC: data HsDataDefn pass
+ Retrie.GHC: data HsDecl p
+ Retrie.GHC: data HsDerivingClause pass
+ Retrie.GHC: data HsDocString
+ Retrie.GHC: data HsExpr p
+ Retrie.GHC: data HsGroup p
+ Retrie.GHC: data HsIPBinds id
+ Retrie.GHC: data HsImplBang
+ Retrie.GHC: data HsImplicitBndrs pass thing
+ Retrie.GHC: data HsLit x
+ Retrie.GHC: data HsLocalBindsLR idL idR
+ Retrie.GHC: data HsMatchContext id
+ Retrie.GHC: data HsOverLit p
+ Retrie.GHC: data HsPatSynDir id
+ Retrie.GHC: data HsRecField' id arg
+ Retrie.GHC: data HsRecFields p arg
+ Retrie.GHC: data HsRuleRn
+ Retrie.GHC: data HsSplice id
+ Retrie.GHC: data HsSplicedThing id
+ Retrie.GHC: data HsSrcBang
+ Retrie.GHC: data HsStmtContext id
+ Retrie.GHC: data HsTupArg id
+ Retrie.GHC: data HsTupleSort
+ Retrie.GHC: data HsTyLit
+ Retrie.GHC: data HsTyVarBndr pass
+ Retrie.GHC: data HsType pass
+ Retrie.GHC: data HsValBindsLR idL idR
+ Retrie.GHC: data HsWildCardBndrs pass thing
+ Retrie.GHC: data IE pass
+ Retrie.GHC: data IEWildcard
+ Retrie.GHC: data IEWrappedName name
+ Retrie.GHC: data IPBind id
+ Retrie.GHC: data ImportDecl pass
+ Retrie.GHC: data ImportDeclQualifiedStyle
+ Retrie.GHC: data InjectivityAnn pass
+ Retrie.GHC: data InstDecl pass
+ Retrie.GHC: data LHsQTyVars pass
+ Retrie.GHC: data ListPatTc
+ Retrie.GHC: data Match p body
+ Retrie.GHC: data MatchGroup p body
+ Retrie.GHC: data MatchGroupTc
+ Retrie.GHC: data NHsValBindsLR idL
+ Retrie.GHC: data NPatBindTc
+ Retrie.GHC: data NewHsTypeX
+ Retrie.GHC: data NewOrData
+ Retrie.GHC: data NoExtCon
+ Retrie.GHC: data NoExtField
+ Retrie.GHC: data OverLitTc
+ Retrie.GHC: data OverLitVal
+ Retrie.GHC: data ParStmtBlock idL idR
+ Retrie.GHC: data Pass
+ Retrie.GHC: data Pat p
+ Retrie.GHC: data PatSynBind idL idR
+ Retrie.GHC: data PendingRnSplice
+ Retrie.GHC: data PendingTcSplice
+ Retrie.GHC: data RecStmtTc
+ Retrie.GHC: data RecordConTc
+ Retrie.GHC: data RecordPatSynField a
+ Retrie.GHC: data RecordUpdTc
+ Retrie.GHC: data RoleAnnotDecl pass
+ Retrie.GHC: data RuleBndr pass
+ Retrie.GHC: data RuleDecl pass
+ Retrie.GHC: data RuleDecls pass
+ Retrie.GHC: data Sig pass
+ Retrie.GHC: data SpliceDecl p
+ Retrie.GHC: data SpliceDecoration
+ Retrie.GHC: data SpliceExplicitFlag
+ Retrie.GHC: data SrcStrictness
+ Retrie.GHC: data SrcUnpackedness
+ Retrie.GHC: data StandaloneKindSig pass
+ Retrie.GHC: data StmtLR idL idR body
+ Retrie.GHC: data SyntaxExpr p
+ Retrie.GHC: data TcSpecPrag
+ Retrie.GHC: data TcSpecPrags
+ Retrie.GHC: data TransForm
+ Retrie.GHC: data TyClDecl pass
+ Retrie.GHC: data TyClGroup pass
+ Retrie.GHC: data UnboundVar
+ Retrie.GHC: data UntypedSpliceFlavour
+ Retrie.GHC: data WarnDecl pass
+ Retrie.GHC: data WarnDecls pass
+ Retrie.GHC: derivStrategyName :: DerivStrategy a -> SDoc
+ Retrie.GHC: docDeclDoc :: DocDecl -> HsDocString
+ Retrie.GHC: dropWildCards :: LHsSigWcType pass -> LHsSigType pass
+ Retrie.GHC: emptyArgDocMap :: ArgDocMap
+ Retrie.GHC: emptyDeclDocMap :: DeclDocMap
+ Retrie.GHC: emptyLHsBinds :: LHsBindsLR idL idR
+ Retrie.GHC: emptyLHsQTvs :: LHsQTyVars GhcRn
+ Retrie.GHC: emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b)
+ Retrie.GHC: emptyRdrGroup :: forall (p :: Pass). HsGroup (GhcPass p)
+ Retrie.GHC: emptyRecStmt :: forall (idL :: Pass) bodyR. StmtLR (GhcPass idL) GhcPs bodyR
+ Retrie.GHC: emptyRecStmtId :: StmtLR GhcTc GhcTc bodyR
+ Retrie.GHC: emptyRecStmtName :: StmtLR GhcRn GhcRn bodyR
+ Retrie.GHC: emptyRnGroup :: forall (p :: Pass). HsGroup (GhcPass p)
+ Retrie.GHC: emptyTransStmt :: StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Retrie.GHC: emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
+ Retrie.GHC: emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
+ Retrie.GHC: eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
+ Retrie.GHC: famResultKindSignature :: forall (p :: Pass). FamilyResultSig (GhcPass p) -> Maybe (LHsKind (GhcPass p))
+ Retrie.GHC: familyDeclLName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Retrie.GHC: familyDeclName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: flattenRuleDecls :: [LRuleDecls pass] -> [LRuleDecl pass]
+ Retrie.GHC: foldDerivStrategy :: forall p (pass :: Pass) r. p ~ GhcPass pass => r -> (XViaStrategy p -> r) -> DerivStrategy p -> r
+ Retrie.GHC: getBangStrictness :: LHsType a -> HsSrcBang
+ Retrie.GHC: getBangType :: LHsType a -> LHsType a
+ Retrie.GHC: getConArgs :: ConDecl pass -> HsConDeclDetails pass
+ Retrie.GHC: getConNames :: forall (p :: Pass). ConDecl (GhcPass p) -> [Located (IdP (GhcPass p))]
+ Retrie.GHC: getLHsInstDeclClass_maybe :: forall (p :: Pass). LHsSigType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
+ Retrie.GHC: getLHsInstDeclHead :: forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: getPatSynBinds :: [(RecFlag, LHsBinds id)] -> [PatSynBind id id]
+ Retrie.GHC: getRealLoc :: SrcLoc -> Maybe RealSrcLoc
+ Retrie.GHC: getRealSpan :: SrcSpan -> Maybe RealSrcSpan
+ Retrie.GHC: hasSpecPrags :: TcSpecPrags -> Bool
+ Retrie.GHC: hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
+ Retrie.GHC: hsConDeclArgTys :: HsConDeclDetails pass -> [LBangType pass]
+ Retrie.GHC: hsConDeclTheta :: Maybe (LHsContext pass) -> [LHsType pass]
+ Retrie.GHC: hsConDetailsArgs :: HsConDetails (LHsType a) (Located [LConDeclField a]) -> [LHsType a]
+ Retrie.GHC: hsConPatArgs :: HsConPatDetails p -> [LPat p]
+ Retrie.GHC: hsDataFamInstBinders :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
+ Retrie.GHC: hsDeclHasCusk :: TyClDecl GhcRn -> Bool
+ Retrie.GHC: hsDocStringToByteString :: HsDocString -> ByteString
+ Retrie.GHC: hsExplicitLTyVarNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
+ Retrie.GHC: hsExprNeedsParens :: PprPrec -> HsExpr p -> Bool
+ Retrie.GHC: hsForeignDeclsBinders :: [LForeignDecl pass] -> [Located (IdP pass)]
+ Retrie.GHC: hsGroupBinders :: HsGroup GhcRn -> [Name]
+ Retrie.GHC: hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
+ Retrie.GHC: hsIPNameFS :: HsIPName -> FastString
+ Retrie.GHC: hsImplicitBody :: forall (p :: Pass) thing. HsImplicitBndrs (GhcPass p) thing -> thing
+ Retrie.GHC: hsLMatchPats :: forall (id :: Pass) body. LMatch (GhcPass id) body -> [LPat (GhcPass id)]
+ Retrie.GHC: hsLTyClDeclBinders :: forall (p :: Pass). Located (TyClDecl (GhcPass p)) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
+ Retrie.GHC: hsLTyVarBndrToType :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: hsLTyVarBndrsToTypes :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [LHsType (GhcPass p)]
+ Retrie.GHC: hsLTyVarLocName :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> Located (IdP (GhcPass p))
+ Retrie.GHC: hsLTyVarLocNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [Located (IdP (GhcPass p))]
+ Retrie.GHC: hsLTyVarName :: forall (p :: Pass). LHsTyVarBndr (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: hsLTyVarNames :: forall (p :: Pass). [LHsTyVarBndr (GhcPass p)] -> [IdP (GhcPass p)]
+ Retrie.GHC: hsLitNeedsParens :: PprPrec -> HsLit x -> Bool
+ Retrie.GHC: hsOverLitNeedsParens :: PprPrec -> HsOverLit x -> Bool
+ Retrie.GHC: hsPatSynSelectors :: forall (p :: Pass). HsValBinds (GhcPass p) -> [IdP (GhcPass p)]
+ Retrie.GHC: hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr pass]
+ Retrie.GHC: hsRecFieldId :: HsRecField GhcTc arg -> Located Id
+ Retrie.GHC: hsRecFieldSel :: HsRecField pass arg -> Located (XCFieldOcc pass)
+ Retrie.GHC: hsRecFields :: HsRecFields p arg -> [XCFieldOcc p]
+ Retrie.GHC: hsRecFieldsArgs :: HsRecFields p arg -> [arg]
+ Retrie.GHC: hsRecUpdFieldId :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> Located Id
+ Retrie.GHC: hsRecUpdFieldOcc :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc
+ Retrie.GHC: hsRecUpdFieldRdr :: forall (p :: Pass). HsRecUpdField (GhcPass p) -> Located RdrName
+ Retrie.GHC: hsScopedTvs :: LHsSigType GhcRn -> [Name]
+ Retrie.GHC: hsSigDoc :: Sig name -> SDoc
+ Retrie.GHC: hsSigType :: forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: hsSigWcType :: LHsSigWcType pass -> LHsType pass
+ Retrie.GHC: hsTvbAllKinded :: LHsQTyVars pass -> Bool
+ Retrie.GHC: hsTyClForeignBinders :: [TyClGroup GhcRn] -> [LForeignDecl GhcRn] -> [Name]
+ Retrie.GHC: hsTyGetAppHead_maybe :: forall (p :: Pass). LHsType (GhcPass p) -> Maybe (Located (IdP (GhcPass p)))
+ Retrie.GHC: hsTyKindSig :: LHsType pass -> Maybe (LHsKind pass)
+ Retrie.GHC: hsTyVarName :: forall (p :: Pass). HsTyVarBndr (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: hsTypeNeedsParens :: PprPrec -> HsType pass -> Bool
+ Retrie.GHC: hsValBindsImplicits :: forall (idR :: Pass). HsValBindsLR GhcRn (GhcPass idR) -> [(SrcSpan, [Name])]
+ Retrie.GHC: hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
+ Retrie.GHC: hsmodDecls :: HsModule pass -> [LHsDecl pass]
+ Retrie.GHC: hsmodDeprecMessage :: HsModule pass -> Maybe (Located WarningTxt)
+ Retrie.GHC: hsmodExports :: HsModule pass -> Maybe (Located [LIE pass])
+ Retrie.GHC: hsmodHaddockModHeader :: HsModule pass -> Maybe LHsDocString
+ Retrie.GHC: hsmodImports :: HsModule pass -> [LImportDecl pass]
+ Retrie.GHC: hsmodName :: HsModule pass -> Maybe (Located ModuleName)
+ Retrie.GHC: ieLWrappedName :: LIEWrappedName name -> Located name
+ Retrie.GHC: ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
+ Retrie.GHC: ieWrappedName :: IEWrappedName name -> name
+ Retrie.GHC: ignoreParens :: LHsType pass -> LHsType pass
+ Retrie.GHC: importDeclQualifiedStyle :: Maybe (Located a) -> Maybe (Located a) -> ImportDeclQualifiedStyle
+ Retrie.GHC: instDeclDataFamInsts :: forall (p :: Pass). [LInstDecl (GhcPass p)] -> [DataFamInstDecl (GhcPass p)]
+ Retrie.GHC: isAtomicHsExpr :: HsExpr id -> Bool
+ Retrie.GHC: isBangedHsBind :: HsBind GhcTc -> Bool
+ Retrie.GHC: isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool
+ Retrie.GHC: isClassDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
+ Retrie.GHC: isCompleteMatchSig :: LSig name -> Bool
+ Retrie.GHC: isComprehensionContext :: HsStmtContext id -> Bool
+ Retrie.GHC: isDataDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isDataFamilyDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isDefaultMethod :: TcSpecPrags -> Bool
+ Retrie.GHC: isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool
+ Retrie.GHC: isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool
+ Retrie.GHC: isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
+ Retrie.GHC: isEmptyLHsQTvs :: LHsQTyVars GhcRn -> Bool
+ Retrie.GHC: isEmptyLocalBindsPR :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b) -> Bool
+ Retrie.GHC: isEmptyLocalBindsTc :: forall (a :: Pass). HsLocalBindsLR (GhcPass a) GhcTc -> Bool
+ Retrie.GHC: isEmptyMatchGroup :: MatchGroup id body -> Bool
+ Retrie.GHC: isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool
+ Retrie.GHC: isFamilyDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isFixityLSig :: LSig name -> Bool
+ Retrie.GHC: isHsKindedTyVar :: HsTyVarBndr pass -> Bool
+ Retrie.GHC: isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
+ Retrie.GHC: isInfixFunBind :: HsBindLR id1 id2 -> Bool
+ Retrie.GHC: isInfixMatch :: Match id body -> Bool
+ Retrie.GHC: isInlineLSig :: LSig name -> Bool
+ Retrie.GHC: isIrrefutableHsPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> Bool
+ Retrie.GHC: isLHsForAllTy :: LHsType p -> Bool
+ Retrie.GHC: isMinimalLSig :: LSig name -> Bool
+ Retrie.GHC: isMonadCompContext :: HsStmtContext id -> Bool
+ Retrie.GHC: isMonadFailStmtContext :: HsStmtContext id -> Bool
+ Retrie.GHC: isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
+ Retrie.GHC: isPatSynCtxt :: HsMatchContext id -> Bool
+ Retrie.GHC: isPragLSig :: LSig name -> Bool
+ Retrie.GHC: isQuietHsCmd :: HsCmd id -> Bool
+ Retrie.GHC: isQuietHsExpr :: HsExpr id -> Bool
+ Retrie.GHC: isSCCFunSig :: LSig name -> Bool
+ Retrie.GHC: isSingletonMatchGroup :: [LMatch id body] -> Bool
+ Retrie.GHC: isSpecInstLSig :: LSig name -> Bool
+ Retrie.GHC: isSpecLSig :: LSig name -> Bool
+ Retrie.GHC: isSynDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isTypeFamilyDecl :: TyClDecl pass -> Bool
+ Retrie.GHC: isTypeLSig :: LSig name -> Bool
+ Retrie.GHC: isTypedBracket :: HsBracket id -> Bool
+ Retrie.GHC: isTypedSplice :: HsSplice id -> Bool
+ Retrie.GHC: isUnliftedHsBind :: HsBind GhcTc -> Bool
+ Retrie.GHC: lPatImplicits :: LPat GhcRn -> [(SrcSpan, [Name])]
+ Retrie.GHC: lStmtsImplicits :: forall (idR :: Pass) body. [LStmtLR GhcRn (GhcPass idR) (Located (body (GhcPass idR)))] -> [(SrcSpan, [Name])]
+ Retrie.GHC: lieWrappedName :: LIEWrappedName name -> name
+ Retrie.GHC: looksLazyPatBind :: forall (p :: Pass). HsBind (GhcPass p) -> Bool
+ Retrie.GHC: mapDerivStrategy :: forall p (pass :: Pass). p ~ GhcPass pass => (XViaStrategy p -> XViaStrategy p) -> DerivStrategy p -> DerivStrategy p
+ Retrie.GHC: matchContextErrString :: Outputable id => HsMatchContext id -> SDoc
+ Retrie.GHC: matchGroupArity :: forall (id :: Pass) body. MatchGroup (GhcPass id) body -> Arity
+ Retrie.GHC: matchSeparator :: HsMatchContext id -> SDoc
+ Retrie.GHC: missingTupArg :: HsTupArg GhcPs
+ Retrie.GHC: mkAmbiguousFieldOcc :: Located RdrName -> AmbiguousFieldOcc GhcPs
+ Retrie.GHC: mkAnonWildCardTy :: HsType GhcPs
+ Retrie.GHC: mkBigLHsPatTup :: [LPat GhcRn] -> LPat GhcRn
+ Retrie.GHC: mkBigLHsTup :: forall (id :: Pass). [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkBigLHsVarPatTup :: [IdP GhcRn] -> LPat GhcRn
+ Retrie.GHC: mkBigLHsVarTup :: forall (id :: Pass). [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: 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)))
+ Retrie.GHC: mkBodyStmt :: forall bodyR (idL :: Pass). Located (bodyR GhcPs) -> StmtLR (GhcPass idL) GhcPs (Located (bodyR GhcPs))
+ Retrie.GHC: mkCharLitPat :: forall (p :: Pass). SourceText -> Char -> OutPat (GhcPass p)
+ Retrie.GHC: mkChunkified :: ([a] -> a) -> [a] -> a
+ Retrie.GHC: mkClassOpSigs :: [LSig GhcPs] -> [LSig GhcPs]
+ Retrie.GHC: mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs GhcRn thing
+ Retrie.GHC: mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs GhcRn thing
+ Retrie.GHC: mkFieldOcc :: Located RdrName -> FieldOcc GhcPs
+ Retrie.GHC: mkFunBind :: Origin -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> HsBind GhcPs
+ Retrie.GHC: mkGroupByUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Retrie.GHC: mkGroupUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Retrie.GHC: mkHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkHsAppKindTy :: forall (p :: Pass). XAppKindTy (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: mkHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: mkHsAppType :: forall (id :: Pass). NoGhcTc (GhcPass id) ~ GhcRn => LHsExpr (GhcPass id) -> LHsWcType GhcRn -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkHsAppTypes :: LHsExpr GhcRn -> [LHsWcType GhcRn] -> LHsExpr GhcRn
+ Retrie.GHC: mkHsAppTys :: forall (p :: Pass). LHsType (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
+ Retrie.GHC: mkHsCaseAlt :: forall (p :: Pass) body. LPat (GhcPass p) -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
+ Retrie.GHC: mkHsCmdIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p) -> HsCmd (GhcPass p)
+ Retrie.GHC: mkHsCmdWrap :: forall (p :: Pass). HsWrapper -> HsCmd (GhcPass p) -> HsCmd (GhcPass p)
+ Retrie.GHC: mkHsComp :: HsStmtContext Name -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> HsExpr GhcPs
+ Retrie.GHC: mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
+ Retrie.GHC: mkHsDo :: HsStmtContext Name -> [ExprLStmt GhcPs] -> HsExpr GhcPs
+ Retrie.GHC: mkHsDocString :: String -> HsDocString
+ Retrie.GHC: mkHsDocStringUtf8ByteString :: ByteString -> HsDocString
+ Retrie.GHC: mkHsFractional :: FractionalLit -> HsOverLit GhcPs
+ Retrie.GHC: mkHsIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> HsExpr (GhcPass p)
+ Retrie.GHC: mkHsImplicitBndrs :: thing -> HsImplicitBndrs GhcPs thing
+ Retrie.GHC: mkHsIntegral :: IntegralLit -> HsOverLit GhcPs
+ Retrie.GHC: mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs
+ Retrie.GHC: mkHsLam :: forall (p :: Pass). XMG (GhcPass p) (LHsExpr (GhcPass p)) ~ NoExtField => [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
+ Retrie.GHC: mkHsLams :: [TyVar] -> [EvVar] -> LHsExpr GhcTc -> LHsExpr GhcTc
+ Retrie.GHC: mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs
+ Retrie.GHC: mkHsOpTy :: forall (p :: Pass). LHsType (GhcPass p) -> Located (IdP (GhcPass p)) -> LHsType (GhcPass p) -> HsType (GhcPass p)
+ Retrie.GHC: mkHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkHsQTvs :: [LHsTyVarBndr GhcPs] -> LHsQTyVars GhcPs
+ Retrie.GHC: mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
+ Retrie.GHC: mkHsSigEnv :: (LSig GhcRn -> Maybe ([Located Name], a)) -> [LSig GhcRn] -> NameEnv a
+ Retrie.GHC: mkHsString :: forall (p :: Pass). String -> HsLit (GhcPass p)
+ Retrie.GHC: mkHsStringPrimLit :: forall (p :: Pass). FastString -> HsLit (GhcPass p)
+ Retrie.GHC: mkHsVarBind :: SrcSpan -> RdrName -> LHsExpr GhcPs -> LHsBind GhcPs
+ Retrie.GHC: mkHsWildCardBndrs :: thing -> HsWildCardBndrs GhcPs thing
+ Retrie.GHC: mkHsWrap :: forall (id :: Pass). HsWrapper -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Retrie.GHC: mkHsWrapCo :: forall (id :: Pass). TcCoercionN -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Retrie.GHC: mkHsWrapCoR :: forall (id :: Pass). TcCoercionR -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
+ Retrie.GHC: mkHsWrapPat :: forall (id :: Pass). HsWrapper -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
+ Retrie.GHC: mkHsWrapPatCo :: forall (id :: Pass). TcCoercionN -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
+ Retrie.GHC: mkLHsCmdWrap :: forall (p :: Pass). HsWrapper -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p)
+ Retrie.GHC: mkLHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkLHsSigType :: LHsType GhcPs -> LHsSigType GhcPs
+ Retrie.GHC: mkLHsSigWcType :: LHsType GhcPs -> LHsSigWcType GhcPs
+ Retrie.GHC: mkLHsTupleExpr :: forall (a :: Pass). [LHsExpr (GhcPass a)] -> LHsExpr (GhcPass a)
+ Retrie.GHC: mkLHsVarTuple :: forall (a :: Pass). [IdP (GhcPass a)] -> LHsExpr (GhcPass a)
+ Retrie.GHC: mkLHsWrap :: forall (id :: Pass). HsWrapper -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkLHsWrapCo :: forall (id :: Pass). TcCoercionN -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: mkLastStmt :: forall bodyR (idR :: Pass) (idL :: Pass). Located (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
+ Retrie.GHC: 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))
+ Retrie.GHC: mkMatchGroup :: XMG name (Located (body name)) ~ NoExtField => Origin -> [LMatch name (Located (body name))] -> MatchGroup name (Located (body name))
+ Retrie.GHC: mkNPat :: Located (HsOverLit GhcPs) -> Maybe (SyntaxExpr GhcPs) -> Pat GhcPs
+ Retrie.GHC: mkNPlusKPat :: Located RdrName -> Located (HsOverLit GhcPs) -> Pat GhcPs
+ Retrie.GHC: mkNilPat :: forall (p :: Pass). Type -> OutPat (GhcPass p)
+ Retrie.GHC: mkParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
+ Retrie.GHC: mkPatSynBind :: Located RdrName -> HsPatSynDetails (Located RdrName) -> LPat GhcPs -> HsPatSynDir GhcPs -> HsBind GhcPs
+ Retrie.GHC: mkPrefixConPat :: forall (p :: Pass). DataCon -> [OutPat (GhcPass p)] -> [Type] -> OutPat (GhcPass p)
+ Retrie.GHC: mkPrefixFunRhs :: Located id -> HsMatchContext id
+ Retrie.GHC: mkRecStmt :: forall (idL :: Pass) bodyR. [LStmtLR (GhcPass idL) GhcPs bodyR] -> StmtLR (GhcPass idL) GhcPs bodyR
+ Retrie.GHC: mkRnSyntaxExpr :: Name -> SyntaxExpr GhcRn
+ Retrie.GHC: mkSimpleGeneratedFunBind :: SrcSpan -> RdrName -> [LPat GhcPs] -> LHsExpr GhcPs -> LHsBind GhcPs
+ Retrie.GHC: mkSimpleMatch :: forall (p :: Pass) body. HsMatchContext (NameOrRdrName (IdP (GhcPass p))) -> [LPat (GhcPass p)] -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
+ Retrie.GHC: mkSyntaxExpr :: forall (p :: Pass). HsExpr (GhcPass p) -> SyntaxExpr (GhcPass p)
+ Retrie.GHC: mkTcBindStmt :: LPat GhcTc -> Located (bodyR GhcTc) -> StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
+ Retrie.GHC: mkTopFunBind :: Origin -> Located Name -> [LMatch GhcRn (LHsExpr GhcRn)] -> HsBind GhcRn
+ Retrie.GHC: mkTransformByStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Retrie.GHC: mkTransformStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
+ Retrie.GHC: mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
+ Retrie.GHC: mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
+ Retrie.GHC: mkVarBind :: forall (p :: Pass). IdP (GhcPass p) -> LHsExpr (GhcPass p) -> LHsBind (GhcPass p)
+ Retrie.GHC: negateOverLitVal :: OverLitVal -> OverLitVal
+ Retrie.GHC: newOrDataToFlavour :: NewOrData -> TyConFlavour
+ Retrie.GHC: newtype ArgDocMap
+ Retrie.GHC: newtype DataFamInstDecl pass
+ Retrie.GHC: newtype DeclDocMap
+ Retrie.GHC: newtype HsIPName
+ Retrie.GHC: newtype ThModFinalizers
+ Retrie.GHC: newtype TyFamInstDecl pass
+ Retrie.GHC: nlConPat :: RdrName -> [LPat GhcPs] -> LPat GhcPs
+ Retrie.GHC: nlConPatName :: Name -> [LPat GhcRn] -> LPat GhcRn
+ Retrie.GHC: nlConVarPat :: RdrName -> [RdrName] -> LPat GhcPs
+ Retrie.GHC: nlConVarPatName :: Name -> [Name] -> LPat GhcRn
+ Retrie.GHC: nlHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsAppKindTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsKind (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsApps :: forall (id :: Pass). IdP (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsCase :: LHsExpr GhcPs -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
+ Retrie.GHC: nlHsDataCon :: DataCon -> LHsExpr GhcTc
+ Retrie.GHC: nlHsDo :: HsStmtContext Name -> [LStmt GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
+ Retrie.GHC: nlHsFunTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsIf :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsIntLit :: forall (p :: Pass). Integer -> LHsExpr (GhcPass p)
+ Retrie.GHC: nlHsLam :: LMatch GhcPs (LHsExpr GhcPs) -> LHsExpr GhcPs
+ Retrie.GHC: nlHsLit :: forall (p :: Pass). HsLit (GhcPass p) -> LHsExpr (GhcPass p)
+ Retrie.GHC: nlHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs
+ Retrie.GHC: nlHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsParTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsSyntaxApps :: forall (id :: Pass). SyntaxExpr (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsTyApp :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsTyApps :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsTyConApp :: forall (p :: Pass). IdP (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsTyVar :: forall (p :: Pass). IdP (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: nlHsVar :: forall (id :: Pass). IdP (GhcPass id) -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlHsVarApps :: forall (id :: Pass). IdP (GhcPass id) -> [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
+ Retrie.GHC: nlInfixConPat :: RdrName -> LPat GhcPs -> LPat GhcPs -> LPat GhcPs
+ Retrie.GHC: nlList :: [LHsExpr GhcPs] -> LHsExpr GhcPs
+ Retrie.GHC: nlLitPat :: HsLit GhcPs -> LPat GhcPs
+ Retrie.GHC: nlNullaryConPat :: forall (p :: Pass). IdP (GhcPass p) -> LPat (GhcPass p)
+ Retrie.GHC: nlParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
+ Retrie.GHC: nlTuplePat :: [LPat GhcPs] -> Boxity -> LPat GhcPs
+ Retrie.GHC: nlVarPat :: forall (id :: Pass). IdP (GhcPass id) -> LPat (GhcPass id)
+ Retrie.GHC: nlWildConPat :: DataCon -> LPat GhcPs
+ Retrie.GHC: nlWildPat :: LPat GhcPs
+ Retrie.GHC: nlWildPatName :: LPat GhcRn
+ Retrie.GHC: noExpr :: forall (p :: Pass). HsExpr (GhcPass p)
+ Retrie.GHC: noExtCon :: NoExtCon -> a
+ Retrie.GHC: noLHsContext :: LHsContext pass
+ Retrie.GHC: noSpecPrags :: TcSpecPrags
+ Retrie.GHC: noSyntaxExpr :: forall (p :: Pass). SyntaxExpr (GhcPass p)
+ Retrie.GHC: numVisibleArgs :: [HsArg tm ty] -> Arity
+ Retrie.GHC: overLitType :: HsOverLit GhcTc -> Type
+ Retrie.GHC: parenthesizeHsContext :: forall (p :: Pass). PprPrec -> LHsContext (GhcPass p) -> LHsContext (GhcPass p)
+ Retrie.GHC: parenthesizeHsExpr :: forall (p :: Pass). PprPrec -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
+ Retrie.GHC: parenthesizeHsType :: forall (p :: Pass). PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
+ Retrie.GHC: parenthesizePat :: forall (p :: Pass). PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p)
+ Retrie.GHC: patNeedsParens :: PprPrec -> Pat p -> Bool
+ Retrie.GHC: placeHolderNamesTc :: NameSet
+ Retrie.GHC: plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a)
+ Retrie.GHC: pmPprHsLit :: forall (x :: Pass). HsLit (GhcPass x) -> SDoc
+ Retrie.GHC: pp_dotdot :: SDoc
+ Retrie.GHC: pp_rhs :: Outputable body => HsMatchContext idL -> body -> SDoc
+ Retrie.GHC: pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc
+ Retrie.GHC: pprAStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
+ Retrie.GHC: pprAnonWildCard :: SDoc
+ Retrie.GHC: pprArg :: forall (idL :: Pass). OutputableBndrId idL => ApplicativeArg (GhcPass idL) -> SDoc
+ Retrie.GHC: pprBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Retrie.GHC: pprBy :: Outputable body => Maybe body -> SDoc
+ Retrie.GHC: pprCmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
+ Retrie.GHC: pprCmdArg :: forall (p :: Pass). OutputableBndrId p => HsCmdTop (GhcPass p) -> SDoc
+ Retrie.GHC: pprComp :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
+ Retrie.GHC: pprConArgs :: forall (p :: Pass). OutputableBndrId p => HsConPatDetails (GhcPass p) -> SDoc
+ Retrie.GHC: pprConDeclFields :: forall (p :: Pass). OutputableBndrId p => [LConDeclField (GhcPass p)] -> SDoc
+ Retrie.GHC: pprDataFamInstFlavour :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> SDoc
+ Retrie.GHC: pprDebugParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprDeclList :: [SDoc] -> SDoc
+ Retrie.GHC: pprDo :: forall (p :: Pass) body any. (OutputableBndrId p, Outputable body) => HsStmtContext any -> [LStmt (GhcPass p) body] -> SDoc
+ Retrie.GHC: pprExpr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
+ Retrie.GHC: pprFullRuleName :: Located (SourceText, RuleName) -> SDoc
+ Retrie.GHC: pprFunBind :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprGRHS :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHS (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprGRHSs :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHSs (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprHsBracket :: forall (p :: Pass). OutputableBndrId p => HsBracket (GhcPass p) -> SDoc
+ Retrie.GHC: pprHsExplicitForAll :: forall (p :: Pass). OutputableBndrId p => ForallVisFlag -> Maybe [LHsTyVarBndr (GhcPass p)] -> SDoc
+ Retrie.GHC: pprHsFamInstLHS :: forall (p :: Pass). OutputableBndrId p => IdP (GhcPass p) -> Maybe [LHsTyVarBndr (GhcPass p)] -> HsTyPats (GhcPass p) -> LexicalFixity -> LHsContext (GhcPass p) -> SDoc
+ Retrie.GHC: pprHsForAll :: forall (p :: Pass). OutputableBndrId p => ForallVisFlag -> [LHsTyVarBndr (GhcPass p)] -> LHsContext (GhcPass p) -> SDoc
+ Retrie.GHC: pprHsForAllExtra :: forall (p :: Pass). OutputableBndrId p => Maybe SrcSpan -> ForallVisFlag -> [LHsTyVarBndr (GhcPass p)] -> LHsContext (GhcPass p) -> SDoc
+ Retrie.GHC: pprHsType :: forall (p :: Pass). OutputableBndrId p => HsType (GhcPass p) -> SDoc
+ Retrie.GHC: pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc
+ Retrie.GHC: pprLCmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
+ Retrie.GHC: pprLExpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprLHsBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Retrie.GHC: pprLHsBindsForUser :: forall (idL :: Pass) (idR :: Pass) (id2 :: Pass). (OutputableBndrId idL, OutputableBndrId idR, OutputableBndrId id2) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> [LSig (GhcPass id2)] -> [SDoc]
+ Retrie.GHC: pprLHsContext :: forall (p :: Pass). OutputableBndrId p => LHsContext (GhcPass p) -> SDoc
+ Retrie.GHC: pprMatch :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => Match (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprMatchContext :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
+ Retrie.GHC: pprMatchContextNoun :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
+ Retrie.GHC: pprMatchInCtxt :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable (NameOrRdrName (NameOrRdrName (IdP (GhcPass idR)))), Outputable body) => Match (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprMatches :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprMinimalSig :: OutputableBndr name => LBooleanFormula (Located name) -> SDoc
+ Retrie.GHC: pprParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> HsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprParendLExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc
+ Retrie.GHC: pprPatBind :: forall (bndr :: Pass) (p :: Pass) body. (OutputableBndrId bndr, OutputableBndrId p, Outputable body) => LPat (GhcPass bndr) -> GRHSs (GhcPass p) body -> SDoc
+ Retrie.GHC: pprPendingSplice :: forall (p :: Pass). OutputableBndrId p => SplicePointName -> LHsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: pprQuals :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
+ Retrie.GHC: pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
+ Retrie.GHC: pprSplice :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
+ Retrie.GHC: pprSpliceDecl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SpliceExplicitFlag -> SDoc
+ Retrie.GHC: pprStmt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
+ Retrie.GHC: pprStmtInCtxt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => HsStmtContext (IdP (GhcPass idL)) -> StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
+ Retrie.GHC: pprTcSpecPrags :: TcSpecPrags -> SDoc
+ Retrie.GHC: pprTicks :: SDoc -> SDoc -> SDoc
+ Retrie.GHC: pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc
+ Retrie.GHC: pprTransformStmt :: forall (p :: Pass). OutputableBndrId p => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) -> Maybe (LHsExpr (GhcPass p)) -> SDoc
+ Retrie.GHC: pprTyClDeclFlavour :: forall (p :: Pass). TyClDecl (GhcPass p) -> SDoc
+ Retrie.GHC: pprTyFamInstDecl :: forall (p :: Pass). OutputableBndrId p => TopLevelFlag -> TyFamInstDecl (GhcPass p) -> SDoc
+ Retrie.GHC: pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc
+ Retrie.GHC: ppr_apps :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> [Either (LHsExpr (GhcPass p)) (LHsWcType (NoGhcTc (GhcPass p)))] -> SDoc
+ Retrie.GHC: ppr_cmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
+ Retrie.GHC: ppr_do_stmts :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => [LStmtLR (GhcPass idL) (GhcPass idR) body] -> SDoc
+ Retrie.GHC: ppr_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: ppr_infix_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> Maybe SDoc
+ Retrie.GHC: ppr_lcmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
+ Retrie.GHC: ppr_lexpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
+ Retrie.GHC: ppr_mbDoc :: Maybe LHsDocString -> SDoc
+ Retrie.GHC: ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc
+ Retrie.GHC: ppr_quasi :: OutputableBndr p => p -> p -> FastString -> SDoc
+ Retrie.GHC: ppr_sig :: forall (p :: Pass). OutputableBndrId p => Sig (GhcPass p) -> SDoc
+ Retrie.GHC: ppr_splice :: forall (p :: Pass). OutputableBndrId p => SDoc -> IdP (GhcPass p) -> LHsExpr (GhcPass p) -> SDoc -> SDoc
+ Retrie.GHC: ppr_splice_decl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
+ Retrie.GHC: pragBrackets :: SDoc -> SDoc
+ Retrie.GHC: pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc
+ Retrie.GHC: rdrNameAmbiguousFieldOcc :: forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
+ Retrie.GHC: replaceLWrappedName :: LIEWrappedName name1 -> name2 -> LIEWrappedName name2
+ Retrie.GHC: replaceWrappedName :: IEWrappedName name1 -> name2 -> IEWrappedName name2
+ Retrie.GHC: resultVariableName :: forall (a :: Pass). FamilyResultSig (GhcPass a) -> Maybe (IdP (GhcPass a))
+ Retrie.GHC: roleAnnotDeclName :: forall (p :: Pass). RoleAnnotDecl (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: selectorAmbiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> Id
+ Retrie.GHC: simpleImportDecl :: forall (p :: Pass). ModuleName -> ImportDecl (GhcPass p)
+ Retrie.GHC: splitHsFunType :: LHsType GhcRn -> ([LHsType GhcRn], LHsType GhcRn)
+ Retrie.GHC: splitLHsForAllTyInvis :: LHsType pass -> ([LHsTyVarBndr pass], LHsType pass)
+ Retrie.GHC: splitLHsInstDeclTy :: LHsSigType GhcRn -> ([Name], LHsContext GhcRn, LHsType GhcRn)
+ Retrie.GHC: splitLHsPatSynTy :: LHsType pass -> ([LHsTyVarBndr pass], LHsContext pass, [LHsTyVarBndr pass], LHsContext pass, LHsType pass)
+ Retrie.GHC: splitLHsQualTy :: LHsType pass -> (LHsContext pass, LHsType pass)
+ Retrie.GHC: splitLHsSigmaTyInvis :: LHsType pass -> ([LHsTyVarBndr pass], LHsContext pass, LHsType pass)
+ Retrie.GHC: standaloneKindSigName :: forall (p :: Pass). StandaloneKindSig (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: tcdName :: forall (p :: Pass). TyClDecl (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: thBrackets :: SDoc -> SDoc -> SDoc
+ Retrie.GHC: thTyBrackets :: SDoc -> SDoc
+ Retrie.GHC: tupArgPresent :: LHsTupArg id -> Bool
+ Retrie.GHC: tyClDeclLName :: forall (p :: Pass). TyClDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Retrie.GHC: tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
+ Retrie.GHC: tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
+ Retrie.GHC: tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
+ Retrie.GHC: tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
+ Retrie.GHC: tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
+ Retrie.GHC: tyFamInstDeclLName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> Located (IdP (GhcPass p))
+ Retrie.GHC: tyFamInstDeclName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> IdP (GhcPass p)
+ Retrie.GHC: type BangType pass = HsType pass
+ Retrie.GHC: type CmdLStmt id = LStmt id LHsCmd id
+ Retrie.GHC: type CmdStmt id = Stmt id LHsCmd id
+ Retrie.GHC: type CmdSyntaxTable p = [(Name, HsExpr p)]
+ Retrie.GHC: 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)
+ Retrie.GHC: type ExprLStmt id = LStmt id LHsExpr id
+ Retrie.GHC: type ExprStmt id = Stmt id LHsExpr id
+ Retrie.GHC: type FamInstEqn pass rhs = HsImplicitBndrs pass FamEqn pass rhs
+ Retrie.GHC: type ForallXABExport (c :: Type -> Constraint) x = (c XABE x, c XXABExport x)
+ Retrie.GHC: type ForallXAmbiguousFieldOcc (c :: Type -> Constraint) x = (c XUnambiguous x, c XAmbiguous x, c XXAmbiguousFieldOcc x)
+ Retrie.GHC: type ForallXAnnDecl (c :: Type -> Constraint) x = (c XHsAnnotation x, c XXAnnDecl x)
+ Retrie.GHC: type ForallXApplicativeArg (c :: Type -> Constraint) x = (c XApplicativeArgOne x, c XApplicativeArgMany x, c XXApplicativeArg x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXClsInstDecl (c :: Type -> Constraint) x = (c XCClsInstDecl x, c XXClsInstDecl x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXCmdTop (c :: Type -> Constraint) x = (c XCmdTop x, c XXCmdTop x)
+ Retrie.GHC: type ForallXConDecl (c :: Type -> Constraint) x = (c XConDeclGADT x, c XConDeclH98 x, c XXConDecl x)
+ Retrie.GHC: type ForallXConDeclField (c :: Type -> Constraint) x = (c XConDeclField x, c XXConDeclField x)
+ Retrie.GHC: type ForallXDefaultDecl (c :: Type -> Constraint) x = (c XCDefaultDecl x, c XXDefaultDecl x)
+ Retrie.GHC: type ForallXDerivDecl (c :: Type -> Constraint) x = (c XCDerivDecl x, c XXDerivDecl x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXFamEqn (c :: Type -> Constraint) x r = (c XCFamEqn x r, c XXFamEqn x r)
+ Retrie.GHC: type ForallXFamilyDecl (c :: Type -> Constraint) x = (c XCFamilyDecl x, c XXFamilyDecl x)
+ Retrie.GHC: type ForallXFamilyResultSig (c :: Type -> Constraint) x = (c XNoSig x, c XCKindSig x, c XTyVarSig x, c XXFamilyResultSig x)
+ Retrie.GHC: type ForallXFieldOcc (c :: Type -> Constraint) x = (c XCFieldOcc x, c XXFieldOcc x)
+ Retrie.GHC: type ForallXFixitySig (c :: Type -> Constraint) x = (c XFixitySig x, c XXFixitySig x)
+ Retrie.GHC: type ForallXForeignDecl (c :: Type -> Constraint) x = (c XForeignImport x, c XForeignExport x, c XXForeignDecl x)
+ Retrie.GHC: type ForallXGRHS (c :: Type -> Constraint) x b = (c XCGRHS x b, c XXGRHS x b)
+ Retrie.GHC: type ForallXGRHSs (c :: Type -> Constraint) x b = (c XCGRHSs x b, c XXGRHSs x b)
+ Retrie.GHC: 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')
+ Retrie.GHC: type ForallXHsDataDefn (c :: Type -> Constraint) x = (c XCHsDataDefn x, c XXHsDataDefn x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXHsDerivingClause (c :: Type -> Constraint) x = (c XCHsDerivingClause x, c XXHsDerivingClause x)
+ Retrie.GHC: type ForallXHsGroup (c :: Type -> Constraint) x = (c XCHsGroup x, c XXHsGroup x)
+ Retrie.GHC: type ForallXHsIPBinds (c :: Type -> Constraint) x = (c XIPBinds x, c XXHsIPBinds x)
+ Retrie.GHC: type ForallXHsImplicitBndrs (c :: Type -> Constraint) x b = (c XHsIB x b, c XXHsImplicitBndrs x b)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXHsLocalBindsLR (c :: Type -> Constraint) x x' = (c XHsValBinds x x', c XHsIPBinds x x', c XEmptyLocalBinds x x', c XXHsLocalBindsLR x x')
+ Retrie.GHC: type ForallXHsWildCardBndrs (c :: Type -> Constraint) x b = (c XHsWC x b, c XXHsWildCardBndrs x b)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXIPBind (c :: Type -> Constraint) x = (c XCIPBind x, c XXIPBind x)
+ Retrie.GHC: type ForallXImportDecl (c :: Type -> Constraint) x = (c XCImportDecl x, c XXImportDecl x)
+ Retrie.GHC: type ForallXInstDecl (c :: Type -> Constraint) x = (c XClsInstD x, c XDataFamInstD x, c XTyFamInstD x, c XXInstDecl x)
+ Retrie.GHC: type ForallXLHsQTyVars (c :: Type -> Constraint) x = (c XHsQTvs x, c XXLHsQTyVars x)
+ Retrie.GHC: type ForallXMatch (c :: Type -> Constraint) x b = (c XCMatch x b, c XXMatch x b)
+ Retrie.GHC: type ForallXMatchGroup (c :: Type -> Constraint) x b = (c XMG x b, c XXMatchGroup x b)
+ Retrie.GHC: type ForallXOverLit (c :: Type -> Constraint) x = (c XOverLit x, c XXOverLit x)
+ Retrie.GHC: type ForallXParStmtBlock (c :: Type -> Constraint) x x' = (c XParStmtBlock x x', c XXParStmtBlock x x')
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXPatSynBind (c :: Type -> Constraint) x x' = (c XPSB x x', c XXPatSynBind x x')
+ Retrie.GHC: type ForallXRoleAnnotDecl (c :: Type -> Constraint) x = (c XCRoleAnnotDecl x, c XXRoleAnnotDecl x)
+ Retrie.GHC: type ForallXRuleBndr (c :: Type -> Constraint) x = (c XCRuleBndr x, c XRuleBndrSig x, c XXRuleBndr x)
+ Retrie.GHC: type ForallXRuleDecl (c :: Type -> Constraint) x = (c XHsRule x, c XXRuleDecl x)
+ Retrie.GHC: type ForallXRuleDecls (c :: Type -> Constraint) x = (c XCRuleDecls x, c XXRuleDecls x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXSplice (c :: Type -> Constraint) x = (c XTypedSplice x, c XUntypedSplice x, c XQuasiQuote x, c XSpliced x, c XXSplice x)
+ Retrie.GHC: type ForallXSpliceDecl (c :: Type -> Constraint) x = (c XSpliceDecl x, c XXSpliceDecl x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXTupArg (c :: Type -> Constraint) x = (c XPresent x, c XMissing x, c XXTupArg x)
+ Retrie.GHC: type ForallXTyClDecl (c :: Type -> Constraint) x = (c XFamDecl x, c XSynDecl x, c XDataDecl x, c XClassDecl x, c XXTyClDecl x)
+ Retrie.GHC: type ForallXTyClGroup (c :: Type -> Constraint) x = (c XCTyClGroup x, c XXTyClGroup x)
+ Retrie.GHC: type ForallXTyVarBndr (c :: Type -> Constraint) x = (c XUserTyVar x, c XKindedTyVar x, c XXTyVarBndr x)
+ Retrie.GHC: 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)
+ Retrie.GHC: type ForallXValBindsLR (c :: Type -> Constraint) x x' = (c XValBinds x x', c XXValBindsLR x x')
+ Retrie.GHC: type ForallXWarnDecl (c :: Type -> Constraint) x = (c XWarning x, c XXWarnDecl x)
+ Retrie.GHC: type ForallXWarnDecls (c :: Type -> Constraint) x = (c XWarnings x, c XXWarnDecls x)
+ Retrie.GHC: type GhcPs = GhcPass 'Parsed
+ Retrie.GHC: type GhcRn = GhcPass 'Renamed
+ Retrie.GHC: type GhcTc = GhcPass 'Typechecked
+ Retrie.GHC: type GhcTcId = GhcTc
+ Retrie.GHC: type GhciLStmt id = LStmt id LHsExpr id
+ Retrie.GHC: type GhciStmt id = Stmt id LHsExpr id
+ Retrie.GHC: type GuardLStmt id = LStmt id LHsExpr id
+ Retrie.GHC: type GuardStmt id = Stmt id LHsExpr id
+ Retrie.GHC: type HsBind id = HsBindLR id id
+ Retrie.GHC: type HsConDeclDetails pass = HsConDetails LBangType pass Located [LConDeclField pass]
+ Retrie.GHC: type HsConPatDetails p = HsConDetails LPat p HsRecFields p LPat p
+ Retrie.GHC: type HsContext pass = [LHsType pass]
+ Retrie.GHC: type HsDeriving pass = Located [LHsDerivingClause pass]
+ Retrie.GHC: type HsKind pass = HsType pass
+ Retrie.GHC: type HsLocalBinds id = HsLocalBindsLR id id
+ Retrie.GHC: type HsModule = HsModule GhcPs
+ Retrie.GHC: type HsPatSynDetails arg = HsConDetails arg [RecordPatSynField arg]
+ Retrie.GHC: type HsRecField p arg = HsRecField' FieldOcc p arg
+ Retrie.GHC: type HsRecUpdField p = HsRecField' AmbiguousFieldOcc p LHsExpr p
+ Retrie.GHC: type HsRecordBinds p = HsRecFields p LHsExpr p
+ Retrie.GHC: type HsTyPats pass = [LHsTypeArg pass]
+ Retrie.GHC: type HsValBinds id = HsValBindsLR id id
+ Retrie.GHC: type InPat p = LPat p
+ Retrie.GHC: type LAnnDecl pass = Located AnnDecl pass
+ Retrie.GHC: type LBangType pass = Located BangType pass
+ Retrie.GHC: type LClsInstDecl pass = Located ClsInstDecl pass
+ Retrie.GHC: type LConDecl pass = Located ConDecl pass
+ Retrie.GHC: type LConDeclField pass = Located ConDeclField pass
+ Retrie.GHC: type LDataFamInstDecl pass = Located DataFamInstDecl pass
+ Retrie.GHC: type LDefaultDecl pass = Located DefaultDecl pass
+ Retrie.GHC: type LDerivDecl pass = Located DerivDecl pass
+ Retrie.GHC: type LDerivStrategy pass = Located DerivStrategy pass
+ Retrie.GHC: type LDocDecl = Located DocDecl
+ Retrie.GHC: type LFamInstEqn pass rhs = Located FamInstEqn pass rhs
+ Retrie.GHC: type LFamilyDecl pass = Located FamilyDecl pass
+ Retrie.GHC: type LFamilyResultSig pass = Located FamilyResultSig pass
+ Retrie.GHC: type LFieldOcc pass = Located FieldOcc pass
+ Retrie.GHC: type LFixitySig pass = Located FixitySig pass
+ Retrie.GHC: type LForeignDecl pass = Located ForeignDecl pass
+ Retrie.GHC: type LGRHS id body = Located GRHS id body
+ Retrie.GHC: type LHsBind id = LHsBindLR id id
+ Retrie.GHC: type LHsBindLR idL idR = Located HsBindLR idL idR
+ Retrie.GHC: type LHsBinds id = LHsBindsLR id id
+ Retrie.GHC: type LHsBindsLR idL idR = Bag LHsBindLR idL idR
+ Retrie.GHC: type LHsCmd id = Located HsCmd id
+ Retrie.GHC: type LHsCmdTop p = Located HsCmdTop p
+ Retrie.GHC: type LHsContext pass = Located HsContext pass
+ Retrie.GHC: type LHsDecl p = Located HsDecl p
+ Retrie.GHC: type LHsDerivingClause pass = Located HsDerivingClause pass
+ Retrie.GHC: type LHsDocString = Located HsDocString
+ Retrie.GHC: type LHsExpr p = Located HsExpr p
+ Retrie.GHC: type LHsFunDep pass = Located FunDep Located IdP pass
+ Retrie.GHC: type LHsKind pass = Located HsKind pass
+ Retrie.GHC: type LHsLocalBinds id = Located HsLocalBinds id
+ Retrie.GHC: type LHsLocalBindsLR idL idR = Located HsLocalBindsLR idL idR
+ Retrie.GHC: type LHsRecField p arg = Located HsRecField p arg
+ Retrie.GHC: type LHsRecField' p arg = Located HsRecField' p arg
+ Retrie.GHC: type LHsRecUpdField p = Located HsRecUpdField p
+ Retrie.GHC: type LHsSigType pass = HsImplicitBndrs pass LHsType pass
+ Retrie.GHC: type LHsSigWcType pass = HsWildCardBndrs pass LHsSigType pass
+ Retrie.GHC: type LHsTupArg id = Located HsTupArg id
+ Retrie.GHC: type LHsTyVarBndr pass = Located HsTyVarBndr pass
+ Retrie.GHC: type LHsType pass = Located HsType pass
+ Retrie.GHC: type LHsTypeArg p = HsArg LHsType p LHsKind p
+ Retrie.GHC: type LHsWcType pass = HsWildCardBndrs pass LHsType pass
+ Retrie.GHC: type LIE pass = Located IE pass
+ Retrie.GHC: type LIEWrappedName name = Located IEWrappedName name
+ Retrie.GHC: type LIPBind id = Located IPBind id
+ Retrie.GHC: type LIdP p = Located IdP p
+ Retrie.GHC: type LImportDecl pass = Located ImportDecl pass
+ Retrie.GHC: type LInjectivityAnn pass = Located InjectivityAnn pass
+ Retrie.GHC: type LInstDecl pass = Located InstDecl pass
+ Retrie.GHC: type LMatch id body = Located Match id body
+ Retrie.GHC: type LPat p = XRec p Pat
+ Retrie.GHC: type LRoleAnnotDecl pass = Located RoleAnnotDecl pass
+ Retrie.GHC: type LRuleBndr pass = Located RuleBndr pass
+ Retrie.GHC: type LRuleDecl pass = Located RuleDecl pass
+ Retrie.GHC: type LRuleDecls pass = Located RuleDecls pass
+ Retrie.GHC: type LSig pass = Located Sig pass
+ Retrie.GHC: type LSpliceDecl pass = Located SpliceDecl pass
+ Retrie.GHC: type LStandaloneKindSig pass = Located StandaloneKindSig pass
+ Retrie.GHC: type LStmt id body = Located StmtLR id id body
+ Retrie.GHC: type LStmtLR idL idR body = Located StmtLR idL idR body
+ Retrie.GHC: type LTcSpecPrag = Located TcSpecPrag
+ Retrie.GHC: type LTyClDecl pass = Located TyClDecl pass
+ Retrie.GHC: type LTyFamDefltDecl pass = Located TyFamDefltDecl pass
+ Retrie.GHC: type LTyFamInstDecl pass = Located TyFamInstDecl pass
+ Retrie.GHC: type LTyFamInstEqn pass = Located TyFamInstEqn pass
+ Retrie.GHC: type LWarnDecl pass = Located WarnDecl pass
+ Retrie.GHC: type LWarnDecls pass = Located WarnDecls pass
+ Retrie.GHC: type OutPat p = LPat p
+ Retrie.GHC: 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)
+ Retrie.GHC: type OutputableX p = (Outputable XIPBinds p, Outputable XViaStrategy p, Outputable XViaStrategy GhcRn)
+ Retrie.GHC: type PostTcExpr = HsExpr GhcTc
+ Retrie.GHC: type PostTcTable = [(Name, PostTcExpr)]
+ Retrie.GHC: type SplicePointName = Name
+ Retrie.GHC: type Stmt id body = StmtLR id id body
+ Retrie.GHC: type TyFamDefltDecl = TyFamInstDecl
+ Retrie.GHC: type TyFamInstEqn pass = FamInstEqn pass LHsType pass
+ Retrie.GHC: type family NameOrRdrName id
+ Retrie.GHC: typeToLHsType :: Type -> LHsType GhcPs
+ Retrie.GHC: unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
+ Retrie.GHC: unboundVarOcc :: UnboundVar -> OccName
+ Retrie.GHC: unguardedGRHSs :: forall body (p :: Pass). Located (body (GhcPass p)) -> GRHSs (GhcPass p) (Located (body (GhcPass p)))
+ Retrie.GHC: unguardedRHS :: forall body (p :: Pass). SrcSpan -> Located (body (GhcPass p)) -> [LGRHS (GhcPass p) (Located (body (GhcPass p)))]
+ Retrie.GHC: unitRecStmtTc :: RecStmtTc
+ Retrie.GHC: unpackHDS :: HsDocString -> String
+ Retrie.GHC: unqualQuasiQuote :: RdrName
+ Retrie.PatternMap.Instances: ForallVisMap :: BoolMap a -> ForallVisMap a
+ Retrie.PatternMap.Instances: [favBoolMap] :: ForallVisMap a -> BoolMap a
+ Retrie.PatternMap.Instances: extractBinderInfo :: LHsTyVarBndr GhcPs -> (RdrName, Maybe (LHsKind GhcPs))
+ Retrie.PatternMap.Instances: instance GHC.Base.Functor Retrie.PatternMap.Instances.ForallVisMap
+ Retrie.PatternMap.Instances: instance Retrie.PatternMap.Class.PatternMap Retrie.PatternMap.Instances.ForallVisMap
+ Retrie.PatternMap.Instances: instance Retrie.PatternMap.Instances.RecordFieldToRdrName (GHC.Hs.Types.AmbiguousFieldOcc GHC.Hs.Extension.GhcPs)
+ Retrie.PatternMap.Instances: instance Retrie.PatternMap.Instances.RecordFieldToRdrName (GHC.Hs.Types.FieldOcc p)
+ Retrie.PatternMap.Instances: newtype ForallVisMap a
+ Retrie.Rewrites: AdhocPattern :: String -> RewriteSpec
+ Retrie.Rewrites: AdhocType :: String -> RewriteSpec
+ Retrie.Rewrites: PatternBackward :: QualifiedName -> RewriteSpec
+ Retrie.Rewrites: PatternForward :: QualifiedName -> RewriteSpec
+ Retrie.Rewrites: instance GHC.Base.Monoid Retrie.Rewrites.ClassifiedRewrites
+ Retrie.Rewrites: instance GHC.Base.Semigroup Retrie.Rewrites.ClassifiedRewrites
+ Retrie.Rewrites.Function: getImports :: Direction -> Maybe (Located ModuleName) -> TransformT IO AnnotatedImports
+ Retrie.Rewrites.Function: matchToRewrites :: LHsExpr GhcPs -> AnnotatedImports -> Direction -> LMatch GhcPs (LHsExpr GhcPs) -> TransformT IO [Rewrite (LHsExpr GhcPs)]
+ Retrie.Rewrites.Patterns: patternSynonymsToRewrites :: [(FastString, Direction)] -> AnnotatedModule -> IO (UniqFM [Rewrite Universe])
+ Retrie.SYB: data (a :: k1) :~~: (b :: k2)
+ Retrie.SYB: data Proxy (t :: k)
+ Retrie.Types: IsLhs :: ParentPrec
+ Retrie.Universe: [umPat] :: UMap a -> PatMap a
+ Retrie.Universe: instance Retrie.Universe.Matchable (GHC.Hs.Expr.LHsExpr GHC.Hs.Extension.GhcPs)
+ Retrie.Universe: instance Retrie.Universe.Matchable (GHC.Hs.Expr.LStmt GHC.Hs.Extension.GhcPs (GHC.Hs.Expr.LHsExpr GHC.Hs.Extension.GhcPs))
+ Retrie.Universe: instance Retrie.Universe.Matchable (GHC.Hs.Types.LHsType GHC.Hs.Extension.GhcPs)
+ Retrie.Universe: instance Retrie.Universe.Matchable (SrcLoc.Located (GHC.Hs.Pat.Pat GHC.Hs.Extension.GhcPs))
+ Retrie.Util: missingSyntax :: String -> a
+ Retrie.Util: putErrStrLn :: String -> IO ()
- Retrie: type AnnotatedModule = Annotated (Located (HsModule GhcPs))
+ Retrie: type AnnotatedModule = Annotated (Located HsModule)
- Retrie.ExactPrint: AnnKey :: SrcSpan -> AnnConName -> AnnKey
+ Retrie.ExactPrint: AnnKey :: AnnSpan -> AnnConName -> AnnKey
- Retrie.ExactPrint: TransformT :: RWST () [String] (Anns, Int) m a -> TransformT a
+ Retrie.ExactPrint: TransformT :: RWST () [String] (Anns, Int) m a -> TransformT (m :: Type -> Type) a
- Retrie.ExactPrint: [unTransformT] :: TransformT a -> RWST () [String] (Anns, Int) m a
+ Retrie.ExactPrint: [unTransformT] :: TransformT (m :: Type -> Type) a -> RWST () [String] (Anns, Int) m a
- Retrie.ExactPrint: addAllAnnsT :: (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
+ Retrie.ExactPrint: addAllAnnsT :: (HasCallStack, Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
- Retrie.ExactPrint: addSimpleAnnT :: (Constraints a, Monad m) => Located a -> DeltaPos -> [(KeywordId, DeltaPos)] -> TransformT m ()
+ Retrie.ExactPrint: addSimpleAnnT :: forall a (m :: Type -> Type). (Constraints a, Monad m) => a -> DeltaPos -> [(KeywordId, DeltaPos)] -> TransformT m ()
- Retrie.ExactPrint: addTrailingCommaT :: (Data a, Monad m) => Located a -> TransformT m ()
+ Retrie.ExactPrint: addTrailingCommaT :: forall a (m :: Type -> Type). (Data a, Monad m) => Located a -> TransformT m ()
- Retrie.ExactPrint: balanceComments :: (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
+ Retrie.ExactPrint: balanceComments :: forall a b (m :: Type -> Type). (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
- Retrie.ExactPrint: balanceTrailingComments :: (Monad m, Data a, Data b) => Located a -> Located b -> TransformT m [(Comment, DeltaPos)]
+ Retrie.ExactPrint: balanceTrailingComments :: forall (m :: Type -> Type) a b. (Monad m, Data a, Data b) => Located a -> Located b -> TransformT m [(Comment, DeltaPos)]
- Retrie.ExactPrint: captureOrderAnnKey :: () => AnnKey -> [Located b] -> Anns -> Anns
+ Retrie.ExactPrint: captureOrderAnnKey :: AnnKey -> [Located b] -> Anns -> Anns
- Retrie.ExactPrint: decl2Bind :: () => LHsDecl name -> [LHsBind name]
+ Retrie.ExactPrint: decl2Bind :: LHsDecl name -> [LHsBind name]
- Retrie.ExactPrint: decl2Sig :: () => LHsDecl name -> [LSig name]
+ Retrie.ExactPrint: decl2Sig :: LHsDecl name -> [LSig name]
- Retrie.ExactPrint: getAnnsT :: Monad m => TransformT m Anns
+ Retrie.ExactPrint: getAnnsT :: forall (m :: Type -> Type). Monad m => TransformT m Anns
- Retrie.ExactPrint: getEntryDP :: Data a => Anns -> Located a -> DeltaPos
+ Retrie.ExactPrint: getEntryDP :: Constraints a => Anns -> a -> DeltaPos
- Retrie.ExactPrint: getEntryDPT :: (Data a, Monad m) => Located a -> TransformT m DeltaPos
+ Retrie.ExactPrint: getEntryDPT :: forall a (m :: Type -> Type). (Constraints a, Monad m) => a -> TransformT m DeltaPos
- Retrie.ExactPrint: graftT :: (Data a, Monad m) => Anns -> a -> TransformT m a
+ Retrie.ExactPrint: graftT :: forall a (m :: Type -> Type). (Data a, Monad m) => Anns -> a -> TransformT m a
- Retrie.ExactPrint: hoistTransform :: () => (forall x. () => m x -> n x) -> TransformT m a -> TransformT n a
+ Retrie.ExactPrint: hoistTransform :: (forall x. () => m x -> n x) -> TransformT m a -> TransformT n a
- Retrie.ExactPrint: hsDecls :: (HasDecls t, Monad m) => t -> TransformT m [LHsDecl GhcPs]
+ Retrie.ExactPrint: hsDecls :: forall (m :: Type -> Type). (HasDecls t, Monad m) => t -> TransformT m [LHsDecl GhcPs]
- Retrie.ExactPrint: hsDeclsGeneric :: (Data t, Monad m) => t -> TransformT m [LHsDecl GhcPs]
+ Retrie.ExactPrint: hsDeclsGeneric :: forall t (m :: Type -> Type). (Data t, Monad m) => t -> TransformT m [LHsDecl GhcPs]
- Retrie.ExactPrint: hsDeclsPatBind :: Monad m => LHsBind GhcPs -> TransformT m [LHsDecl GhcPs]
+ Retrie.ExactPrint: hsDeclsPatBind :: forall (m :: Type -> Type). Monad m => LHsBind GhcPs -> TransformT m [LHsDecl GhcPs]
- Retrie.ExactPrint: hsDeclsPatBindD :: Monad m => LHsDecl GhcPs -> TransformT m [LHsDecl GhcPs]
+ Retrie.ExactPrint: hsDeclsPatBindD :: forall (m :: Type -> Type). Monad m => LHsDecl GhcPs -> TransformT m [LHsDecl GhcPs]
- Retrie.ExactPrint: hsDeclsValBinds :: Monad m => HsLocalBinds GhcPs -> TransformT m [LHsDecl GhcPs]
+ Retrie.ExactPrint: hsDeclsValBinds :: forall (m :: Type -> Type). Monad m => HsLocalBinds GhcPs -> TransformT m [LHsDecl GhcPs]
- Retrie.ExactPrint: logDataWithAnnsTr :: (Monad m, Data a) => String -> a -> TransformT m ()
+ Retrie.ExactPrint: logDataWithAnnsTr :: forall (m :: Type -> Type) a. (Monad m, Data a) => String -> a -> TransformT m ()
- Retrie.ExactPrint: logTr :: Monad m => String -> TransformT m ()
+ Retrie.ExactPrint: logTr :: forall (m :: Type -> Type). Monad m => String -> TransformT m ()
- Retrie.ExactPrint: mkAnnKey :: Data a => Located a -> AnnKey
+ Retrie.ExactPrint: mkAnnKey :: Constraints a => a -> AnnKey
- Retrie.ExactPrint: modifyAnnsT :: Monad m => (Anns -> Anns) -> TransformT m ()
+ Retrie.ExactPrint: modifyAnnsT :: forall (m :: Type -> Type). Monad m => (Anns -> Anns) -> TransformT m ()
- Retrie.ExactPrint: putAnnsT :: Monad m => Anns -> TransformT m ()
+ Retrie.ExactPrint: putAnnsT :: forall (m :: Type -> Type). Monad m => Anns -> TransformT m ()
- Retrie.ExactPrint: relativiseApiAnns :: Annotate ast => Located ast -> ApiAnns -> Anns
+ Retrie.ExactPrint: relativiseApiAnns :: (Data (SrcSpanLess ast), Annotate ast, HasSrcSpan ast) => ast -> ApiAnns -> Anns
- Retrie.ExactPrint: relativiseApiAnnsWithComments :: Annotate ast => [Comment] -> Located ast -> ApiAnns -> Anns
+ Retrie.ExactPrint: relativiseApiAnnsWithComments :: (Data (SrcSpanLess ast), Annotate ast, HasSrcSpan ast) => [Comment] -> ast -> ApiAnns -> Anns
- Retrie.ExactPrint: removeTrailingCommaT :: (Data a, Monad m) => Located a -> TransformT m ()
+ Retrie.ExactPrint: removeTrailingCommaT :: forall a (m :: Type -> Type). (Data a, Monad m) => Located a -> TransformT m ()
- Retrie.ExactPrint: replaceDecls :: (HasDecls t, Monad m) => t -> [LHsDecl GhcPs] -> TransformT m t
+ Retrie.ExactPrint: replaceDecls :: forall (m :: Type -> Type). (HasDecls t, Monad m) => t -> [LHsDecl GhcPs] -> TransformT m t
- Retrie.ExactPrint: replaceDeclsPatBind :: Monad m => LHsBind GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsBind GhcPs)
+ Retrie.ExactPrint: replaceDeclsPatBind :: forall (m :: Type -> Type). Monad m => LHsBind GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsBind GhcPs)
- Retrie.ExactPrint: replaceDeclsPatBindD :: Monad m => LHsDecl GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsDecl GhcPs)
+ Retrie.ExactPrint: replaceDeclsPatBindD :: forall (m :: Type -> Type). Monad m => LHsDecl GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsDecl GhcPs)
- Retrie.ExactPrint: replaceDeclsValbinds :: Monad m => HsLocalBinds GhcPs -> [LHsDecl GhcPs] -> TransformT m (HsLocalBinds GhcPs)
+ Retrie.ExactPrint: replaceDeclsValbinds :: forall (m :: Type -> Type). Monad m => HsLocalBinds GhcPs -> [LHsDecl GhcPs] -> TransformT m (HsLocalBinds GhcPs)
- Retrie.ExactPrint: runTransform :: () => Anns -> Transform a -> (a, (Anns, Int), [String])
+ Retrie.ExactPrint: runTransform :: Anns -> Transform a -> (a, (Anns, Int), [String])
- Retrie.ExactPrint: runTransformFrom :: () => Int -> Anns -> Transform a -> (a, (Anns, Int), [String])
+ Retrie.ExactPrint: runTransformFrom :: Int -> Anns -> Transform a -> (a, (Anns, Int), [String])
- Retrie.ExactPrint: runTransformFromT :: () => Int -> Anns -> TransformT m a -> m (a, (Anns, Int), [String])
+ Retrie.ExactPrint: runTransformFromT :: Int -> Anns -> TransformT m a -> m (a, (Anns, Int), [String])
- Retrie.ExactPrint: runTransformT :: () => Anns -> TransformT m a -> m (a, (Anns, Int), [String])
+ Retrie.ExactPrint: runTransformT :: Anns -> TransformT m a -> m (a, (Anns, Int), [String])
- Retrie.ExactPrint: setPrecedingLinesDeclT :: Monad m => LHsDecl GhcPs -> Int -> Int -> TransformT m ()
+ Retrie.ExactPrint: setPrecedingLinesDeclT :: forall (m :: Type -> Type). Monad m => LHsDecl GhcPs -> Int -> Int -> TransformT m ()
- Retrie.ExactPrint: setPrecedingLinesT :: (Data a, Monad m) => Located a -> Int -> Int -> TransformT m ()
+ Retrie.ExactPrint: setPrecedingLinesT :: forall a (m :: Type -> Type). (Data a, Monad m) => Located a -> Int -> Int -> TransformT m ()
- Retrie.ExactPrint: transferEntryAnnsT :: (Data a, Data b, Monad m) => (KeywordId -> Bool) -> Located a -> Located b -> TransformT m ()
+ Retrie.ExactPrint: transferEntryAnnsT :: (HasCallStack, Data a, Data b, Monad m) => (KeywordId -> Bool) -> Located a -> Located b -> TransformT m ()
- Retrie.ExactPrint: transferEntryDPT :: (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
+ Retrie.ExactPrint: transferEntryDPT :: (HasCallStack, Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()
- Retrie.ExactPrint: uniqueSrcSpanT :: Monad m => TransformT m SrcSpan
+ Retrie.ExactPrint: uniqueSrcSpanT :: forall (m :: Type -> Type). Monad m => TransformT m SrcSpan
- Retrie.ExactPrint.Annotated: type AnnotatedModule = Annotated (Located (HsModule GhcPs))
+ Retrie.ExactPrint.Annotated: type AnnotatedModule = Annotated (Located HsModule)
- Retrie.GHC: fixityDecls :: HsModule p -> [(Located (IdP p), Fixity)]
+ Retrie.GHC: fixityDecls :: HsModule -> [(Located RdrName, Fixity)]
- Retrie.GHC: noExtField :: NoExt
+ Retrie.GHC: noExtField :: NoExtField
- Retrie.PatternMap.Class: type family Key m :: *;
+ Retrie.PatternMap.Class: type family Key m :: Type;
- Retrie.PatternMap.Instances: TM :: Map RdrName a -> VMap a -> TyMap (TyMap a) -> ForAllTyMap a -> TyMap (TyMap a) -> TyMap a -> TyMap a -> TyMap (ListMap TyMap a) -> ListMap TyMap a -> TupleSortMap (ListMap TyMap a) -> TyMap a
+ Retrie.PatternMap.Instances: TM :: Map RdrName a -> VMap a -> TyMap (TyMap a) -> ForallVisMap (ForAllTyMap a) -> TyMap (TyMap a) -> TyMap a -> TyMap a -> TyMap (ListMap TyMap a) -> ListMap TyMap a -> TupleSortMap (ListMap TyMap a) -> TyMap a
- Retrie.PatternMap.Instances: [tyHsForAllTy] :: TyMap a -> ForAllTyMap a
+ Retrie.PatternMap.Instances: [tyHsForAllTy] :: TyMap a -> ForallVisMap (ForAllTyMap a)
- Retrie.SYB: GM :: (forall a. Data a => a -> m a) -> GenericM'
+ Retrie.SYB: GM :: (forall a. Data a => a -> m a) -> GenericM' (m :: Type -> Type)
- Retrie.SYB: Generic' :: Generic c -> Generic'
+ Retrie.SYB: Generic' :: Generic c -> Generic' (c :: Type -> Type)
- Retrie.SYB: Proxy :: Proxy
+ Retrie.SYB: Proxy :: Proxy (t :: k)
- Retrie.SYB: [HRefl] :: forall k1 k2 (a :: k1) (b :: k2). () => a :~~: a
+ Retrie.SYB: [HRefl] :: forall k1 (a :: k1). a :~~: a
- Retrie.SYB: [Refl] :: forall k (a :: k) (b :: k). () => a :~: a
+ Retrie.SYB: [Refl] :: forall k (a :: k). a :~: a
- Retrie.SYB: [unGM] :: GenericM' -> forall a. Data a => a -> m a
+ Retrie.SYB: [unGM] :: GenericM' (m :: Type -> Type) -> forall a. Data a => a -> m a
- Retrie.SYB: [unGeneric'] :: Generic' -> Generic c
+ Retrie.SYB: [unGeneric'] :: Generic' (c :: Type -> Type) -> Generic c
- Retrie.SYB: choiceMp :: MonadPlus m => GenericM m -> GenericM m -> GenericM m
+ Retrie.SYB: choiceMp :: forall (m :: Type -> Type). MonadPlus m => GenericM m -> GenericM m -> GenericM m
- Retrie.SYB: choiceQ :: MonadPlus m => GenericQ (m r) -> GenericQ (m r) -> GenericQ (m r)
+ Retrie.SYB: choiceQ :: forall (m :: Type -> Type) r. MonadPlus m => GenericQ (m r) -> GenericQ (m r) -> GenericQ (m r)
- Retrie.SYB: eqT :: (Typeable a, Typeable b) => Maybe (a :~: b)
+ Retrie.SYB: eqT :: forall k (a :: k) (b :: k). (Typeable a, Typeable b) => Maybe (a :~: b)
- Retrie.SYB: everything :: () => (r -> r -> r) -> GenericQ r -> GenericQ r
+ Retrie.SYB: everything :: (r -> r -> r) -> GenericQ r -> GenericQ r
- Retrie.SYB: everythingBut :: () => (r -> r -> r) -> GenericQ (r, Bool) -> GenericQ r
+ Retrie.SYB: everythingBut :: (r -> r -> r) -> GenericQ (r, Bool) -> GenericQ r
- Retrie.SYB: everythingWithContext :: () => s -> (r -> r -> r) -> GenericQ (s -> (r, s)) -> GenericQ r
+ Retrie.SYB: everythingWithContext :: s -> (r -> r -> r) -> GenericQ (s -> (r, s)) -> GenericQ r
- Retrie.SYB: everywhereM :: Monad m => GenericM m -> GenericM m
+ Retrie.SYB: everywhereM :: forall (m :: Type -> Type). Monad m => GenericM m -> GenericM m
- Retrie.SYB: gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)
+ Retrie.SYB: gcast :: forall k (a :: k) (b :: k) c. (Typeable a, Typeable b) => c a -> Maybe (c b)
- Retrie.SYB: gcast1 :: (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a))
+ Retrie.SYB: gcast1 :: forall k1 k2 c (t :: k2 -> k1) (t' :: k2 -> k1) (a :: k2). (Typeable t, Typeable t') => c (t a) -> Maybe (c (t' a))
- Retrie.SYB: gcast2 :: (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b))
+ Retrie.SYB: gcast2 :: forall k1 k2 k3 c (t :: k2 -> k3 -> k1) (t' :: k2 -> k3 -> k1) (a :: k2) (b :: k3). (Typeable t, Typeable t') => c (t a b) -> Maybe (c (t' a b))
- Retrie.SYB: gmapAccumA :: (Data d, Applicative a) => (forall e. Data e => b -> e -> (b, a e)) -> b -> d -> (b, a d)
+ Retrie.SYB: gmapAccumA :: forall b d a. (Data d, Applicative a) => (forall e. Data e => b -> e -> (b, a e)) -> b -> d -> (b, a d)
- Retrie.SYB: gmapQr :: Data a => (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
+ Retrie.SYB: gmapQr :: forall r r'. Data a => (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
- Retrie.SYB: gzipWithM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
+ Retrie.SYB: gzipWithM :: forall (m :: Type -> Type). Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
- Retrie.SYB: gzipWithQ :: () => GenericQ (GenericQ r) -> GenericQ (GenericQ [r])
+ Retrie.SYB: gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r])
- Retrie.SYB: orElse :: () => Maybe a -> Maybe a -> Maybe a
+ Retrie.SYB: orElse :: Maybe a -> Maybe a -> Maybe a
- Retrie.SYB: recoverMp :: MonadPlus m => GenericM m -> GenericM m
+ Retrie.SYB: recoverMp :: forall (m :: Type -> Type). MonadPlus m => GenericM m -> GenericM m
- Retrie.SYB: recoverQ :: MonadPlus m => r -> GenericQ (m r) -> GenericQ (m r)
+ Retrie.SYB: recoverQ :: forall (m :: Type -> Type) r. MonadPlus m => r -> GenericQ (m r) -> GenericQ (m r)
- Retrie.SYB: something :: () => GenericQ (Maybe u) -> GenericQ (Maybe u)
+ Retrie.SYB: something :: GenericQ (Maybe u) -> GenericQ (Maybe u)
- Retrie.SYB: somewhere :: MonadPlus m => GenericM m -> GenericM m
+ Retrie.SYB: somewhere :: forall (m :: Type -> Type). MonadPlus m => GenericM m -> GenericM m
- Retrie.SYB: synthesize :: () => s -> (t -> s -> s) -> GenericQ (s -> t) -> GenericQ t
+ Retrie.SYB: synthesize :: s -> (t -> s -> s) -> GenericQ (s -> t) -> GenericQ t
- Retrie.SYB: typeRep :: Typeable a => proxy a -> TypeRep
+ Retrie.SYB: typeRep :: forall k proxy (a :: k). Typeable a => proxy a -> TypeRep
- Retrie.Universe: UMap :: EMap a -> SMap a -> TyMap a -> UMap a
+ Retrie.Universe: UMap :: EMap a -> SMap a -> TyMap a -> PatMap a -> UMap a
Files
- CHANGELOG.md +9/−1
- Retrie/CPP.hs +3/−3
- Retrie/Context.hs +11/−35
- Retrie/ExactPrint.hs +39/−44
- Retrie/ExactPrint/Annotated.hs +1/−1
- Retrie/Expr.hs +89/−135
- Retrie/GHC.hs +112/−45
- Retrie/Options.hs +20/−0
- Retrie/PatternMap/Bag.hs +5/−0
- Retrie/PatternMap/Class.hs +2/−8
- Retrie/PatternMap/Instances.hs +136/−351
- Retrie/Pretty.hs +5/−4
- Retrie/Replace.hs +10/−19
- Retrie/Rewrites.hs +82/−7
- Retrie/Rewrites/Function.hs +9/−27
- Retrie/Rewrites/Patterns.hs +134/−0
- Retrie/Rewrites/Rules.hs +5/−0
- Retrie/Rewrites/Types.hs +8/−4
- Retrie/Subst.hs +13/−22
- Retrie/Substitution.hs +5/−0
- Retrie/Types.hs +1/−0
- Retrie/Universe.hs +18/−6
- Retrie/Util.hs +18/−4
- demo/Main.hs +0/−5
- retrie.cabal +11/−10
- tests/Annotated.hs +15/−6
- tests/Demo.hs +0/−5
- tests/inputs/Adhoc.test +12/−0
- tests/inputs/PatternSyn1.test +55/−0
- tests/inputs/PatternSyn2.test +30/−0
CHANGELOG.md view
@@ -1,3 +1,11 @@+1.0.0.0 (April 9, 2021)++* Added --adhoc-type flag (#13)+* Added --adhoc-pattern, --pattern-forward, --pattern-backward (#15)+* Speed up file search when large number of files match.+* Removed support for GHC 8.4 and 8.8+* Added support for GHC 9.0.1+ 0.1.1.1 (June 1, 2020) * Remove dependency on haskell-src-exts from library (#9)@@ -15,7 +23,7 @@ * Don't fail if 'git' or 'hg' commands cannot be found. * Better error message when syntax support needs to be extended.-* Add support for following type syntax: lists, tuples, constraints, +* Add support for following type syntax: lists, tuples, constraints, unboxed sums, and forall. 0.1.0.0 (March 16, 2020)
Retrie/CPP.hs view
@@ -116,7 +116,7 @@ sorted = sortOn fst [ (r, replReplacement) | Replacement{..} <- repls- , RealSrcSpan r <- [replLocation]+ , Just r <- [getRealSpan replLocation] ] origLines = Text.lines orig@@ -319,8 +319,8 @@ insertImports :: Monad m => [AnnotatedImports] -- ^ imports and their annotations- -> Located (HsModule GhcPs) -- ^ target module- -> TransformT m (Located (HsModule GhcPs))+ -> Located HsModule -- ^ target module+ -> TransformT m (Located HsModule) insertImports is (L l m) = do imps <- graftA $ filterAndFlatten (unLoc <$> hsmodName m) is let
Retrie/Context.hs view
@@ -43,13 +43,11 @@ const (return c) `extQ` (return . updExp) `extQ` (return . updType)-#if __GLASGOW_HASKELL__ < 806- `extQ` (return . updTypeList)-#endif `extQ` (return . updMatch) `extQ` (return . updGRHSs) `extQ` (return . updGRHS) `extQ` (return . updStmt)+ `extQ` (return . updPat) `extQ` updStmtList `extQ` (return . updHsBind) `extQ` (return . updTyClDecl)@@ -62,47 +60,30 @@ -- Reason for 10 + i: (i is index of child, 0 = left, 1 = right) -- In left child, prec is 10, so HsApp child will NOT get paren'd -- In right child, prec is 11, so every child gets paren'd (unless atomic)-#if __GLASGOW_HASKELL__ < 806- updExp (OpApp _ op _ _) = c { ctxtParentPrec = HasPrec $ lookupOp op (ctxtFixityEnv c) }- updExp (HsLet lbs _) = addInScope neverParen $ collectLocalBinders $ unLoc lbs-#else updExp (OpApp _ _ op _) = c { ctxtParentPrec = HasPrec $ lookupOp op (ctxtFixityEnv c) } updExp (HsLet _ lbs _) = addInScope neverParen $ collectLocalBinders $ unLoc lbs-#endif updExp _ = neverParen updType :: HsType GhcPs -> Context-#if __GLASGOW_HASKELL__ < 806- updType (HsAppsTy _) = c { ctxtParentPrec = IsHsAppsTy }-#else updType HsAppTy{} | i > firstChild = c { ctxtParentPrec = IsHsAppsTy }-#endif updType _ = neverParen -#if __GLASGOW_HASKELL__ < 806- updTypeList :: [LHsAppType GhcPs] -> Context- updTypeList _ =- case ctxtParentPrec c of- IsHsAppsTy- | i > 0 -> c { ctxtParentPrec = HasPrec $ Fixity (SourceText "HsAppsTy") 11 InfixL }- | otherwise -> neverParen- _ -> c -- leave prec as is-#endif- updMatch :: Match GhcPs (LHsExpr GhcPs) -> Context- updMatch = addInScope neverParen . collectPatsBinders . m_pats+ updMatch+ | i == 2 -- m_pats field+ = addInScope c{ctxtParentPrec = IsLhs} . collectPatsBinders . m_pats+ | otherwise = addInScope neverParen . collectPatsBinders . m_pats+ where updGRHSs :: GRHSs GhcPs (LHsExpr GhcPs) -> Context updGRHSs = addInScope neverParen . collectLocalBinders . unLoc . grhssLocalBinds updGRHS :: GRHS GhcPs (LHsExpr GhcPs) -> Context-#if __GLASGOW_HASKELL__ < 806- updGRHS (GRHS gs _)-#else+#if __GLASGOW_HASKELL__ < 900 updGRHS XGRHS{} = neverParen- updGRHS (GRHS _ gs _) #endif+ updGRHS (GRHS _ gs _) -- binders are in scope over the body (right child) only | i > firstChild = addInScope neverParen bs | otherwise = fst $ updateSubstitution neverParen bs@@ -118,11 +99,7 @@ -- binders are in scope over tail of list (right child) | i > 0 = insertDependentRewrites neverParen bs ls -- lets are recursive in do-blocks-#if __GLASGOW_HASKELL__ < 806- | L _ (LetStmt (L _ bnds)) <- ls =-#else | L _ (LetStmt _ (L _ bnds)) <- ls =-#endif return $ addInScope neverParen $ collectLocalBinders bnds | otherwise = return $ fst $ updateSubstitution neverParen bs where@@ -140,6 +117,9 @@ updTyClDecl ClassDecl{..} = addInScope neverParen [unLoc tcdLName] updTyClDecl _ = neverParen + updPat :: Pat GhcPs -> Context+ updPat _ = neverParen+ -- | Create an empty 'Context' with given 'FixityEnv', rewriter, and dependent -- rewrite generator. emptyContext :: FixityEnv -> Rewriter -> Rewriter -> Context@@ -153,11 +133,7 @@ -- Deal with Trees-That-Grow adding extension points -- as the first child everywhere. firstChild :: Int-#if __GLASGOW_HASKELL__ < 806-firstChild = 0-#else firstChild = 1-#endif -- | Add dependent rewrites to 'ctxtRewriter' if necessary. insertDependentRewrites
Retrie/ExactPrint.hs view
@@ -29,6 +29,7 @@ , transferAnnsT , transferEntryAnnsT , transferEntryDPT+ , tryTransferEntryDPT -- * Utils , debugDump , debugParse@@ -74,8 +75,10 @@ import Retrie.ExactPrint.Annotated import Retrie.Fixity import Retrie.GHC-import Retrie.SYB+import Retrie.SYB hiding (ext1) +import GHC.Stack+ -- Fixity traversal ----------------------------------------------------------- -- | Re-associate AST using given 'FixityEnv'. (The GHC parser has no knowledge@@ -100,15 +103,6 @@ => FixityEnv -> LHsExpr GhcPs -> TransformT m (LHsExpr GhcPs)-#if __GLASGOW_HASKELL__ < 806-fixOneExpr env (L l2 (OpApp ap1@(L l1 (OpApp x op1 f1 y)) op2 f2 z))- | associatesRight (lookupOp op1 env) (lookupOp op2 env) = do- let ap2' = L l2 $ OpApp y op2 f2 z- swapEntryDPT ap1 ap2'- transferAnnsT isComma ap2' ap1- rhs <- fixOneExpr env ap2'- return $ L l1 $ OpApp x op1 f1 rhs-#else fixOneExpr env (L l2 (OpApp x2 ap1@(L l1 (OpApp x1 x op1 y)) op2 z)) | associatesRight (lookupOp op1 env) (lookupOp op2 env) = do let ap2' = L l2 $ OpApp x2 y op2 z@@ -116,26 +110,25 @@ transferAnnsT isComma ap2' ap1 rhs <- fixOneExpr env ap2' return $ L l1 $ OpApp x1 x op1 rhs-#endif fixOneExpr _ e = return e fixOnePat :: Monad m => FixityEnv -> LPat GhcPs -> TransformT m (LPat GhcPs)-#if __GLASGOW_HASKELL__ == 808-fixOnePat env (dL -> L l2 (ConPatIn op2 (InfixCon (dL -> ap1@(L l1 (ConPatIn op1 (InfixCon x y)))) z)))+#if __GLASGOW_HASKELL__ < 900+fixOnePat env (dLPat -> Just (L l2 (ConPatIn op2 (InfixCon (dLPat -> Just ap1@(L l1 (ConPatIn op1 (InfixCon x y)))) z)))) | associatesRight (lookupOpRdrName op1 env) (lookupOpRdrName op2 env) = do let ap2' = L l2 (ConPatIn op2 (InfixCon y z)) swapEntryDPT ap1 ap2' transferAnnsT isComma ap2' ap1- rhs <- fixOnePat env (composeSrcSpan ap2')- return $ cL l1 (ConPatIn op1 (InfixCon x rhs))+ rhs <- fixOnePat env (cLPat ap2')+ return $ cLPat $ L l1 (ConPatIn op1 (InfixCon x rhs)) #else-fixOnePat env (L l2 (ConPatIn op2 (InfixCon ap1@(L l1 (ConPatIn op1 (InfixCon x y))) z)))+fixOnePat env (dLPat -> Just (L l2 (ConPat ext2 op2 (InfixCon (dLPat -> Just ap1@(L l1 (ConPat ext1 op1 (InfixCon x y)))) z)))) | associatesRight (lookupOpRdrName op1 env) (lookupOpRdrName op2 env) = do- let ap2' = L l2 (ConPatIn op2 (InfixCon y z))+ let ap2' = L l2 (ConPat ext2 op2 (InfixCon y z)) swapEntryDPT ap1 ap2' transferAnnsT isComma ap2' ap1- rhs <- fixOnePat env ap2'- return $ L l1 (ConPatIn op1 (InfixCon x rhs))+ rhs <- fixOnePat env (cLPat ap2')+ return $ cLPat $ L l1 (ConPat ext1 op1 (InfixCon x rhs)) #endif fixOnePat _ e = return e @@ -164,21 +157,18 @@ return e fixOneEntryExpr :: Monad m => LHsExpr GhcPs -> TransformT m (LHsExpr GhcPs)-#if __GLASGOW_HASKELL__ < 806-fixOneEntryExpr e@(L _ (OpApp x _ _ _)) = fixOneEntry e x-#else fixOneEntryExpr e@(L _ (OpApp _ x _ _)) = fixOneEntry e x-#endif fixOneEntryExpr e = return e fixOneEntryPat :: Monad m => LPat GhcPs -> TransformT m (LPat GhcPs)-#if __GLASGOW_HASKELL__ == 808-fixOneEntryPat p@(ConPatIn _ (InfixCon x _)) =- composeSrcSpan <$> fixOneEntry (dL p) (dL x)+fixOneEntryPat pat+#if __GLASGOW_HASKELL__ < 900+ | Just p@(L _ (ConPatIn _ (InfixCon x _))) <- dLPat pat = #else-fixOneEntryPat p@(L _ (ConPatIn _ (InfixCon x _))) = fixOneEntry p x+ | Just p@(L _ (ConPat _ _ (InfixCon x _))) <- dLPat pat = #endif-fixOneEntryPat p = return p+ cLPat <$> fixOneEntry p (dLPatUnsafe x)+ | otherwise = return pat ------------------------------------------------------------------------------- @@ -240,11 +230,7 @@ parsePattern :: String -> IO AnnotatedPat parsePattern = parseHelper "parsePattern" p where-#if __GLASGOW_HASKELL__ < 808- p = Parsers.parsePattern-#else- p flags fp str = fmap dL <$> Parsers.parsePattern flags fp str-#endif+ p flags fp str = fmap dLPatUnsafe <$> Parsers.parsePattern flags fp str -- | Parse a 'Stmt'. parseStmt :: String -> IO AnnotatedStmt@@ -289,7 +275,7 @@ -- The following definitions are all the same as the ones from ghc-exactprint, -- but the types are liberalized from 'Transform a' to 'TransformT m a'. transferEntryAnnsT- :: (Data a, Data b, Monad m)+ :: (HasCallStack, Data a, Data b, Monad m) => (KeywordId -> Bool) -- transfer Anns matching predicate -> Located a -- from -> Located b -- to@@ -300,13 +286,20 @@ -- | 'Transform' monad version of 'transferEntryDP' transferEntryDPT+ :: (HasCallStack, Data a, Data b, Monad m)+ => Located a -> Located b -> TransformT m ()+transferEntryDPT a b = modifyAnnsT (transferEntryDP a b)++tryTransferEntryDPT :: (Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()-transferEntryDPT a b =- modifyAnnsT (transferEntryDP a b)+tryTransferEntryDPT a b = modifyAnnsT $ \anns ->+ if M.member (mkAnnKey a) anns+ then transferEntryDP a b anns+ else anns -- This function fails if b is not in Anns, which seems dumb, since we are inserting it.-transferEntryDP :: (Data a, Data b) => Located a -> Located b -> Anns -> Anns+transferEntryDP :: (HasCallStack, Data a, Data b) => Located a -> Located b -> Anns -> Anns transferEntryDP a b anns = setEntryDP b dp anns' where maybeAnns = do -- Maybe monad@@ -319,12 +312,11 @@ maybeAnns addAllAnnsT- :: (Data a, Data b, Monad m)+ :: (HasCallStack, Data a, Data b, Monad m) => Located a -> Located b -> TransformT m ()-addAllAnnsT a b =- modifyAnnsT (addAllAnns a b)+addAllAnnsT a b = modifyAnnsT (addAllAnns a b) -addAllAnns :: (Data a, Data b) => Located a -> Located b -> Anns -> Anns+addAllAnns :: (HasCallStack, Data a, Data b) => Located a -> Located b -> Anns -> Anns addAllAnns a b anns = fromMaybe (error $ "addAllAnns: lookup failed: " ++ show (mkAnnKey a)@@ -375,16 +367,19 @@ let anB' = anB { annsDP = annsDP anB ++ filter (p . fst) (annsDP anA) } return $ M.insert bKey anB' anns --- | 'Transform' monad version of 'getEntryDP'+-- | 'Transform' monad version of 'setEntryDP',+-- which sets the entry 'DeltaPos' for an annotation. setEntryDPT :: (Data a, Monad m) => Located a -> DeltaPos -> TransformT m () setEntryDPT ast dp = do modifyAnnsT (setEntryDP ast dp) --- | The setEntryDP that comes with exactprint does some really confusing--- entry math around comments that I'm not convinced is either correct or useful.+-- | Set the true entry 'DeltaPos' from the annotation of a+-- given AST element. setEntryDP :: Data a => Located a -> DeltaPos -> Anns -> Anns+-- The setEntryDP that comes with exactprint does some really confusing+-- entry math around comments that I'm unconvinced is either correct or useful. setEntryDP x dp anns = M.alter (Just . f . fromMaybe annNone) k anns where k = mkAnnKey x
Retrie/ExactPrint/Annotated.hs view
@@ -55,7 +55,7 @@ type AnnotatedHsType = Annotated (LHsType GhcPs) type AnnotatedImport = Annotated (LImportDecl GhcPs) type AnnotatedImports = Annotated [LImportDecl GhcPs]-type AnnotatedModule = Annotated (Located (HsModule GhcPs))+type AnnotatedModule = Annotated (Located HsModule) type AnnotatedPat = Annotated (Located (Pat GhcPs)) type AnnotatedStmt = Annotated (LStmt GhcPs (LHsExpr GhcPs))
Retrie/Expr.hs view
@@ -9,19 +9,25 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} module Retrie.Expr- ( grhsToExpr+ ( bitraverseHsConDetails+ , grhsToExpr , mkApps+ , mkConPatIn , mkHsAppsTy , mkLams , mkLet , mkLoc , mkLocatedHsVar+ , mkVarPat , mkTyVar , parenify , parenifyT+ , parenifyP , patToExpr , patToExprA+ , setAnnsFor , unparen+ , unparenP , unparenT , wildSupply ) where@@ -49,17 +55,9 @@ "[]" -> [(G AnnOpenS, DP (0,0)), (G AnnCloseS, DP (0,0))] _ -> [(G AnnVal, DP (0,0))] r <- setAnnsFor v anns-#if __GLASGOW_HASKELL__ < 806- lv@(L _ v') <- cloneT (noLoc (HsVar r))-#else lv@(L _ v') <- cloneT (noLoc (HsVar noExtField r))-#endif case v' of-#if __GLASGOW_HASKELL__ < 806- HsVar x ->-#else HsVar _ x ->-#endif swapEntryDPT x lv _ -> return () return lv@@ -89,64 +87,55 @@ mkLams vs e = do let mg =-#if __GLASGOW_HASKELL__ < 806- mkMatchGroup Generated [mkMatch LambdaExpr vs e (noLoc EmptyLocalBinds)]-#else- mkMatchGroup Generated [mkMatch LambdaExpr vs e (noLoc (EmptyLocalBinds noExtField))]-#endif+ mkMatchGroup Generated [mkMatch LambdaExpr vs e (noLoc emptyLocalBinds)] m' <- case unLoc $ mg_alts mg of [m] -> setAnnsFor m [(G AnnLam, DP (0,0)),(G AnnRarrow, DP (0,1))] _ -> fail "mkLams: lambda expression can only have a single match!"-#if __GLASGOW_HASKELL__ < 806- cloneT $ noLoc $ HsLam mg { mg_alts = noLoc [m'] }-#else cloneT $ noLoc $ HsLam noExtField mg { mg_alts = noLoc [m'] }-#endif mkLet :: Monad m => HsLocalBinds GhcPs -> LHsExpr GhcPs -> TransformT m (LHsExpr GhcPs) mkLet EmptyLocalBinds{} e = return e mkLet lbs e = do llbs <- mkLoc lbs-#if __GLASGOW_HASKELL__ < 806- le <- mkLoc $ HsLet llbs e-#else le <- mkLoc $ HsLet noExtField llbs e-#endif setAnnsFor le [(G AnnLet, DP (0,0)), (G AnnIn, DP (1,1))] mkApps :: Monad m => LHsExpr GhcPs -> [LHsExpr GhcPs] -> TransformT m (LHsExpr GhcPs) mkApps e [] = return e mkApps f (a:as) = do-#if __GLASGOW_HASKELL__ < 806- f' <- mkLoc (HsApp f a)-#else f' <- mkLoc (HsApp noExtField f a)-#endif mkApps f' as -- GHC never generates HsAppTy in the parser, using HsAppsTy to keep a list -- of types. mkHsAppsTy :: Monad m => [LHsType GhcPs] -> TransformT m (LHsType GhcPs)-#if __GLASGOW_HASKELL__ < 806-mkHsAppsTy ts = do- ts' <- mapM (mkLoc . HsAppPrefix) ts- mkLoc (HsAppsTy ts')-#else mkHsAppsTy [] = error "mkHsAppsTy: empty list" mkHsAppsTy (t:ts) = foldM (\t1 t2 -> mkLoc (HsAppTy noExtField t1 t2)) t ts-#endif mkTyVar :: Monad m => Located RdrName -> TransformT m (LHsType GhcPs) mkTyVar nm = do-#if __GLASGOW_HASKELL__ < 806- tv <- mkLoc (HsTyVar NotPromoted nm)-#else tv <- mkLoc (HsTyVar noExtField NotPromoted nm)-#endif _ <- setAnnsFor nm [(G AnnVal, DP (0,0))] swapEntryDPT tv nm return tv +mkVarPat :: Monad m => Located RdrName -> TransformT m (LPat GhcPs)+mkVarPat nm = cLPat <$> mkLoc (VarPat noExtField nm)++mkConPatIn+ :: Monad m+ => Located RdrName+ -> HsConPatDetails GhcPs+ -> TransformT m (Located (Pat GhcPs))+mkConPatIn patName params = do+#if __GLASGOW_HASKELL__ < 900+ p <- mkLoc $ ConPatIn patName params+#else+ p <- mkLoc $ ConPat noExtField patName params+#endif+ setEntryDPT p (DP (0,0))+ return p+ ------------------------------------------------------------------------------- -- Note [Wildcards]@@ -183,54 +172,25 @@ patToExprA :: AlphaEnv -> AnnotatedPat -> AnnotatedHsExpr patToExprA env pat = runIdentity $ transformA pat $ \ p ->- fst <$> runStateT-#if __GLASGOW_HASKELL__ < 808- (patToExpr p)-#else- (patToExpr (composeSrcSpan p))-#endif- (wildSupplyAlphaEnv env, [])+ fst <$> runStateT (patToExpr $ cLPat p) (wildSupplyAlphaEnv env, []) patToExpr :: Monad m => LPat GhcPs -> PatQ m (LHsExpr GhcPs)-#if __GLASGOW_HASKELL__ < 808-patToExpr lp@(L _ p) = do-#else-patToExpr (dL -> lp@(L _ p)) = do-#endif- e <- go p- lift $ transferEntryDPT lp e- return e+patToExpr orig = case dLPat orig of+ Nothing -> error "patToExpr: called on unlocated Pat!"+ Just lp@(L _ p) -> do+ e <- go p+ lift $ transferEntryDPT lp e+ return e where go WildPat{} = newWildVar >>= lift . mkLocatedHsVar . noLoc+#if __GLASGOW_HASKELL__ < 900+ go XPat{} = error "patToExpr XPat"+ go CoPat{} = error "patToExpr CoPat" go (ConPatIn con ds) = conPatHelper con ds-#if __GLASGOW_HASKELL__ < 806- go (LazyPat pat) = patToExpr pat- go (BangPat pat) = patToExpr pat- go (ListPat ps ty mb) = do- ps' <- mapM patToExpr ps- lift $ do- el <- mkLoc $ ExplicitList ty (snd <$> mb) ps'- setAnnsFor el [(G AnnOpenS, DP (0,0)), (G AnnCloseS, DP (0,0))]- go (LitPat lit) = lift $ do- lit' <- cloneT lit- mkLoc $ HsLit lit'- go (NPat llit mbNeg _ _) = lift $ do- L _ lit <- cloneT llit- e <- mkLoc $ HsOverLit lit- negE <- maybe (return e) (mkLoc . NegApp e) mbNeg- addAllAnnsT llit negE- return negE- go PArrPat{} = error "patToExpr PArrPat"- go (ParPat p') = lift . mkParen HsPar =<< patToExpr p'- go SigPatIn{} = error "patToExpr SigPatIn"- go SigPatOut{} = error "patToExpr SigPatOut"- go (TuplePat ps boxity _) = do- es <- forM ps $ \pat -> do- e <- patToExpr pat- lift $ mkLoc $ Present e- lift $ mkLoc $ ExplicitTuple es boxity- go (VarPat i) = lift $ mkLocatedHsVar i+ go ConPatOut{} = error "patToExpr ConPatOut" -- only exists post-tc #else+ go (ConPat _ con ds) = conPatHelper con ds+#endif go (LazyPat _ pat) = patToExpr pat go (BangPat _ pat) = patToExpr pat go (ListPat _ ps) = do@@ -255,11 +215,7 @@ lift $ mkLoc $ Present noExtField e lift $ mkLoc $ ExplicitTuple noExtField es boxity go (VarPat _ i) = lift $ mkLocatedHsVar i- go XPat{} = error "patToExpr XPat"-#endif go AsPat{} = error "patToExpr AsPat"- go ConPatOut{} = error "patToExpr ConPatOut" -- only exists post-tc- go CoPat{} = error "patToExpr CoPat" go NPlusKPat{} = error "patToExpr NPlusKPat" go SplicePat{} = error "patToExpr SplicePat" go SumPat{} = error "patToExpr SumPat"@@ -270,17 +226,10 @@ -> HsConPatDetails GhcPs -> PatQ m (LHsExpr GhcPs) conPatHelper con (InfixCon x y) =-#if __GLASGOW_HASKELL__ < 806- lift . mkLoc =<< OpApp <$> patToExpr x- <*> lift (mkLocatedHsVar con)- <*> pure PlaceHolder- <*> patToExpr y-#else lift . mkLoc =<< OpApp <$> pure noExtField <*> patToExpr x <*> lift (mkLocatedHsVar con) <*> patToExpr y-#endif conPatHelper con (PrefixCon xs) = do f <- lift $ mkLocatedHsVar con as <- mapM patToExpr xs@@ -290,35 +239,22 @@ ------------------------------------------------------------------------------- grhsToExpr :: LGRHS p (LHsExpr p) -> LHsExpr p-#if __GLASGOW_HASKELL__ < 806-grhsToExpr (L _ (GRHS [] e)) = e-grhsToExpr (L _ (GRHS (_:_) e)) = e -- not sure about this-#else grhsToExpr (L _ (GRHS _ [] e)) = e grhsToExpr (L _ (GRHS _ (_:_) e)) = e -- not sure about this grhsToExpr _ = error "grhsToExpr"-#endif ------------------------------------------------------------------------------- precedence :: FixityEnv -> HsExpr GhcPs -> Maybe Fixity precedence _ (HsApp {}) = Just $ Fixity (SourceText "HsApp") 10 InfixL-#if __GLASGOW_HASKELL__ < 806-precedence fixities (OpApp _ op _ _) = Just $ lookupOp op fixities-#else precedence fixities (OpApp _ _ op _) = Just $ lookupOp op fixities-#endif precedence _ _ = Nothing parenify :: Monad m => Context -> LHsExpr GhcPs -> TransformT m (LHsExpr GhcPs) parenify Context{..} le@(L _ e) | needed ctxtParentPrec (precedence ctxtFixityEnv e) && needsParens e =-#if __GLASGOW_HASKELL__ < 806- mkParen HsPar le-#else mkParen (HsPar noExtField) le-#endif | otherwise = return le where {- parent -} {- child -}@@ -329,24 +265,12 @@ needed _ _ = False unparen :: LHsExpr GhcPs -> LHsExpr GhcPs-#if __GLASGOW_HASKELL__ < 806-unparen (L _ (HsPar e)) = e-#else unparen (L _ (HsPar _ e)) = e-#endif unparen e = e -- | hsExprNeedsParens is not always up-to-date, so this allows us to override needsParens :: HsExpr GhcPs -> Bool-#if __GLASGOW_HASKELL__ < 806-needsParens RecordCon{} = False-needsParens RecordUpd{} = False-needsParens HsSpliceE{} = False-needsParens (HsWrap _ e) = hsExprNeedsParens e-needsParens e = hsExprNeedsParens e-#else needsParens = hsExprNeedsParens (PprPrec 10)-#endif mkParen :: (Data x, Monad m) => (Located x -> x) -> Located x -> TransformT m (Located x) mkParen k e = do@@ -355,38 +279,68 @@ swapEntryDPT e pe return pe +-- This explicitly operates on 'Located (Pat GhcPs)' instead of 'LPat GhcPs'+-- because it is applied at that type by SYB.+parenifyP+ :: Monad m+ => Context+ -> Located (Pat GhcPs)+ -> TransformT m (Located (Pat GhcPs))+parenifyP Context{..} p@(L _ pat)+ | IsLhs <- ctxtParentPrec+ , needed pat =+ mkParen (ParPat noExtField . cLPat) p+ | otherwise = return p+ where+ needed BangPat{} = False+ needed LazyPat{} = False+ needed ListPat{} = False+ needed LitPat{} = False+ needed ParPat{} = False+ needed SumPat{} = False+ needed TuplePat{} = False+ needed VarPat{} = False+ needed WildPat{} = False+#if __GLASGOW_HASKELL__ < 900+ needed (ConPatIn _ (PrefixCon [])) = False+ needed ConPatOut{pat_args = PrefixCon []} = False+#else+ needed (ConPat _ _ (PrefixCon [])) = False+#endif+ needed _ = True+ parenifyT :: Monad m => Context -> LHsType GhcPs -> TransformT m (LHsType GhcPs) parenifyT Context{..} lty@(L _ ty)-#if __GLASGOW_HASKELL__ < 806- | needed ty = mkParen HsParTy lty-#else | needed ty = mkParen (HsParTy noExtField) lty-#endif | otherwise = return lty where-#if __GLASGOW_HASKELL__ < 806- needed HsTyVar{} = False- needed HsListTy{} = False- needed HsPArrTy{} = False- needed HsTupleTy{} = False- needed HsParTy{} = False- needed HsTyLit{} = False- needed (HsAppsTy tys)- | HasPrec _ <- ctxtParentPrec = length tys > 1- | otherwise = False- needed _ = True-#else needed HsAppTy{} | IsHsAppsTy <- ctxtParentPrec = True | otherwise = False needed t = hsTypeNeedsParens (PprPrec 10) t-#endif unparenT :: LHsType GhcPs -> LHsType GhcPs-#if __GLASGOW_HASKELL__ < 806-unparenT (L _ (HsParTy ty)) = ty-#else unparenT (L _ (HsParTy _ ty)) = ty-#endif unparenT ty = ty++-- This explicitly operates on 'Located (Pat GhcPs)' instead of 'LPat GhcPs'+-- to ensure 'dLPat' was called on the input.+unparenP :: Located (Pat GhcPs) -> Located (Pat GhcPs)+unparenP (L _ (ParPat _ p)) | Just lp <- dLPat p = lp+unparenP p = p++--------------------------------------------------------------------++bitraverseHsConDetails+ :: Applicative m+ => (arg -> m arg')+ -> (rec -> m rec')+ -> HsConDetails arg rec+ -> m (HsConDetails arg' rec')+bitraverseHsConDetails argf _ (PrefixCon args) =+ PrefixCon <$> (argf `traverse` args)+bitraverseHsConDetails _ recf (RecCon r) =+ RecCon <$> recf r+bitraverseHsConDetails argf _ (InfixCon a1 a2) =+ InfixCon <$> argf a1 <*> argf a2
Retrie/GHC.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE RecordWildCards #-} module Retrie.GHC ( module Retrie.GHC+#if __GLASGOW_HASKELL__ < 900 , module ApiAnnotation , module Bag , module BasicTypes@@ -28,8 +29,26 @@ , module Unique , module UniqFM , module UniqSet+#else+ -- GHC >= 9.0+ , module GHC.Data.Bag+ , module GHC.Data.FastString+ , module GHC.Data.FastString.Env+ , module GHC.Utils.Error+ , module GHC.Hs+ , module GHC.Parser.Annotation+ , module GHC.Types.Basic+ , module GHC.Types.Name+ , module GHC.Types.Name.Reader+ , module GHC.Types.SrcLoc+ , module GHC.Types.Unique+ , module GHC.Types.Unique.FM+ , module GHC.Types.Unique.Set+ , module GHC.Unit+#endif ) where +#if __GLASGOW_HASKELL__ < 900 import ApiAnnotation import Bag import BasicTypes@@ -37,15 +56,13 @@ import FastStringEnv #if __GLASGOW_HASKELL__ < 810 import HsExpr-#if __GLASGOW_HASKELL__ < 806-import HsSyn hiding (HasDefault(..))-#else-import HsSyn-#endif+import HsSyn hiding (HsModule)+import qualified HsSyn as HS #else import ErrUtils import GHC.Hs.Expr-import GHC.Hs+import GHC.Hs hiding (HsModule)+import qualified GHC.Hs as HS #endif import Module import Name@@ -55,10 +72,61 @@ import Unique import UniqFM import UniqSet+#else+-- GHC >= 9.0+import GHC.Data.Bag+import GHC.Data.FastString+import GHC.Data.FastString.Env+import GHC.Utils.Error+import GHC.Hs+import GHC.Parser.Annotation+import GHC.Types.Basic+import GHC.Types.Name+import GHC.Types.Name.Reader+import GHC.Types.SrcLoc+import GHC.Types.Unique+import GHC.Types.Unique.FM+import GHC.Types.Unique.Set+import GHC.Unit+#endif import Data.Bifunctor (second) import Data.Maybe +#if __GLASGOW_HASKELL__ < 900+type HsModule = HS.HsModule GhcPs+#endif++cLPat :: Located (Pat (GhcPass p)) -> LPat (GhcPass p)+#if __GLASGOW_HASKELL__ == 808+cLPat = composeSrcSpan+#else+cLPat = id+#endif++-- | Only returns located pat if there is a genuine location available.+dLPat :: LPat (GhcPass p) -> Maybe (Located (Pat (GhcPass p)))+#if __GLASGOW_HASKELL__ == 808+dLPat (XPat (L s p)) = Just $ L s $ stripSrcSpanPat p+dLPat _ = Nothing+#else+dLPat = Just+#endif++-- | Will always give a location, but it may be noSrcSpan.+dLPatUnsafe :: LPat (GhcPass p) -> Located (Pat (GhcPass p))+#if __GLASGOW_HASKELL__ == 808+dLPatUnsafe = dL+#else+dLPatUnsafe = id+#endif++#if __GLASGOW_HASKELL__ == 808+stripSrcSpanPat :: LPat (GhcPass p) -> Pat (GhcPass p)+stripSrcSpanPat (XPat (L _ p)) = stripSrcSpanPat p+stripSrcSpanPat p = p+#endif+ rdrFS :: RdrName -> FastString rdrFS (Qual m n) = mconcat [moduleNameFS m, fsDot, occNameFS n] rdrFS rdr = occNameFS (occName rdr)@@ -67,77 +135,56 @@ fsDot = mkFastString "." varRdrName :: HsExpr p -> Maybe (Located (IdP p))-#if __GLASGOW_HASKELL__ < 806-varRdrName (HsVar n) = Just n-#else varRdrName (HsVar _ n) = Just n-#endif varRdrName _ = Nothing tyvarRdrName :: HsType p -> Maybe (Located (IdP p))-#if __GLASGOW_HASKELL__ < 806-tyvarRdrName (HsTyVar _ n) = Just n-#else tyvarRdrName (HsTyVar _ _ n) = Just n-#endif tyvarRdrName _ = Nothing -fixityDecls :: HsModule p -> [(Located (IdP p), Fixity)]+fixityDecls :: HsModule -> [(Located RdrName, Fixity)] fixityDecls m = [ (nm, fixity)-#if __GLASGOW_HASKELL__ < 806- | L _ (SigD (FixSig (FixitySig nms fixity))) <- hsmodDecls m-#else | L _ (SigD _ (FixSig _ (FixitySig _ nms fixity))) <- hsmodDecls m-#endif , nm <- nms ] ruleInfo :: RuleDecl GhcPs -> [RuleInfo]-#if __GLASGOW_HASKELL__ < 808--#if __GLASGOW_HASKELL__ < 806-ruleInfo (HsRule (L _ (_, riName)) _ bs riLHS _ riRHS _) =-#else-ruleInfo XRuleDecl{} = []-ruleInfo (HsRule _ (L _ (_, riName)) _ bs riLHS riRHS) =-#endif- [ RuleInfo { riQuantifiers = ruleBindersToQs bs, .. } ]--#else ruleInfo (HsRule _ (L _ (_, riName)) _ tyBs valBs riLHS riRHS) = let riQuantifiers = map unLoc (tyBindersToLocatedRdrNames (fromMaybe [] tyBs)) ++ ruleBindersToQs valBs in [ RuleInfo{..} ]+#if __GLASGOW_HASKELL__ < 900 ruleInfo XRuleDecl{} = [] #endif ruleBindersToQs :: [LRuleBndr GhcPs] -> [RdrName] ruleBindersToQs bs = catMaybes [ case b of-#if __GLASGOW_HASKELL__ < 806- RuleBndr (L _ v) -> Just v- RuleBndrSig (L _ v) _ -> Just v-#else RuleBndr _ (L _ v) -> Just v RuleBndrSig _ (L _ v) _ -> Just v+#if __GLASGOW_HASKELL__ < 900 XRuleBndr{} -> Nothing #endif | L _ b <- bs ] +#if __GLASGOW_HASKELL__ < 900 tyBindersToLocatedRdrNames :: [LHsTyVarBndr GhcPs] -> [Located RdrName]+#else+tyBindersToLocatedRdrNames :: [LHsTyVarBndr () GhcPs] -> [Located RdrName]+#endif tyBindersToLocatedRdrNames vars = catMaybes [ case var of-#if __GLASGOW_HASKELL__ < 806- UserTyVar v -> Just v- KindedTyVar v _ -> Just v-#else+#if __GLASGOW_HASKELL__ < 900 UserTyVar _ v -> Just v KindedTyVar _ v _ -> Just v XTyVarBndr{} -> Nothing+#else+ UserTyVar _ _ v -> Just v+ KindedTyVar _ _ v _ -> Just v #endif | L _ var <- vars ] @@ -148,17 +195,17 @@ , riRHS :: LHsExpr GhcPs } -#if __GLASGOW_HASKELL__ < 806-#elif __GLASGOW_HASKELL__ < 810+#if __GLASGOW_HASKELL__ < 810 noExtField :: NoExt noExtField = noExt #endif overlaps :: SrcSpan -> SrcSpan -> Bool-overlaps (RealSrcSpan s1) (RealSrcSpan s2) =- srcSpanFile s1 == srcSpanFile s2 &&- ((srcSpanStartLine s1, srcSpanStartCol s1) `within` s2 ||- (srcSpanEndLine s1, srcSpanEndCol s1) `within` s2)+overlaps ss1 ss2+ | Just s1 <- getRealSpan ss1, Just s2 <- getRealSpan ss2 =+ srcSpanFile s1 == srcSpanFile s2 &&+ ((srcSpanStartLine s1, srcSpanStartCol s1) `within` s2 ||+ (srcSpanEndLine s1, srcSpanEndCol s1) `within` s2) overlaps _ _ = False within :: (Int, Int) -> RealSrcSpan -> Bool@@ -171,11 +218,31 @@ lineCount :: [SrcSpan] -> Int lineCount ss = sum [ srcSpanEndLine s - srcSpanStartLine s + 1- | RealSrcSpan s <- ss+ | Just s <- map getRealSpan ss ] showRdrs :: [RdrName] -> String showRdrs = show . map (occNameString . occName) +#if __GLASGOW_HASKELL__ < 900 uniqBag :: Uniquable a => [(a,b)] -> UniqFM [b]+#else+uniqBag :: Uniquable a => [(a,b)] -> UniqFM a [b]+#endif uniqBag = listToUFM_C (++) . map (second pure)++getRealLoc :: SrcLoc -> Maybe RealSrcLoc+#if __GLASGOW_HASKELL__ < 900+getRealLoc (RealSrcLoc l) = Just l+#else+getRealLoc (RealSrcLoc l _) = Just l+#endif+getRealLoc _ = Nothing++getRealSpan :: SrcSpan -> Maybe RealSrcSpan+#if __GLASGOW_HASKELL__ < 900+getRealSpan (RealSrcSpan s) = Just s+#else+getRealSpan (RealSrcSpan s _) = Just s+#endif+getRealSpan _ = Nothing
Retrie/Options.hs view
@@ -242,6 +242,26 @@ , metavar "EQUATION" , help "Apply an adhoc equation of the form: forall vs. lhs = rhs" ]+ , fmap AdhocType $ option str $ mconcat+ [ long "adhoc-type"+ , metavar "EQUATION"+ , help "Apply an adhoc type equation of the form: lhs = rhs"+ ]+ , fmap PatternForward $ option str $ mconcat+ [ long "pattern-forward"+ , metavar "NAME"+ , help "Apply fully-qualified pattern synonym name left-to-right."+ ]+ , fmap PatternBackward $ option str $ mconcat+ [ long "pattern-backward"+ , metavar "NAME"+ , help "Apply fully-qualified pattern synonym name right-to-left."+ ]+ , fmap AdhocPattern $ option str $ mconcat+ [ long "adhoc-pattern"+ , metavar "EQUATION"+ , help "Apply an adhoc pattern equation of the form: lhs = rhs"+ ] ] parseMode :: Parser ExecutionMode
Retrie/PatternMap/Bag.hs view
@@ -3,6 +3,7 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-}@@ -139,7 +140,11 @@ ------------------------------------------------------------------------ +#if __GLASGOW_HASKELL__ < 900 newtype UniqFM a = UniqFM { unUniqFM :: GHC.UniqFM [a] }+#else+newtype UniqFM a = UniqFM { unUniqFM :: GHC.UniqFM (Key UniqFM) [a] }+#endif deriving (Functor) instance PatternMap UniqFM where
Retrie/PatternMap/Class.hs view
@@ -11,6 +11,7 @@ module Retrie.PatternMap.Class where import Control.Monad+import Data.Kind import Data.Maybe import Retrie.AlphaEnv@@ -38,13 +39,6 @@ -- TODO: Maybe a -> a ??? -- we never need to delete type A a = Maybe a -> Maybe a -missingSyntax :: String -> a-missingSyntax constructor = error $ unlines- [ "Missing syntax support: " ++ constructor- , "Please file an issue at https://github.com/facebookincubator/retrie/issues"- , "with an example of the rewrite you are attempting and we'll add it."- ]- toA :: PatternMap m => (m a -> m a) -> A (m a) toA f = Just . f . fromMaybe mEmpty @@ -58,7 +52,7 @@ ------------------------------------------------------------------------ class PatternMap m where- type Key m :: *+ type Key m :: Type mEmpty :: m a mUnion :: m a -> m a -> m a
Retrie/PatternMap/Instances.hs view
@@ -7,6 +7,8 @@ {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-}@@ -23,6 +25,7 @@ import Retrie.PatternMap.Class import Retrie.Quantifiers import Retrie.Substitution+import Retrie.Util ------------------------------------------------------------------------ @@ -45,10 +48,8 @@ mAlter :: AlphaEnv -> Quantifiers -> Key TupArgMap -> A a -> TupArgMap a -> TupArgMap a mAlter env vs tupArg f m = go (unLoc tupArg) where-#if __GLASGOW_HASKELL__ < 806- go (Present e) = m { tamPresent = mAlter env vs e f (tamPresent m) }-#else go (Present _ e) = m { tamPresent = mAlter env vs e f (tamPresent m) }+#if __GLASGOW_HASKELL__ < 900 go XTupArg{} = missingSyntax "XTupArg" #endif go (Missing _) = m { tamMissing = mAlter env vs () f (tamMissing m) }@@ -56,10 +57,8 @@ mMatch :: MatchEnv -> Key TupArgMap -> (Substitution, TupArgMap a) -> [(Substitution, a)] mMatch env = go . unLoc where-#if __GLASGOW_HASKELL__ < 806- go (Present e) = mapFor tamPresent >=> mMatch env e-#else go (Present _ e) = mapFor tamPresent >=> mMatch env e+#if __GLASGOW_HASKELL__ < 900 go XTupArg{} = const [] #endif go (Missing _) = mapFor tamMissing >=> mMatch env ()@@ -182,8 +181,7 @@ go HsRat{} = missingSyntax "HsRat" go HsFloatPrim{} = missingSyntax "HsFloatPrim" go HsDoublePrim{} = missingSyntax "HsDoublePrim"-#if __GLASGOW_HASKELL__ < 806-#else+#if __GLASGOW_HASKELL__ < 900 go XLit{} = missingSyntax "XLit" #endif @@ -353,47 +351,9 @@ dollarFork v@HsVar{} l r | Just (L _ rdr) <- varRdrName v , occNameString (occName rdr) == "$" =-#if __GLASGOW_HASKELL__ < 806- go (HsApp l (noLoc (HsPar r)))-#else go (HsApp noExtField l (noLoc (HsPar noExtField r)))-#endif dollarFork _ _ _ = m -#if __GLASGOW_HASKELL__ < 806- go (HsVar v)- | unLoc v `isQ` vs = m { emHole = mAlter env vs (unLoc v) f (emHole m) }- | otherwise = m { emVar = mAlter env vs (unLoc v) f (emVar m) }- go (ExplicitTuple as b) =- m { emExplicitTuple = mAlter env vs b (toA (mAlter env vs as f)) (emExplicitTuple m) }- go (HsApp l r) =- m { emApp = mAlter env vs l (toA (mAlter env vs r f)) (emApp m) }- go (HsCase s mg) =- m { emCase = mAlter env vs s (toA (mAlter env vs mg f)) (emCase m) }- go (HsDo sc ss _) =- m { emDo = mAlter env vs sc (toA (mAlter env vs (unLoc ss) f)) (emDo m) }- go (HsIf _ c tr fl) =- m { emIf = mAlter env vs c- (toA (mAlter env vs tr- (toA (mAlter env vs fl f)))) (emIf m) }- go (HsIPVar (HsIPName ip)) = m { emIPVar = mAlter env vs ip f (emIPVar m) }- go (HsLit l) = m { emLit = mAlter env vs l f (emLit m) }- go (HsLam mg) = m { emLam = mAlter env vs mg f (emLam m) }- go (HsOverLit ol) = m { emOverLit = mAlter env vs (ol_val ol) f (emOverLit m) }- go (NegApp e' _) = m { emNegApp = mAlter env vs e' f (emNegApp m) }- go (HsPar e') = m { emPar = mAlter env vs e' f (emPar m) }- go (OpApp l o _ r) = (dollarFork (unLoc o) l r)- { emOpApp = mAlter env vs o (toA (mAlter env vs l (toA (mAlter env vs r f)))) (emOpApp m) }- go (RecordCon v _ _ fs) =- m { emRecordCon = mAlter env vs (unLoc v) (toA (mAlter env vs (fieldsToRdrNames $ rec_flds fs) f)) (emRecordCon m) }- go (RecordUpd e' fs _ _ _ _) =- m { emRecordUpd = mAlter env vs e' (toA (mAlter env vs (fieldsToRdrNames fs) f)) (emRecordUpd m) }- go (SectionL lhs o) =- m { emSecL = mAlter env vs o (toA (mAlter env vs lhs f)) (emSecL m) }- go (SectionR o rhs) =- m { emSecR = mAlter env vs o (toA (mAlter env vs rhs f)) (emSecR m) }- go (HsLet lbs e') =-#else go (HsVar _ v) | unLoc v `isQ` vs = m { emHole = mAlter env vs (unLoc v) f (emHole m) } | otherwise = m { emVar = mAlter env vs (unLoc v) f (emVar m) }@@ -405,7 +365,11 @@ m { emCase = mAlter env vs s (toA (mAlter env vs mg f)) (emCase m) } go (HsDo _ sc ss) = m { emDo = mAlter env vs sc (toA (mAlter env vs (unLoc ss) f)) (emDo m) }+#if __GLASGOW_HASKELL__ < 900 go (HsIf _ _ c tr fl) =+#else+ go (HsIf _ c tr fl) =+#endif m { emIf = mAlter env vs c (toA (mAlter env vs tr (toA (mAlter env vs fl f)))) (emIf m) }@@ -425,9 +389,7 @@ m { emSecL = mAlter env vs o (toA (mAlter env vs lhs f)) (emSecL m) } go (SectionR _ o rhs) = m { emSecR = mAlter env vs o (toA (mAlter env vs rhs f)) (emSecR m) }- go XExpr{} = missingSyntax "XExpr" go (HsLet _ lbs e') =-#endif let bs = collectLocalBinders $ unLoc lbs env' = foldr extendAlphaEnvInternal env bs@@ -437,20 +399,18 @@ go HsMultiIf{} = missingSyntax "HsMultiIf" go (ExplicitList _ _ es) = m { emExplicitList = mAlter env vs es f (emExplicitList m) } go ArithSeq{} = missingSyntax "ArithSeq"-#if __GLASGOW_HASKELL__ < 806- go (ExprWithTySig e' (HsWC _ (HsIB _ ty _))) =- m { emExprWithTySig = mAlter env vs e' (toA (mAlter env vs ty f)) (emExprWithTySig m) }-#else-#if __GLASGOW_HASKELL__ < 808- go (ExprWithTySig (HsWC _ (HsIB _ ty)) e') =-#else go (ExprWithTySig _ e' (HsWC _ (HsIB _ ty))) =-#endif m { emExprWithTySig = mAlter env vs e' (toA (mAlter env vs ty f)) (emExprWithTySig m) }+#if __GLASGOW_HASKELL__ < 900+ go XExpr{} = missingSyntax "XExpr" go ExprWithTySig{} = missingSyntax "ExprWithTySig"-#endif go HsSCC{} = missingSyntax "HsSCC" go HsCoreAnn{} = missingSyntax "HsCoreAnn"+ go HsTickPragma{} = missingSyntax "HsTickPragma"+ go HsWrap{} = missingSyntax "HsWrap"+#else+ go HsPragE{} = missingSyntax "HsPragE"+#endif go HsBracket{} = missingSyntax "HsBracket" go HsRnBracketOut{} = missingSyntax "HsRnBracketOut" go HsTcBracketOut{} = missingSyntax "HsTcBracketOut"@@ -467,20 +427,12 @@ #endif go HsTick{} = missingSyntax "HsTick" go HsBinTick{} = missingSyntax "HsBinTick"- go HsTickPragma{} = missingSyntax "HsTickPragma"- go HsWrap{} = missingSyntax "HsWrap" go HsUnboundVar{} = missingSyntax "HsUnboundVar" go HsRecFld{} = missingSyntax "HsRecFld" go HsOverLabel{} = missingSyntax "HsOverLabel" go HsAppType{} = missingSyntax "HsAppType" go HsConLikeOut{} = missingSyntax "HsConLikeOut" go ExplicitSum{} = missingSyntax "ExplicitSum"-#if __GLASGOW_HASKELL__ < 806- go ExplicitPArr{} = missingSyntax "ExplicitPArr"- go ExprWithTySigOut{} = missingSyntax "ExprWithTySigOut"- go HsAppTypeOut{} = missingSyntax "HsAppTypeOut"- go PArrSeq{} = missingSyntax "PArrSeq"-#endif mMatch :: MatchEnv -> Key EMap -> (Substitution, EMap a) -> [(Substitution, a)] mMatch _ _ (_,EMEmpty) = []@@ -488,35 +440,15 @@ where hss = extendResult (emHole m) (HoleExpr $ mePruneA env e) hs -#if __GLASGOW_HASKELL__ < 806- go (ExplicitTuple as b) = mapFor emExplicitTuple >=> mMatch env b >=> mMatch env as- go (HsApp l r) = mapFor emApp >=> mMatch env l >=> mMatch env r- go (HsCase s mg) = mapFor emCase >=> mMatch env s >=> mMatch env mg- go (HsDo sc ss _) = mapFor emDo >=> mMatch env sc >=> mMatch env (unLoc ss)- go (HsIf _ c tr fl) =- mapFor emIf >=> mMatch env c >=> mMatch env tr >=> mMatch env fl- go (HsIPVar (HsIPName ip)) = mapFor emIPVar >=> mMatch env ip- go (HsLam mg) = mapFor emLam >=> mMatch env mg- go (HsLit l) = mapFor emLit >=> mMatch env l- go (HsOverLit ol) = mapFor emOverLit >=> mMatch env (ol_val ol)- go (HsPar e') = mapFor emPar >=> mMatch env e'- go (HsVar v) = mapFor emVar >=> mMatch env (unLoc v)- go (NegApp e' _) = mapFor emNegApp >=> mMatch env e'- go (OpApp l o _ r) =- mapFor emOpApp >=> mMatch env o >=> mMatch env l >=> mMatch env r- go (RecordCon v _ _ fs) =- mapFor emRecordCon >=> mMatch env (unLoc v) >=> mMatch env (fieldsToRdrNames $ rec_flds fs)- go (RecordUpd e' fs _ _ _ _) =- mapFor emRecordUpd >=> mMatch env e' >=> mMatch env (fieldsToRdrNames fs)- go (SectionL lhs o) = mapFor emSecL >=> mMatch env o >=> mMatch env lhs- go (SectionR o rhs) = mapFor emSecR >=> mMatch env o >=> mMatch env rhs- go (HsLet lbs e') =-#else go (ExplicitTuple _ as b) = mapFor emExplicitTuple >=> mMatch env b >=> mMatch env as go (HsApp _ l r) = mapFor emApp >=> mMatch env l >=> mMatch env r go (HsCase _ s mg) = mapFor emCase >=> mMatch env s >=> mMatch env mg go (HsDo _ sc ss) = mapFor emDo >=> mMatch env sc >=> mMatch env (unLoc ss)+#if __GLASGOW_HASKELL__ < 900 go (HsIf _ _ c tr fl) =+#else+ go (HsIf _ c tr fl) =+#endif mapFor emIf >=> mMatch env c >=> mMatch env tr >=> mMatch env fl go (HsIPVar _ (HsIPName ip)) = mapFor emIPVar >=> mMatch env ip go (HsLam _ mg) = mapFor emLam >=> mMatch env mg@@ -534,19 +466,12 @@ go (SectionL _ lhs o) = mapFor emSecL >=> mMatch env o >=> mMatch env lhs go (SectionR _ o rhs) = mapFor emSecR >=> mMatch env o >=> mMatch env rhs go (HsLet _ lbs e') =-#endif let bs = collectLocalBinders (unLoc lbs) env' = extendMatchEnv env bs in mapFor emLet >=> mMatch env (unLoc lbs) >=> mMatch env' e' go (ExplicitList _ _ es) = mapFor emExplicitList >=> mMatch env es-#if __GLASGOW_HASKELL__ < 806- go (ExprWithTySig e' (HsWC _ (HsIB _ ty _))) =-#elif __GLASGOW_HASKELL__ < 808- go (ExprWithTySig (HsWC _ (HsIB _ ty)) e') =-#else go (ExprWithTySig _ e' (HsWC _ (HsIB _ ty))) =-#endif mapFor emExprWithTySig >=> mMatch env e' >=> mMatch env ty go _ = const [] -- TODO remove @@ -567,15 +492,7 @@ sameHoleValue (HoleExpr e1) (HoleExpr e2) = alphaEquivalent (astA e1) (astA e2) EMEmpty sameHoleValue (HolePat p1) (HolePat p2) =- alphaEquivalent-#if __GLASGOW_HASKELL__ < 808- (astA p1)- (astA p2)-#else- (composeSrcSpan $ astA p1)- (composeSrcSpan $ astA p2)-#endif- PatEmpty+ alphaEquivalent (cLPat $ astA p1) (cLPat $ astA p2) PatEmpty sameHoleValue (HoleType ty1) (HoleType ty2) = alphaEquivalent (astA ty1) (astA ty2) TyEmpty sameHoleValue _ _ = Nothing@@ -593,7 +510,11 @@ = SCEmpty | SCM { scmListComp :: MaybeMap a , scmMonadComp :: MaybeMap a+#if __GLASGOW_HASKELL__ < 900 , scmDoExpr :: MaybeMap a+#else+ , scmDoExpr :: FSEnv a -- We use empty string when modulename is Nothing+#endif -- TODO: the rest } deriving (Functor)@@ -602,7 +523,13 @@ emptySCMapWrapper = SCM mEmpty mEmpty mEmpty instance PatternMap SCMap where+#if __GLASGOW_HASKELL__ < 900 type Key SCMap = HsStmtContext Name -- see comment on HsDo in GHC+#elif __GLASGOW_HASKELL__ < 920+ type Key SCMap = HsStmtContext GhcRn+#else+ type Key SCMap = HsStmtContext (HsDoRn GhcPs)+#endif mEmpty :: SCMap a mEmpty = SCEmpty@@ -622,11 +549,12 @@ where go ListComp = m { scmListComp = mAlter env vs () f (scmListComp m) } go MonadComp = m { scmMonadComp = mAlter env vs () f (scmMonadComp m) }-#if __GLASGOW_HASKELL__ < 806- go PArrComp = missingSyntax "PArrComp"-#endif+#if __GLASGOW_HASKELL__ < 900 go DoExpr = m { scmDoExpr = mAlter env vs () f (scmDoExpr m) }- go MDoExpr = missingSyntax "MDoExpr"+#else+ go (DoExpr mname) = m { scmDoExpr = mAlter env vs (maybe "" moduleNameFS mname) f (scmDoExpr m) }+#endif+ go MDoExpr{} = missingSyntax "MDoExpr" go ArrowExpr = missingSyntax "ArrowExpr" go GhciStmtCtxt = missingSyntax "GhciStmtCtxt" go (PatGuard _) = missingSyntax "PatGuard"@@ -639,7 +567,11 @@ where go ListComp = mapFor scmListComp >=> mMatch env () go MonadComp = mapFor scmMonadComp >=> mMatch env ()+#if __GLASGOW_HASKELL__ < 900 go DoExpr = mapFor scmDoExpr >=> mMatch env ()+#else+ go (DoExpr mname) = mapFor scmDoExpr >=> mMatch env (maybe "" moduleNameFS mname)+#endif go _ = const [] -- TODO ------------------------------------------------------------------------@@ -797,63 +729,51 @@ mAlter env vs pat f m@PatMap{} = go (unLoc pat) where go (WildPat _) = m { pmWild = mAlter env vs () f (pmWild m) }-#if __GLASGOW_HASKELL__ < 806- go (VarPat v)-#else go (VarPat _ v)-#endif | unLoc v `isQ` vs = m { pmHole = mAlter env vs (unLoc v) f (pmHole m) } | otherwise = m { pmVar = mAlter env vs () f (pmVar m) } -- See Note [Variable Binders] go LazyPat{} = missingSyntax "LazyPat" go AsPat{} = missingSyntax "AsPat" go BangPat{} = missingSyntax "BangPat" go ListPat{} = missingSyntax "ListPat"- go (ConPatIn c d) = m { pmConPatIn = mAlter env vs (rdrFS (unLoc c)) (toA (mAlter env vs d f)) (pmConPatIn m) }+#if __GLASGOW_HASKELL__ < 900+ go XPat{} = missingSyntax "XPat"+ go CoPat{} = missingSyntax "CoPat" go ConPatOut{} = missingSyntax "ConPatOut"+ go (ConPatIn c d) =+#else+ go (ConPat _ c d) =+#endif+ m { pmConPatIn = mAlter env vs (rdrFS (unLoc c)) (toA (mAlter env vs d f)) (pmConPatIn m) } go ViewPat{} = missingSyntax "ViewPat" go SplicePat{} = missingSyntax "SplicePat" go LitPat{} = missingSyntax "LitPat" go NPat{} = missingSyntax "NPat" go NPlusKPat{} = missingSyntax "NPlusKPat"-#if __GLASGOW_HASKELL__ < 806- go (PArrPat _ _) = missingSyntax "PArrPat"- go (ParPat p) = m { pmParPat = mAlter env vs p f (pmParPat m) }- go (SigPatIn _ _) = missingSyntax "SigPatIn"- go (SigPatOut _ _) = missingSyntax "SigPatOut"- go (TuplePat ps b _tys) =- m { pmTuplePat = mAlter env vs b (toA (mAlter env vs ps f)) (pmTuplePat m) }-#else go (ParPat _ p) = m { pmParPat = mAlter env vs p f (pmParPat m) } go (TuplePat _ ps b) = m { pmTuplePat = mAlter env vs b (toA (mAlter env vs ps f)) (pmTuplePat m) } go SigPat{} = missingSyntax "SigPat"- go XPat{} = missingSyntax "XPat"-#endif- go CoPat{} = missingSyntax "CoPat" go SumPat{} = missingSyntax "SumPat" mMatch :: MatchEnv -> Key PatMap -> (Substitution, PatMap a) -> [(Substitution, a)]- mMatch _ _ (_ ,PatEmpty) = []-#if __GLASGOW_HASKELL__ < 808- mMatch env pat (hs,m@PatMap{}) =-#else- mMatch env (dL -> pat) (hs,m@PatMap{}) =-#endif- hss ++ go (unLoc pat) (hs,m)+ mMatch _ _ (_, PatEmpty) = []+ mMatch env pat (hs,m@PatMap{})+ | Just lp@(L _ p) <- dLPat pat = hss lp ++ go p (hs,m)+ | otherwise = [] where- hss = extendResult (pmHole m) (HolePat $ mePruneA env pat) hs+ hss lp = extendResult (pmHole m) (HolePat $ mePruneA env lp) hs go (WildPat _) = mapFor pmWild >=> mMatch env ()-#if __GLASGOW_HASKELL__ < 806- go (ParPat p) = mapFor pmParPat >=> mMatch env p- go (TuplePat ps b _) = mapFor pmTuplePat >=> mMatch env b >=> mMatch env ps- go (VarPat _) = mapFor pmVar >=> mMatch env ()-#else go (ParPat _ p) = mapFor pmParPat >=> mMatch env p go (TuplePat _ ps b) = mapFor pmTuplePat >=> mMatch env b >=> mMatch env ps go (VarPat _ _) = mapFor pmVar >=> mMatch env ()+#if __GLASGOW_HASKELL__ < 900+ go (ConPatIn c d) =+#else+ go (ConPat _ c d) = #endif- go (ConPatIn c d) = mapFor pmConPatIn >=> mMatch env (rdrFS (unLoc c)) >=> mMatch env d+ mapFor pmConPatIn >=> mMatch env (rdrFS (unLoc c)) >=> mMatch env d go _ = const [] -- TODO ------------------------------------------------------------------------@@ -902,24 +822,20 @@ mUnion (GRHSMap m1) (GRHSMap m2) = GRHSMap (mUnion m1 m2) mAlter :: AlphaEnv -> Quantifiers -> Key GRHSMap -> A a -> GRHSMap a -> GRHSMap a-#if __GLASGOW_HASKELL__ < 806- mAlter env vs (GRHS gs b) f (GRHSMap m) =-#else+#if __GLASGOW_HASKELL__ < 900 mAlter _ _ XGRHS{} _ _ = missingSyntax "XGRHS"- mAlter env vs (GRHS _ gs b) f (GRHSMap m) = #endif+ mAlter env vs (GRHS _ gs b) f (GRHSMap m) = let bs = collectLStmtsBinders gs env' = foldr extendAlphaEnvInternal env bs vs' = vs `exceptQ` bs in GRHSMap (mAlter env vs gs (toA (mAlter env' vs' b f)) m) mMatch :: MatchEnv -> Key GRHSMap -> (Substitution, GRHSMap a) -> [(Substitution, a)]-#if __GLASGOW_HASKELL__ < 806- mMatch env (GRHS gs b) =-#else+#if __GLASGOW_HASKELL__ < 900 mMatch _ XGRHS{} = const []- mMatch env (GRHS _ gs b) = #endif+ mMatch env (GRHS _ gs b) = mapFor unGRHSMap >=> mMatch env gs >=> mMatch env' b where bs = collectLStmtsBinders gs@@ -1009,14 +925,11 @@ mAlter env vs lbs f LBEmpty = mAlter env vs lbs f emptyLBMapWrapper mAlter env vs lbs f m@LB{} = go lbs where-#if __GLASGOW_HASKELL__ < 806- go EmptyLocalBinds = m { lbEmpty = mAlter env vs () f (lbEmpty m) }- go (HsValBinds vbs) =-#else go (EmptyLocalBinds _) = m { lbEmpty = mAlter env vs () f (lbEmpty m) }+#if __GLASGOW_HASKELL__ < 900 go XHsLocalBindsLR{} = missingSyntax "XHsLocalBindsLR"- go (HsValBinds _ vbs) = #endif+ go (HsValBinds _ vbs) = let bs = collectHsValBinders vbs env' = foldr extendAlphaEnvInternal env bs@@ -1028,13 +941,8 @@ mMatch _ _ (_,LBEmpty) = [] mMatch env lbs (hs,m@LB{}) = go lbs (hs,m) where-#if __GLASGOW_HASKELL__ < 806- go EmptyLocalBinds = mapFor lbEmpty >=> mMatch env ()- go (HsValBinds vbs) =-#else go (EmptyLocalBinds _) = mapFor lbEmpty >=> mMatch env () go (HsValBinds _ vbs) =-#endif let bs = collectHsValBinders vbs env' = extendMatchEnv env bs@@ -1042,11 +950,7 @@ go _ = const [] -- TODO deValBinds :: HsValBinds GhcPs -> [HsBind GhcPs]-#if __GLASGOW_HASKELL__ < 806-deValBinds (ValBindsIn lbs _) = map unLoc (bagToList lbs)-#else deValBinds (ValBinds _ lbs _) = map unLoc (bagToList lbs)-#endif deValBinds _ = error "deValBinds ValBindsOut" ------------------------------------------------------------------------@@ -1086,16 +990,15 @@ mAlter env vs b f BMEmpty = mAlter env vs b f emptyBMapWrapper mAlter env vs b f m@BM{} = go b where -- see Note [Bind env]-#if __GLASGOW_HASKELL__ < 806- go (FunBind _ mg _ _ _) = m { bmFunBind = mAlter env vs mg f (bmFunBind m) }- go (VarBind _ e _) = m { bmVarBind = mAlter env vs e f (bmVarBind m) }- go (PatBind lhs rhs _ _ _) =-#else+#if __GLASGOW_HASKELL__ < 900+ go XHsBindsLR{} = missingSyntax "XHsBindsLR" go (FunBind _ _ mg _ _) = m { bmFunBind = mAlter env vs mg f (bmFunBind m) } go (VarBind _ _ e _) = m { bmVarBind = mAlter env vs e f (bmVarBind m) }- go XHsBindsLR{} = missingSyntax "XHsBindsLR"- go (PatBind _ lhs rhs _) =+#else+ go (FunBind _ _ mg _) = m { bmFunBind = mAlter env vs mg f (bmFunBind m) }+ go (VarBind _ _ e) = m { bmVarBind = mAlter env vs e f (bmVarBind m) } #endif+ go (PatBind _ lhs rhs _) = m { bmPatBind = mAlter env vs lhs (toA $ mAlter env vs rhs f) (bmPatBind m) } go AbsBinds{} = missingSyntax "AbsBinds"@@ -1105,15 +1008,14 @@ mMatch _ _ (_,BMEmpty) = [] mMatch env b (hs,m@BM{}) = go b (hs,m) where-#if __GLASGOW_HASKELL__ < 806- go (FunBind _ mg _ _ _) = mapFor bmFunBind >=> mMatch env mg- go (VarBind _ e _) = mapFor bmVarBind >=> mMatch env e- go (PatBind lhs rhs _ _ _)-#else- go (FunBind _ _ mg _ _) = mapFor bmFunBind >=> mMatch env mg+#if __GLASGOW_HASKELL__ < 900+ go (FunBind _ _ mg _ _) = mapFor bmFunBind >=> mMatch env mg go (VarBind _ _ e _) = mapFor bmVarBind >=> mMatch env e- go (PatBind _ lhs rhs _)+#else+ go (FunBind _ _ mg _) = mapFor bmFunBind >=> mMatch env mg+ go (VarBind _ _ e) = mapFor bmVarBind >=> mMatch env e #endif+ go (PatBind _ lhs rhs _) = mapFor bmPatBind >=> mMatch env lhs >=> mMatch env rhs go _ = const [] -- TODO @@ -1150,15 +1052,13 @@ mAlter env vs s f SMEmpty = mAlter env vs s f emptySMapWrapper mAlter env vs s f m@(SM {}) = go (unLoc s) where-#if __GLASGOW_HASKELL__ < 806- go (BodyStmt e _ _ _) = m { smBodyStmt = mAlter env vs e f (smBodyStmt m) }- go (LastStmt e _ _) = m { smLastStmt = mAlter env vs e f (smLastStmt m) }- go (BindStmt p e _ _ _) =-#else go (BodyStmt _ e _ _) = m { smBodyStmt = mAlter env vs e f (smBodyStmt m) } go (LastStmt _ e _ _) = m { smLastStmt = mAlter env vs e f (smLastStmt m) }+#if __GLASGOW_HASKELL__ < 900 go XStmtLR{} = missingSyntax "XStmtLR" go (BindStmt _ p e _ _) =+#else+ go (BindStmt _ p e) = #endif let bs = collectPatBinders p env' = foldr extendAlphaEnvInternal env bs@@ -1175,14 +1075,12 @@ mMatch _ _ (_,SMEmpty) = [] mMatch env s (hs,m) = go (unLoc s) (hs,m) where-#if __GLASGOW_HASKELL__ < 806- go (BodyStmt e _ _ _) = mapFor smBodyStmt >=> mMatch env e- go (LastStmt e _ _) = mapFor smLastStmt >=> mMatch env e- go (BindStmt p e _ _ _) =-#else go (BodyStmt _ e _ _) = mapFor smBodyStmt >=> mMatch env e go (LastStmt _ e _ _) = mapFor smLastStmt >=> mMatch env e+#if __GLASGOW_HASKELL__ < 900 go (BindStmt _ p e _ _) =+#else+ go (BindStmt _ p e) = #endif let bs = collectPatBinders p env' = extendMatchEnv env bs@@ -1196,9 +1094,6 @@ | TM { tyHole :: Map RdrName a -- See Note [Holes] , tyHsTyVar :: VMap a , tyHsAppTy :: TyMap (TyMap a)-#if __GLASGOW_HASKELL__ < 806- , tyHsAppsTy :: ListMap AppTyMap a-#endif #if __GLASGOW_HASKELL__ < 810 , tyHsForAllTy :: ForAllTyMap a -- See Note [Telescope] #else@@ -1217,9 +1112,6 @@ emptyTyMapWrapper :: TyMap a emptyTyMapWrapper = TM mEmpty mEmpty mEmpty-#if __GLASGOW_HASKELL__ < 806- mEmpty-#endif mEmpty mEmpty mEmpty mEmpty mEmpty mEmpty mEmpty instance PatternMap TyMap where@@ -1235,9 +1127,6 @@ { tyHole = unionOn tyHole m1 m2 , tyHsTyVar = unionOn tyHsTyVar m1 m2 , tyHsAppTy = unionOn tyHsAppTy m1 m2-#if __GLASGOW_HASKELL__ < 806- , tyHsAppsTy = unionOn tyHsAppsTy m1 m2-#endif , tyHsForAllTy = unionOn tyHsForAllTy m1 m2 , tyHsFunTy = unionOn tyHsFunTy m1 m2 , tyHsListTy = unionOn tyHsListTy m1 m2@@ -1249,18 +1138,10 @@ mAlter :: AlphaEnv -> Quantifiers -> Key TyMap -> A a -> TyMap a -> TyMap a mAlter env vs ty f TyEmpty = mAlter env vs ty f emptyTyMapWrapper-#if __GLASGOW_HASKELL__ < 806- mAlter env vs (tyLookThrough -> ty) f m@(TM {}) =-#else mAlter env vs ty f m@(TM {}) =-#endif go (unLoc ty) -- See Note [TyVar Quantifiers] where-#if __GLASGOW_HASKELL__ < 806- go (HsTyVar _ (L _ v))-#else go (HsTyVar _ _ (L _ v))-#endif | v `isQ` vs = m { tyHole = mAlter env vs v f (tyHole m) } | otherwise = m { tyHsTyVar = mAlter env vs v f (tyHsTyVar m) } go HsOpTy{} = missingSyntax "HsOpTy"@@ -1270,30 +1151,21 @@ go HsDocTy{} = missingSyntax "HsDocTy" go HsBangTy{} = missingSyntax "HsBangTy" go HsRecTy{} = missingSyntax "HsRecTy"-#if __GLASGOW_HASKELL__ < 806- go (HsAppsTy atys) = m { tyHsAppsTy = mAlter env vs atys f (tyHsAppsTy m) }- go (HsAppTy ty1 ty2) = m { tyHsAppTy = mAlter env vs ty1 (toA (mAlter env vs ty2 f)) (tyHsAppTy m) }- go (HsCoreTy _) = missingSyntax "HsCoreTy"- go (HsEqTy _ _) = missingSyntax "HsEqTy"- go (HsForAllTy bndrs ty') = m { tyHsForAllTy = mAlter env vs (bndrs, ty') f (tyHsForAllTy m) }- go (HsFunTy ty1 ty2) = m { tyHsFunTy = mAlter env vs ty1 (toA (mAlter env vs ty2 f)) (tyHsFunTy m) }- go (HsListTy ty') = m { tyHsListTy = mAlter env vs ty' f (tyHsListTy m) }- go (HsParTy ty') = m { tyHsParTy = mAlter env vs ty' f (tyHsParTy m) }- go (HsPArrTy _) = missingSyntax "HsPArrTy"- go (HsQualTy (L _ cons) ty') =- m { tyHsQualTy = mAlter env vs ty' (toA (mAlter env vs cons f)) (tyHsQualTy m) }- go (HsSumTy tys) = m { tyHsSumTy = mAlter env vs tys f (tyHsSumTy m) }- go (HsTupleTy ts tys) =- m { tyHsTupleTy = mAlter env vs ts (toA (mAlter env vs tys f)) (tyHsTupleTy m) }-#else go (HsAppTy _ ty1 ty2) = m { tyHsAppTy = mAlter env vs ty1 (toA (mAlter env vs ty2 f)) (tyHsAppTy m) } #if __GLASGOW_HASKELL__ < 810- go (HsForAllTy _ bndrs ty') = m { tyHsForAllTy = mAlter env vs (bndrs, ty') f (tyHsForAllTy m) }-#else+ go (HsForAllTy _ bndrs ty') = m { tyHsForAllTy = mAlter env vs (map extractBinderInfo bndrs, ty') f (tyHsForAllTy m) }+#elif __GLASGOW_HASKELL__ < 900 go (HsForAllTy _ vis bndrs ty') =- m { tyHsForAllTy = mAlter env vs vis (toA (mAlter env vs (bndrs, ty') f)) (tyHsForAllTy m) }+ m { tyHsForAllTy = mAlter env vs (vis == ForallVis) (toA (mAlter env vs (map extractBinderInfo bndrs, ty') f)) (tyHsForAllTy m) }+#else+ go (HsForAllTy _ vis ty') | (isVisible, bndrs) <- splitVisBinders vis =+ m { tyHsForAllTy = mAlter env vs isVisible (toA (mAlter env vs (bndrs, ty') f)) (tyHsForAllTy m) } #endif+#if __GLASGOW_HASKELL__ < 900 go (HsFunTy _ ty1 ty2) = m { tyHsFunTy = mAlter env vs ty1 (toA (mAlter env vs ty2 f)) (tyHsFunTy m) }+#else+ go (HsFunTy _ _ ty1 ty2) = m { tyHsFunTy = mAlter env vs ty1 (toA (mAlter env vs ty2 f)) (tyHsFunTy m) }+#endif go (HsListTy _ ty') = m { tyHsListTy = mAlter env vs ty' f (tyHsListTy m) } go (HsParTy _ ty') = m { tyHsParTy = mAlter env vs ty' f (tyHsParTy m) } go (HsQualTy _ (L _ cons) ty') =@@ -1303,110 +1175,60 @@ go (HsTupleTy _ ts tys) = m { tyHsTupleTy = mAlter env vs ts (toA (mAlter env vs tys f)) (tyHsTupleTy m) } go XHsType{} = missingSyntax "XHsType"-#endif go HsExplicitListTy{} = missingSyntax "HsExplicitListTy" go HsExplicitTupleTy{} = missingSyntax "HsExplicitTupleTy" go HsTyLit{} = missingSyntax "HsTyLit" go HsWildCardTy{} = missingSyntax "HsWildCardTy"-#if __GLASGOW_HASKELL__ < 808-#else go HsAppKindTy{} = missingSyntax "HsAppKindTy"-#endif mMatch :: MatchEnv -> Key TyMap -> (Substitution, TyMap a) -> [(Substitution, a)] mMatch _ _ (_,TyEmpty) = []-#if __GLASGOW_HASKELL__ < 806- mMatch env (tyLookThrough -> ty) (hs,m@TM{}) =-#else mMatch env ty (hs,m@TM{}) =-#endif hss ++ go (unLoc ty) (hs,m) -- See Note [TyVar Quantifiers] where hss = extendResult (tyHole m) (HoleType $ mePruneA env ty) hs -#if __GLASGOW_HASKELL__ < 806- go (HsAppTy ty1 ty2) = mapFor tyHsAppTy >=> mMatch env ty1 >=> mMatch env ty2- go (HsAppsTy atys) = mapFor tyHsAppsTy >=> mMatch env atys- go (HsForAllTy bndrs ty') = mapFor tyHsForAllTy >=> mMatch env (bndrs, ty')- go (HsFunTy ty1 ty2) = mapFor tyHsFunTy >=> mMatch env ty1 >=> mMatch env ty2- go (HsListTy ty') = mapFor tyHsListTy >=> mMatch env ty'- go (HsParTy ty') = mapFor tyHsParTy >=> mMatch env ty'- go (HsQualTy (L _ cons) ty') = mapFor tyHsQualTy >=> mMatch env ty' >=> mMatch env cons- go (HsSumTy tys) = mapFor tyHsSumTy >=> mMatch env tys- go (HsTupleTy ts tys) = mapFor tyHsTupleTy >=> mMatch env ts >=> mMatch env tys- go (HsTyVar _ v) = mapFor tyHsTyVar >=> mMatch env (unLoc v)-#else go (HsAppTy _ ty1 ty2) = mapFor tyHsAppTy >=> mMatch env ty1 >=> mMatch env ty2 #if __GLASGOW_HASKELL__ < 810- go (HsForAllTy _ bndrs ty') = mapFor tyHsForAllTy >=> mMatch env (bndrs, ty')-#else+ go (HsForAllTy _ bndrs ty') = mapFor tyHsForAllTy >=> mMatch env (map extractBinderInfo bndrs, ty')+#elif __GLASGOW_HASKELL__ < 900 go (HsForAllTy _ vis bndrs ty') =- mapFor tyHsForAllTy >=> mMatch env vis >=> mMatch env (bndrs, ty')+ mapFor tyHsForAllTy >=> mMatch env (vis == ForallVis) >=> mMatch env (map extractBinderInfo bndrs, ty')+#else+ go (HsForAllTy _ telescope ty') | (isVisible, bndrs) <- splitVisBinders telescope =+ mapFor tyHsForAllTy >=> mMatch env isVisible >=> mMatch env (bndrs, ty') #endif+#if __GLASGOW_HASKELL__ < 900 go (HsFunTy _ ty1 ty2) = mapFor tyHsFunTy >=> mMatch env ty1 >=> mMatch env ty2+#else+ go (HsFunTy _ _ ty1 ty2) = mapFor tyHsFunTy >=> mMatch env ty1 >=> mMatch env ty2+#endif go (HsListTy _ ty') = mapFor tyHsListTy >=> mMatch env ty' go (HsParTy _ ty') = mapFor tyHsParTy >=> mMatch env ty' go (HsQualTy _ (L _ cons) ty') = mapFor tyHsQualTy >=> mMatch env ty' >=> mMatch env cons go (HsSumTy _ tys) = mapFor tyHsSumTy >=> mMatch env tys go (HsTupleTy _ ts tys) = mapFor tyHsTupleTy >=> mMatch env ts >=> mMatch env tys go (HsTyVar _ _ v) = mapFor tyHsTyVar >=> mMatch env (unLoc v)-#endif go _ = const [] -- TODO -#if __GLASGOW_HASKELL__ < 806--- Note [TyVar Quantifiers]------ GHC parses a tycon app as a list of types (Maybe Int becomes [Maybe, Int]).--- A nullary tycon app becomes a singleton list, and a tyvar is treated as a--- a nullary tycon. Quantifiers are tyvars, so they'll be rigidly buried in--- singleton lists, meaning 'a' cannot match with 'Maybe Int' because [a]--- will not unify with [Maybe, Int]. Singleton tycons suffer the same problem.--- [Foo] will not match with [Maybe, Foo] when unfolding Foo. To solve this,--- we 'look through' such singleton lists.--tyLookThrough :: Key TyMap -> Key TyMap-tyLookThrough (L _ (HsAppsTy [L _ (HsAppPrefix ty)])) = ty-tyLookThrough ty = ty----------------------------------------------------------------------------data AppTyMap a- = AppTyEmpty- | ATM { atmAppInfix :: VMap a- , atmAppPrefix :: TyMap a- }- deriving (Functor)--emptyAppTyMapWrapper :: AppTyMap a-emptyAppTyMapWrapper = ATM mEmpty mEmpty--instance PatternMap AppTyMap where- type Key AppTyMap = LHsAppType GhcPs-- mEmpty :: AppTyMap a- mEmpty = AppTyEmpty-- mUnion :: AppTyMap a -> AppTyMap a -> AppTyMap a- mUnion AppTyEmpty m = m- mUnion m AppTyEmpty = m- mUnion m1 m2 = ATM- { atmAppInfix = unionOn atmAppInfix m1 m2- , atmAppPrefix = unionOn atmAppPrefix m1 m2- }-- mAlter :: AlphaEnv -> Quantifiers -> Key AppTyMap -> A a -> AppTyMap a -> AppTyMap a- mAlter env vs aty f AppTyEmpty = mAlter env vs aty f emptyAppTyMapWrapper- mAlter env vs aty f m@(ATM {}) = go (unLoc aty)- where- go (HsAppInfix r) = m { atmAppInfix = mAlter env vs (unLoc r) f (atmAppInfix m) }- go (HsAppPrefix ty) = m { atmAppPrefix = mAlter env vs ty f (atmAppPrefix m) }+#if __GLASGOW_HASKELL__ < 900+extractBinderInfo :: LHsTyVarBndr GhcPs -> (RdrName, Maybe (LHsKind GhcPs))+extractBinderInfo = go . unLoc+ where+ go (UserTyVar _ v) = (unLoc v, Nothing)+ go (KindedTyVar _ v k) = (unLoc v, Just k)+ go XTyVarBndr{} = missingSyntax "XTyVarBndr"+#else+splitVisBinders :: HsForAllTelescope GhcPs -> (Bool, [(RdrName, Maybe (LHsKind GhcPs))])+splitVisBinders HsForAllVis{..} = (True, map extractBinderInfo hsf_vis_bndrs)+splitVisBinders HsForAllInvis{..} = (False, map extractBinderInfo hsf_invis_bndrs) - mMatch :: MatchEnv -> Key AppTyMap -> (Substitution, AppTyMap a) -> [(Substitution, a)]- mMatch _ _ (_,AppTyEmpty) = []- mMatch env aty (hs,m@ATM{}) = go (unLoc aty) (hs,m)- where- go (HsAppInfix r) = mapFor atmAppInfix >=> mMatch env (unLoc r)- go (HsAppPrefix ty) = mapFor atmAppPrefix >=> mMatch env ty+extractBinderInfo :: LHsTyVarBndr flag GhcPs -> (RdrName, Maybe (LHsKind GhcPs))+extractBinderInfo = go . unLoc+ where+ go (UserTyVar _ _ v) = (unLoc v, Nothing)+ go (KindedTyVar _ _ v k) = (unLoc v, Just k)+ go XTyVarBndr{} = missingSyntax "XTyVarBndr" #endif ------------------------------------------------------------------------@@ -1441,11 +1263,7 @@ class RecordFieldToRdrName f where recordFieldToRdrName :: f -> RdrName -#if __GLASGOW_HASKELL__ < 806-instance RecordFieldToRdrName (AmbiguousFieldOcc p) where-#else instance RecordFieldToRdrName (AmbiguousFieldOcc GhcPs) where-#endif recordFieldToRdrName = rdrNameAmbiguousFieldOcc instance RecordFieldToRdrName (FieldOcc p) where@@ -1517,7 +1335,7 @@ deriving (Functor) instance PatternMap ForAllTyMap where- type Key ForAllTyMap = ([LHsTyVarBndr GhcPs], LHsType GhcPs)+ type Key ForAllTyMap = ([(RdrName, Maybe (LHsKind GhcPs))], LHsType GhcPs) mEmpty :: ForAllTyMap a mEmpty = ForAllTyMap mEmpty mEmpty mEmpty@@ -1531,71 +1349,38 @@ mAlter :: AlphaEnv -> Quantifiers -> Key ForAllTyMap -> A a -> ForAllTyMap a -> ForAllTyMap a mAlter env vs ([], ty) f m = m { fatNil = mAlter env vs ty f (fatNil m) }-#if __GLASGOW_HASKELL__ < 806- mAlter env vs (L _ (UserTyVar (L _ v)):rest, ty) f m =-#else- mAlter env vs (L _ (UserTyVar _ (L _ v)):rest, ty) f m =-#endif- let- env' = extendAlphaEnvInternal v env- vs' = vs `exceptQ` [v]- in m { fatUser = mAlter env' vs' (rest, ty) f (fatUser m) }-#if __GLASGOW_HASKELL__ < 806- mAlter env vs (L _ (KindedTyVar (L _ v) k):rest, ty) f m =-#else- mAlter _ _ (L _ (XTyVarBndr _):_,_) _ _ = missingSyntax "XTyVarBndr"- mAlter env vs (L _ (KindedTyVar _ (L _ v) k):rest, ty) f m =-#endif- let+ mAlter env vs ((v,mbK):rest, ty) f m+ | Just k <- mbK = m { fatKinded = mAlter env vs k (toA (mAlter env' vs' (rest, ty) f)) (fatKinded m) }+ | otherwise = m { fatUser = mAlter env' vs' (rest, ty) f (fatUser m) }+ where env' = extendAlphaEnvInternal v env vs' = vs `exceptQ` [v]- in m { fatKinded = mAlter env vs k (toA (mAlter env' vs' (rest, ty) f)) (fatKinded m) } mMatch :: MatchEnv -> Key ForAllTyMap -> (Substitution, ForAllTyMap a) -> [(Substitution, a)] mMatch env ([],ty) = mapFor fatNil >=> mMatch env ty-#if __GLASGOW_HASKELL__ < 806- mMatch env (L _ (UserTyVar (L _ v)):rest, ty) =-#else- mMatch env (L _ (UserTyVar _ (L _ v)):rest, ty) =-#endif- let env' = extendMatchEnv env [v]- in mapFor fatUser >=> mMatch env' (rest, ty)-#if __GLASGOW_HASKELL__ < 806- mMatch env (L _ (KindedTyVar (L _ v) k):rest, ty) =-#else- mMatch _ (L _ (XTyVarBndr _):_,_) = const []- mMatch env (L _ (KindedTyVar _ (L _ v) k):rest, ty) =-#endif- let env' = extendMatchEnv env [v]- in mapFor fatKinded >=> mMatch env k >=> mMatch env' (rest, ty)+ mMatch env ((v,mbK):rest, ty)+ | Just k <- mbK = mapFor fatKinded >=> mMatch env k >=> mMatch env' (rest, ty)+ | otherwise = mapFor fatUser >=> mMatch env' (rest, ty)+ where+ env' = extendMatchEnv env [v] #if __GLASGOW_HASKELL__ < 810 #else-data ForallVisMap a = ForallVisMap- { favVis :: MaybeMap a- , favInvis :: MaybeMap a- }+newtype ForallVisMap a = ForallVisMap { favBoolMap :: BoolMap a } deriving (Functor) instance PatternMap ForallVisMap where- type Key ForallVisMap = ForallVisFlag+ type Key ForallVisMap = Bool mEmpty :: ForallVisMap a- mEmpty = ForallVisMap mEmpty mEmpty+ mEmpty = ForallVisMap mEmpty mUnion :: ForallVisMap a -> ForallVisMap a -> ForallVisMap a- mUnion m1 m2 = ForallVisMap- { favVis = unionOn favVis m1 m2- , favInvis = unionOn favInvis m1 m2- }+ mUnion m1 m2 = ForallVisMap (unionOn favBoolMap m1 m2) mAlter :: AlphaEnv -> Quantifiers -> Key ForallVisMap -> A a -> ForallVisMap a -> ForallVisMap a- mAlter env vs ForallVis f m =- m { favVis = mAlter env vs () f (favVis m) }- mAlter env vs ForallInvis f m =- m { favInvis = mAlter env vs () f (favInvis m) }+ mAlter env vs k f (ForallVisMap m) = ForallVisMap $ mAlter env vs k f m mMatch :: MatchEnv -> Key ForallVisMap -> (Substitution, ForallVisMap a) -> [(Substitution, a)]- mMatch env ForallVis = mapFor favVis >=> mMatch env ()- mMatch env ForallInvis = mapFor favInvis >=> mMatch env ()+ mMatch env b = mapFor favBoolMap >=> mMatch env b #endif
Retrie/Pretty.hs view
@@ -3,6 +3,7 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} module Retrie.Pretty ( noColor , addColor@@ -37,7 +38,11 @@ ppSrcSpan :: ColoriseFun -> SrcSpan -> String ppSrcSpan colorise spn = case srcSpanStart spn of UnhelpfulLoc x -> unpackFS x+#if __GLASGOW_HASKELL__ < 900 RealSrcLoc loc -> intercalate (colorise Dull Cyan ":")+#else+ RealSrcLoc loc _ -> intercalate (colorise Dull Cyan ":")+#endif [ colorise Dull Magenta $ unpackFS $ srcLocFile loc , colorise Dull Green $ show $ srcLocLine loc , colorise Dull Green $ show $ srcLocCol loc@@ -62,10 +67,6 @@ -- | Return HashMap from line number to line of a file. linesMap :: String -> IO (HashMap.HashMap Int String) linesMap fp = HashMap.fromList . zip [1..] . lines <$> readFile fp--getRealLoc :: SrcLoc -> Maybe RealSrcLoc-getRealLoc (RealSrcLoc x) = Just x-getRealLoc _ = Nothing strip :: String -> String strip = dropWhileEnd isSpace . dropWhile isSpace
Retrie/Replace.hs view
@@ -3,7 +3,6 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. ---{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -36,7 +35,15 @@ mkM (replaceImpl @(HsExpr GhcPs) c) `extM` (replaceImpl @(Stmt GhcPs (LHsExpr GhcPs)) c) `extM` (replaceImpl @(HsType GhcPs) c)+ `extM` replacePat c +replacePat :: MonadIO m => Context -> LPat GhcPs -> TransformT (WriterT Change m) (LPat GhcPs)+-- We need to ensure we have a location available at the top level so we can+-- transfer annotations. This ensures we don't try to rewrite a naked Pat.+replacePat c p+ | Just lp <- dLPat p = cLPat <$> replaceImpl c lp+ | otherwise = return p+ -- | Generic replacement function. This is the thing that actually runs the -- 'Rewriter' carried by the context, instantiates templates, handles parens -- and other whitespace bookkeeping, and emits resulting 'Replacement's.@@ -70,7 +77,7 @@ -- copy appropriate annotations from old expression to template addAllAnnsT e r -- add parens to template if needed- res <- (mkM (parenify c) `extM` parenifyT c) r+ res <- (mkM (parenify c) `extM` parenifyT c `extM` parenifyP c) r -- prune the resulting expression and log it with location orig <- printNoLeadingSpaces <$> pruneA e repl <- printNoLeadingSpaces <$> pruneA res@@ -108,23 +115,7 @@ -- of the parens, not the inner expression, so we have to -- keep both expressions around. getUnparened :: Data k => k -> k-getUnparened = mkT e `extT` t- where- e :: LHsExpr GhcPs -> LHsExpr GhcPs-#if __GLASGOW_HASKELL__ < 806- e (L _ (HsPar expr)) = expr-#else- e (L _ (HsPar _ expr)) = expr-#endif- e other = other-- t :: LHsType GhcPs -> LHsType GhcPs-#if __GLASGOW_HASKELL__ < 806- t (L _ (HsParTy ty)) = ty-#else- t (L _ (HsParTy _ ty)) = ty-#endif- t other = other+getUnparened = mkT unparen `extT` unparenT `extT` unparenP -- The location of 'e' accurately points to the first non-space character -- of 'e', but when we exactprint 'e', we might get some leading spaces (if
Retrie/Rewrites.hs view
@@ -1,8 +1,10 @@+{-# LANGUAGE RecordWildCards #-} -- Copyright (c) Facebook, Inc. and its affiliates. -- -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Retrie.Rewrites ( RewriteSpec(..)@@ -13,8 +15,8 @@ ) where import Control.Exception-import Data.Either (partitionEithers) import qualified Data.Map as Map+import Data.Maybe import qualified Data.Text as Text import Data.Traversable import System.FilePath@@ -24,6 +26,7 @@ import Retrie.Fixity import Retrie.GHC import Retrie.Rewrites.Function+import Retrie.Rewrites.Patterns import Retrie.Rewrites.Rules import Retrie.Rewrites.Types import Retrie.Types@@ -37,6 +40,10 @@ = Adhoc String -- ^ Equation in RULES-format. (e.g. @"forall x. succ (pred x) = x"@) -- Will be applied left-to-right.+ | AdhocPattern String+ -- ^ Equation in pattern-synonym format, _without_ the keyword 'pattern'.+ | AdhocType String+ -- ^ Equation in type-synonym format, _without_ the keyword 'type'. | Fold QualifiedName -- ^ Fold a function definition. The inverse of unfolding/inlining. -- Replaces instances of the function body with calls to the function.@@ -50,34 +57,63 @@ -- ^ Apply a type synonym left-to-right. | Unfold QualifiedName -- ^ Unfold, or inline, a function definition.+ | PatternForward QualifiedName+ -- ^ Unfold a pattern synonym+ | PatternBackward QualifiedName+ -- ^ Fold a pattern synonym, replacing instances of the rhs with the synonym ++data ClassifiedRewrites = ClassifiedRewrites+ { adhocRules :: [String]+ , adhocPatterns :: [String]+ , adhocTypes :: [String]+ , fileBased :: [(FilePath, [(FileBasedTy,[(FastString, Direction)])])]+ }++instance Monoid ClassifiedRewrites where+ mempty = ClassifiedRewrites [] [] [] []++instance Semigroup ClassifiedRewrites where+ ClassifiedRewrites a b c d <> ClassifiedRewrites a' b' c' d' =+ ClassifiedRewrites (a <> a') (b <> b') (c <> c') (d <> d')+ parseRewriteSpecs :: (FilePath -> IO (CPP AnnotatedModule)) -> FixityEnv -> [RewriteSpec] -> IO [Rewrite Universe] parseRewriteSpecs parser fixityEnv specs = do- (adhocs, fileBased) <- partitionEithers <$> sequence+ ClassifiedRewrites{..} <- mconcat <$> sequence [ case spec of- Adhoc rule -> return $ Left rule+ Adhoc rule -> return mempty{adhocRules = [rule]}+ AdhocPattern pSyn -> return mempty{adhocPatterns = [pSyn]}+ AdhocType tySyn -> return mempty{adhocTypes = [tySyn]} Fold name -> mkFileBased FoldUnfold RightToLeft name RuleBackward name -> mkFileBased Rule RightToLeft name RuleForward name -> mkFileBased Rule LeftToRight name TypeBackward name -> mkFileBased Type RightToLeft name TypeForward name -> mkFileBased Type LeftToRight name+ PatternBackward name -> mkFileBased Pattern RightToLeft name+ PatternForward name -> mkFileBased Pattern LeftToRight name Unfold name -> mkFileBased FoldUnfold LeftToRight name | spec <- specs ] fbRewrites <- parseFileBased parser fileBased- adhocRewrites <- parseAdhocs fixityEnv adhocs- return $ fbRewrites ++ adhocRewrites+ adhocExpressionRewrites <- parseAdhocs fixityEnv adhocRules+ adhocTypeRewrites <- parseAdhocTypes fixityEnv adhocTypes+ adhocPatternRewrites <- parseAdhocPatterns fixityEnv adhocPatterns+ return $+ fbRewrites +++ adhocExpressionRewrites +++ adhocTypeRewrites +++ adhocPatternRewrites where mkFileBased ty dir name = case parseQualified name of Left err -> throwIO $ ErrorCall $ "parseRewriteSpecs: " ++ err- Right (fp, fs) -> return $ Right (fp, [(ty, [(fs, dir)])])+ Right (fp, fs) -> return mempty{fileBased = [(fp, [(ty, [(fs, dir)])])]} -data FileBasedTy = FoldUnfold | Rule | Type+data FileBasedTy = FoldUnfold | Rule | Type | Pattern deriving (Eq, Ord) parseFileBased@@ -118,6 +154,35 @@ , let nm = "adhoc" ++ show (i::Int) ] +parseAdhocTypes :: FixityEnv -> [String] -> IO [Rewrite Universe]+parseAdhocTypes _ [] = return []+parseAdhocTypes fixities tySyns = do+ print adhocTySyns+ cpp <-+ parseCPP (parseContent fixities "parseAdhocTypes") (Text.unlines adhocTySyns)+ constructRewrites cpp Type adhocSpecs+ where+ (adhocSpecs, adhocTySyns) = unzip+ [ ( (mkFastString nm, LeftToRight), "type " <> Text.pack s)+ | s <- tySyns+ , Just nm <- [listToMaybe $ words s]+ ]++parseAdhocPatterns :: FixityEnv -> [String] -> IO [Rewrite Universe]+parseAdhocPatterns _ [] = return []+parseAdhocPatterns fixities patSyns = do+ cpp <-+ parseCPP (parseContent fixities "parseAdhocPatterns")+ (Text.unlines $ pragma : adhocPatSyns)+ constructRewrites cpp Pattern adhocSpecs+ where+ pragma = "{-# LANGUAGE PatternSynonyms #-}"+ (adhocSpecs, adhocPatSyns) = unzip+ [ ( (mkFastString nm, LeftToRight), "pattern " <> Text.pack s)+ | s <- patSyns+ , Just nm <- [listToMaybe $ words s]+ ]+ constructRewrites :: CPP AnnotatedModule -> FileBasedTy@@ -131,6 +196,7 @@ nameOf FoldUnfold = "definition" nameOf Rule = "rule" nameOf Type = "type synonym"+ nameOf Pattern = "pattern synonym" m = foldr (plusUFM_C (++)) emptyUFM cppM @@ -144,12 +210,21 @@ :: FileBasedTy -> [(FastString, Direction)] -> AnnotatedModule+#if __GLASGOW_HASKELL__ < 900 -> IO (UniqFM [Rewrite Universe])+#else+ -> IO (UniqFM FastString [Rewrite Universe])+#endif tyBuilder FoldUnfold specs am = promote <$> dfnsToRewrites specs am tyBuilder Rule specs am = promote <$> rulesToRewrites specs am tyBuilder Type specs am = promote <$> typeSynonymsToRewrites specs am+tyBuilder Pattern specs am = patternSynonymsToRewrites specs am +#if __GLASGOW_HASKELL__ < 900 promote :: Matchable a => UniqFM [Rewrite a] -> UniqFM [Rewrite Universe]+#else+promote :: Matchable a => UniqFM k [Rewrite a] -> UniqFM k [Rewrite Universe]+#endif promote = fmap (map toURewrite) parseQualified :: String -> Either String (FilePath, FastString)
Retrie/Rewrites/Function.hs view
@@ -5,7 +5,11 @@ -- {-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-}-module Retrie.Rewrites.Function (dfnsToRewrites) where+module Retrie.Rewrites.Function+ ( dfnsToRewrites+ , getImports+ , matchToRewrites+ ) where import Control.Monad import Control.Monad.State.Lazy@@ -22,7 +26,11 @@ dfnsToRewrites :: [(FastString, Direction)] -> AnnotatedModule+#if __GLASGOW_HASKELL__ < 900 -> IO (UniqFM [Rewrite (LHsExpr GhcPs)])+#else+ -> IO (UniqFM FastString [Rewrite (LHsExpr GhcPs)])+#endif dfnsToRewrites specs am = fmap astA $ transformA am $ \ (L _ m) -> do let fsMap = uniqBag specs@@ -33,11 +41,7 @@ imps <- getImports dir (hsmodName m) (fName,) . concat <$> forM (unLoc $ mg_alts $ fun_matches f) (matchToRewrites fe imps dir)-#if __GLASGOW_HASKELL__ < 806- | L _ (ValD f@FunBind{}) <- hsmodDecls m-#else | L _ (ValD _ f@FunBind{}) <- hsmodDecls m-#endif , let fRdrName = fun_id f , let fName = occNameFS (occName (unLoc fRdrName)) , dir <- fromMaybe [] (lookupUFM fsMap fName)@@ -76,17 +80,10 @@ where go WildPat{} = True go VarPat{} = True-#if __GLASGOW_HASKELL__ < 806- go (LazyPat p) = irrefutablePat p- go (AsPat _ p) = irrefutablePat p- go (ParPat p) = irrefutablePat p- go (BangPat p) = irrefutablePat p-#else go (LazyPat _ p) = irrefutablePat p go (AsPat _ _ p) = irrefutablePat p go (ParPat _ p) = irrefutablePat p go (BangPat _ p) = irrefutablePat p-#endif go _ = False makeFunctionQuery@@ -101,11 +98,7 @@ | any (not . irrefutablePat) bndpats = return [] | otherwise = do let-#if __GLASGOW_HASKELL__ < 806- GRHSs rhss lbs = grhss-#else GRHSs _ rhss lbs = grhss-#endif bs = collectPatsBinders argpats -- See Note [Wildcards] (es,(_,bs')) <- runStateT (mapM patToExpr argpats) (wildSupply bs, bs)@@ -132,16 +125,6 @@ backtickRules e imps dir@LeftToRight grhss ps@[p1, p2] = do let both, left, right :: AppBuilder-#if __GLASGOW_HASKELL__ < 806- both op [l, r] = mkLoc (OpApp l op PlaceHolder r)- both _ _ = fail "backtickRules - both: impossible!"-- left op [l] = mkLoc (SectionL l op)- left _ _ = fail "backtickRules - left: impossible!"-- right op [r] = mkLoc (SectionR op r)- right _ _ = fail "backtickRules - right: impossible!"-#else both op [l, r] = mkLoc (OpApp noExtField l op r) both _ _ = fail "backtickRules - both: impossible!" @@ -150,7 +133,6 @@ right op [r] = mkLoc (SectionR noExtField op r) right _ _ = fail "backtickRules - right: impossible!"-#endif qs <- makeFunctionQuery e imps dir grhss both (ps, []) qsl <- makeFunctionQuery e imps dir grhss left ([p1], [p2]) qsr <- makeFunctionQuery e imps dir grhss right ([p2], [p1])
+ Retrie/Rewrites/Patterns.hs view
@@ -0,0 +1,134 @@+-- Copyright (c) Facebook, Inc. and its affiliates.+--+-- This source code is licensed under the MIT license found in the+-- LICENSE file in the root directory of this source tree.+--+{-# LANGUAGE CPP #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE RecordWildCards #-}+module Retrie.Rewrites.Patterns (patternSynonymsToRewrites) where++import Control.Monad.State (StateT(runStateT))+import Control.Monad+import Data.Maybe++import Retrie.ExactPrint+import Retrie.Expr+import Retrie.GHC+import Retrie.Quantifiers+import Retrie.Rewrites.Function+import Retrie.Types+import Retrie.Universe+import Retrie.Util++patternSynonymsToRewrites+ :: [(FastString, Direction)]+ -> AnnotatedModule+#if __GLASGOW_HASKELL__ < 900+ -> IO (UniqFM [Rewrite Universe])+#else+ -> IO (UniqFM FastString [Rewrite Universe])+#endif+patternSynonymsToRewrites specs am = fmap astA $ transformA am $ \(L _ m) -> do+ let+ fsMap = uniqBag specs+ imports <- getImports RightToLeft (hsmodName m)+ rrs <- sequence+ [ do+ patRewrite <- mkPatRewrite dir imports nm params lrhs+ expRewrites <- mkExpRewrite dir imports nm params rhs patdir+ return (rdr, toURewrite patRewrite : map toURewrite expRewrites)+ | L _ (ValD _ (PatSynBind _ (PSB _ nm params rhs patdir))) <- hsmodDecls m+ , let rdr = rdrFS (unLoc nm)+ , dir <- fromMaybe [] (lookupUFM fsMap rdr)+ , Just lrhs <- [dLPat rhs]+ ]++ return $ listToUFM_C (++) rrs++mkPatRewrite+ :: Direction+ -> AnnotatedImports+ -> LRdrName+ -> HsConDetails LRdrName [RecordPatSynField LRdrName]+ -> Located (Pat GhcPs)+ -> TransformT IO (Rewrite (Located (Pat GhcPs)))+mkPatRewrite dir imports patName params rhs = do+ lhs <- asPat patName params++ (pat, temp) <- case dir of+ LeftToRight -> return (lhs, rhs)+ RightToLeft -> do+ setEntryDPT lhs (DP (0,0))+ -- Patterns from lhs have wonky annotations,+ -- the space will be attached to the name, not to the ConPatIn ast node+ setEntryDPTunderConPatIn lhs (DP (0,0))+ return (rhs, lhs)++ p <- pruneA pat+ t <- pruneA temp+ let bs = collectPatBinders (cLPat temp)+ return $ addRewriteImports imports $ mkRewrite (mkQs bs) p t++ where+ setEntryDPTunderConPatIn+ :: Monad m => Located (Pat GhcPs) -> DeltaPos -> TransformT m ()+#if __GLASGOW_HASKELL__ < 900+ setEntryDPTunderConPatIn (L _ (ConPatIn nm _)) = setEntryDPT nm+#else+ setEntryDPTunderConPatIn (L _ (ConPat _ nm _)) = setEntryDPT nm+#endif+ setEntryDPTunderConPatIn _ = const $ return ()++asPat+ :: Monad m+ => LRdrName+ -> HsConDetails LRdrName [RecordPatSynField LRdrName]+ -> TransformT m (Located (Pat GhcPs))+asPat patName params = do+ params' <- bitraverseHsConDetails mkVarPat convertFields params+ mkConPatIn patName params'+ where++ convertFields fields =+ HsRecFields <$> traverse convertField fields <*> pure Nothing++ convertField RecordPatSynField{..} = do+ hsRecFieldLbl <- mkLoc $ mkFieldOcc recordPatSynSelectorId+ hsRecFieldArg <- mkVarPat recordPatSynPatVar+ let hsRecPun = False+ mkLoc HsRecField{..}+++mkExpRewrite+ :: Direction+ -> AnnotatedImports+ -> LRdrName+ -> HsConDetails LRdrName [RecordPatSynField LRdrName]+ -> LPat GhcPs+ -> HsPatSynDir GhcPs+ -> TransformT IO [Rewrite (LHsExpr GhcPs)]+mkExpRewrite dir imports patName params rhs patDir = do+ fe <- mkLocatedHsVar patName+ let altsFromParams = case params of+ PrefixCon names -> buildMatch names rhs+ InfixCon a1 a2 -> buildMatch [a1, a2] rhs+ RecCon{} -> missingSyntax "RecCon"+ alts <- case patDir of+ ExplicitBidirectional MG{mg_alts} -> pure $ unLoc mg_alts+ ImplicitBidirectional -> altsFromParams+ _ -> pure []+ fmap concat $ forM alts $ matchToRewrites fe imports dir++buildMatch+ :: Monad m+ => [Located (IdP GhcPs)]+ -> LPat GhcPs+ -> TransformT m [LMatch GhcPs (LHsExpr GhcPs)]+buildMatch names rhs = do+ pats <- traverse mkVarPat names+ let bs = collectPatBinders rhs+ (rhsExpr,(_,_bs')) <- runStateT (patToExpr rhs) (wildSupply bs, bs)+ let alt = mkMatch PatSyn pats rhsExpr (noLoc emptyLocalBinds)+ return [alt]
Retrie/Rewrites/Rules.hs view
@@ -3,6 +3,7 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} module Retrie.Rewrites.Rules (rulesToRewrites) where @@ -17,7 +18,11 @@ rulesToRewrites :: [(FastString, Direction)] -> AnnotatedModule+#if __GLASGOW_HASKELL__ < 900 -> IO (UniqFM [Rewrite (LHsExpr GhcPs)])+#else+ -> IO (UniqFM RuleName [Rewrite (LHsExpr GhcPs)])+#endif rulesToRewrites specs am = fmap astA $ transformA am $ \ m -> do let fsMap = uniqBag specs
Retrie/Rewrites/Types.hs view
@@ -21,18 +21,18 @@ typeSynonymsToRewrites :: [(FastString, Direction)] -> AnnotatedModule+#if __GLASGOW_HASKELL__ < 900 -> IO (UniqFM [Rewrite (LHsType GhcPs)])+#else+ -> IO (UniqFM FastString [Rewrite (LHsType GhcPs)])+#endif typeSynonymsToRewrites specs am = fmap astA $ transformA am $ \ m -> do let fsMap = uniqBag specs tySyns = [ (rdr, (dir, (nm, hsq_explicit vars, rhs))) -- only hsq_explicit is available pre-renaming-#if __GLASGOW_HASKELL__ < 806- | L _ (TyClD (SynDecl nm vars _ rhs _)) <- hsmodDecls $ unLoc m-#else | L _ (TyClD _ (SynDecl _ nm vars _ rhs)) <- hsmodDecls $ unLoc m-#endif , let rdr = rdrFS (unLoc nm) , dir <- fromMaybe [] (lookupUFM fsMap rdr) ]@@ -44,7 +44,11 @@ -- | Compile a list of RULES into a list of rewrites. mkTypeRewrite :: Direction+#if __GLASGOW_HASKELL__ < 900 -> (Located RdrName, [LHsTyVarBndr GhcPs], LHsType GhcPs)+#else+ -> (Located RdrName, [LHsTyVarBndr () GhcPs], LHsType GhcPs)+#endif -> TransformT IO (Rewrite (LHsType GhcPs)) mkTypeRewrite d (lhsName, vars, rhs) = do setEntryDPT lhsName $ DP (0,0)
Retrie/Subst.hs view
@@ -49,11 +49,7 @@ => Context -> LHsExpr GhcPs -> TransformT m (LHsExpr GhcPs)-#if __GLASGOW_HASKELL__ < 806-substExpr ctxt e@(L l1 (HsVar (L l2 v))) =-#else substExpr ctxt e@(L l1 (HsVar x (L l2 v))) =-#endif case lookupHoleVar v ctxt of Just (HoleExpr eA) -> do e' <- graftA (unparen <$> eA)@@ -62,11 +58,7 @@ transferAnnsT isComma e e' parenify ctxt e' Just (HoleRdr rdr) ->-#if __GLASGOW_HASKELL__ < 806- return $ L l1 $ HsVar $ L l2 rdr-#else return $ L l1 $ HsVar x $ L l2 rdr-#endif _ -> return e substExpr _ e = return e @@ -75,25 +67,19 @@ => Context -> LPat GhcPs -> TransformT m (LPat GhcPs)-#if __GLASGOW_HASKELL__ < 806-substPat ctxt p@(L l1 (VarPat (L l2 v))) =-#elif __GLASGOW_HASKELL__ < 808-substPat ctxt p@(L l1 (VarPat x (L l2 v))) =-#else-substPat ctxt (dL -> p@(L l1 (VarPat x (dL -> L l2 v)))) =- fmap composeSrcSpan $-#endif+substPat ctxt (dLPat -> Just p@(L l1 (VarPat x vl@(L l2 v)))) = fmap cLPat $ case lookupHoleVar v ctxt of Just (HolePat pA) -> do- p' <- graftA pA+ p' <- graftA (unparenP <$> pA) transferEntryAnnsT isComma p p'- return p'+ -- the relevant entry delta is sometimes attached to+ -- the OccName and not to the VarPat.+ -- This seems to be the case only when the pattern comes from a lhs,+ -- whereas it has no annotations in patterns found in rhs's.+ tryTransferEntryDPT vl p'+ parenifyP ctxt p' Just (HoleRdr rdr) ->-#if __GLASGOW_HASKELL__ < 806- return $ L l1 $ VarPat $ L l2 rdr-#else return $ L l1 $ VarPat x $ L l2 rdr-#endif _ -> return p substPat _ p = return p @@ -116,8 +102,13 @@ substHsMatchContext :: Monad m => Context+#if __GLASGOW_HASKELL__ < 900 -> HsMatchContext RdrName -> TransformT m (HsMatchContext RdrName)+#else+ -> HsMatchContext GhcPs+ -> TransformT m (HsMatchContext GhcPs)+#endif substHsMatchContext ctxt (FunRhs (L l v) f s) | Just (HoleRdr rdr) <- lookupHoleVar v ctxt = return $ FunRhs (L l rdr) f s
Retrie/Substitution.hs view
@@ -3,6 +3,7 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} module Retrie.Substitution ( Substitution , HoleVal(..)@@ -17,7 +18,11 @@ import Retrie.GHC -- | A 'Substitution' is essentially a map from variable name to 'HoleVal'.+#if __GLASGOW_HASKELL__ < 900 newtype Substitution = Substitution (UniqFM (FastString, HoleVal))+#else+newtype Substitution = Substitution (UniqFM FastString (FastString, HoleVal))+#endif -- See Note [Why not RdrNames?] for explanation of use of FastString instance Show Substitution where
Retrie/Types.hs view
@@ -86,6 +86,7 @@ -- | Precedence of parent node in the AST. data ParentPrec = HasPrec Fixity -- ^ Parent has precedence info.+ | IsLhs -- ^ We are a pattern in a left-hand-side | IsHsAppsTy -- ^ Parent is HsAppsTy | NeverParen -- ^ Based on parent, we should never add parentheses.
Retrie/Universe.hs view
@@ -32,6 +32,7 @@ = ULHsExpr (LHsExpr GhcPs) | ULStmt (LStmt GhcPs (LHsExpr GhcPs)) | ULType (LHsType GhcPs)+ | ULPat (Located (Pat GhcPs)) deriving (Data) -- | Exactprint an annotated 'Universe'.@@ -43,6 +44,7 @@ exactPrintU (ULHsExpr e) anns = exactPrint e anns exactPrintU (ULStmt s) anns = exactPrint s anns exactPrintU (ULType t) anns = exactPrint t anns+exactPrintU (ULPat p) anns = exactPrint p anns ------------------------------------------------------------------------------- @@ -64,6 +66,7 @@ getOrigin (ULHsExpr e) = getOrigin e getOrigin (ULStmt s) = getOrigin s getOrigin (ULType t) = getOrigin t+ getOrigin (ULPat p) = getOrigin p instance Matchable (LHsExpr GhcPs) where inject = ULHsExpr@@ -83,6 +86,12 @@ project _ = error "project ULType" getOrigin e = getLoc e +instance Matchable (Located (Pat GhcPs)) where+ inject = ULPat+ project (ULPat p) = p+ project _ = error "project ULPat"+ getOrigin = getLoc+ ------------------------------------------------------------------------------- -- | The pattern map for 'Universe'.@@ -90,6 +99,7 @@ { umExpr :: EMap a , umStmt :: SMap a , umType :: TyMap a+ , umPat :: PatMap a } deriving (Functor) @@ -97,25 +107,27 @@ type Key UMap = Universe mEmpty :: UMap a- mEmpty = UMap mEmpty mEmpty mEmpty+ mEmpty = UMap mEmpty mEmpty mEmpty mEmpty mUnion :: UMap a -> UMap a -> UMap a mUnion m1 m2 = UMap (unionOn umExpr m1 m2) (unionOn umStmt m1 m2) (unionOn umType m1 m2)+ (unionOn umPat m1 m2) mAlter :: AlphaEnv -> Quantifiers -> Universe -> A a -> UMap a -> UMap a mAlter env vs u f m = go u where go (ULHsExpr e) = m { umExpr = mAlter env vs e f (umExpr m) }- go (ULStmt s) = m { umStmt = mAlter env vs s f (umStmt m) }- go (ULType t) = m { umType = mAlter env vs t f (umType m) }+ go (ULStmt s) = m { umStmt = mAlter env vs s f (umStmt m) }+ go (ULType t) = m { umType = mAlter env vs t f (umType m) }+ go (ULPat p) = m { umPat = mAlter env vs (cLPat p) f (umPat m) } mMatch :: MatchEnv -> Universe -> (Substitution, UMap a) -> [(Substitution, a)] mMatch env = go where go (ULHsExpr e) = mapFor umExpr >=> mMatch env e- go (ULStmt s) = mapFor umStmt >=> mMatch env s- go (ULType t) = mapFor umType >=> mMatch env t-+ go (ULStmt s) = mapFor umStmt >=> mMatch env s+ go (ULType t) = mapFor umType >=> mMatch env t+ go (ULPat p) = mapFor umPat >=> mMatch env (cLPat p)
Retrie/Util.hs view
@@ -6,14 +6,17 @@ {-# LANGUAGE ScopedTypeVariables #-} module Retrie.Util where +import Control.Arrow (first) import Control.Applicative import Control.Concurrent.Async import Control.Exception import Control.Monad import Data.List+import qualified Data.Set as Set import System.Exit import System.FilePath import System.Process+import System.IO (hPutStrLn, stderr) data Verbosity = Silent | Normal | Loud deriving (Eq, Ord, Show)@@ -75,23 +78,34 @@ case ec of ExitSuccess -> do let- (ifiles, dirs) = partition hasExtension+ (ifiles, dirs) = first Set.fromList $ partition hasExtension [ normalise $ targetDir </> dropTrailingPathSeparator f | f <- lines fps ] idirs = extraDirs dirs- return $ Just $ \fp -> fp `elem` ifiles || any (`isPrefixOf` fp) idirs+ return $ Just+ $ \fp -> fp `Set.member` ifiles || any (`isPrefixOf` fp) idirs ExitFailure _ -> do- when (verbosity > Normal) $ putStrLn $ prefix ++ err+ when (verbosity > Normal) $ putErrStrLn $ prefix ++ err return Nothing handler :: String -> Verbosity -> IOError -> IO (Maybe a) handler prefix verbosity err = do- when (verbosity > Normal) $ putStrLn $ prefix ++ show err+ when (verbosity > Normal) $ putErrStrLn $ prefix ++ show err return Nothing +putErrStrLn :: String -> IO ()+putErrStrLn = hPutStrLn stderr+ -- | Like 'try', but rethrows async exceptions. trySync :: IO a -> IO (Either SomeException a) trySync io = catch (Right <$> io) $ \e -> case fromException e of Just (_ :: SomeAsyncException) -> throwIO e Nothing -> return (Left e)++missingSyntax :: String -> a+missingSyntax constructor = error $ unlines+ [ "Missing syntax support: " ++ constructor+ , "Please file an issue at https://github.com/facebookincubator/retrie/issues"+ , "with an example of the rewrite you are attempting and we'll add it."+ ]
demo/Main.hs view
@@ -3,7 +3,6 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. ---{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Main where @@ -40,11 +39,7 @@ stringToFooArg _ctxt match | MatchResult substitution template <- match , Just (HoleExpr expr) <- lookupSubst "arg" substitution-#if __GLASGOW_HASKELL__ < 806- , L _ (HsLit (HsString _ str)) <- astA expr = do-#else , L _ (HsLit _ (HsString _ str)) <- astA expr = do-#endif newExpr <- case lookup str argMapping of Nothing -> parseExpr $ "error \"invalid argument: " ++ unpackFS str ++ "\""
retrie.cabal view
@@ -4,7 +4,7 @@ -- LICENSE file in the root directory of this source tree. -- name: retrie-version: 0.1.1.1+version: 1.0.0.0 synopsis: A powerful, easy-to-use codemodding tool for Haskell. homepage: https://github.com/facebookincubator/retrie bug-reports: https://github.com/facebookincubator/retrie/issues@@ -23,7 +23,7 @@ README.md tests/inputs/*.custom tests/inputs/*.test-tested-with: GHC ==8.10.1 || ==8.8.2 || ==8.6.5 || ==8.4.4+tested-with: GHC ==9.0.1 || ==8.10.4 || ==8.8.4 description: Retrie is a tool for codemodding Haskell. Key goals include:@@ -62,6 +62,7 @@ Retrie.Replace, Retrie.Rewrites, Retrie.Rewrites.Function,+ Retrie.Rewrites.Patterns, Retrie.Rewrites.Rules, Retrie.Rewrites.Types, Retrie.Run,@@ -73,18 +74,18 @@ Retrie.Util GHC-Options: -Wall build-depends:- ansi-terminal >= 0.10.3 && < 0.11,+ ansi-terminal >= 0.10.3 && < 0.12, async >= 2.2.2 && < 2.3,- base >= 4.11 && < 4.15,+ base >= 4.11 && < 4.16, bytestring >= 0.10.8 && < 0.11, containers >= 0.5.11 && < 0.7, data-default >= 0.7.1 && < 0.8, directory >= 1.3.1 && < 1.4, filepath >= 1.4.2 && < 1.5,- ghc >= 8.4 && < 8.12,+ ghc >= 8.8 && < 9.2, ghc-exactprint >= 0.6.2 && < 0.7, mtl >= 2.2.2 && < 2.3,- optparse-applicative >= 0.15.1 && < 0.16,+ optparse-applicative >= 0.15.1 && < 0.17, process >= 1.6.3 && < 1.7, random-shuffle >= 0.0.4 && < 0.1, syb >= 0.7.1 && < 0.8,@@ -109,7 +110,7 @@ GHC-Options: -Wall build-depends: retrie,- base >= 4.11 && < 4.15,+ base >= 4.11 && < 4.16, haskell-src-exts >= 1.23.0 && < 1.24 default-language: Haskell2010 @@ -125,7 +126,7 @@ GHC-Options: -Wall build-depends: retrie,- base >= 4.11 && < 4.15,+ base >= 4.11 && < 4.16, haskell-src-exts >= 1.23.0 && < 1.24 default-language: Haskell2010 @@ -152,13 +153,13 @@ build-depends: retrie, HUnit,- base >= 4.11 && < 4.15,+ base >= 4.11 && < 4.16, containers, data-default, deepseq, directory, filepath,- ghc >= 8.4 && < 8.12,+ ghc >= 8.8 && < 9.2, ghc-paths, haskell-src-exts >= 1.23.0 && < 1.24, mtl,
tests/Annotated.hs view
@@ -3,6 +3,7 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. --+{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Annotated (annotatedTest) where@@ -195,19 +196,27 @@ -- expected form. assertExactPrintAnns :: Anns -> Anns -> IO () assertExactPrintAnns annsPreGraft annsPostGraft =- mapM_ (\(AnnKey ss _) -> assertGoodSrcSpan ss) newKeys+ forM_ newKeys $ \(AnnKey ss _) ->+#if __GLASGOW_HASKELL__ < 900+ assertGoodSrcSpan ss+#else+ assertGoodRealSrcSpan ss+#endif where newKeys :: S.Set AnnKey newKeys = M.keysSet annsPostGraft `S.difference` M.keysSet annsPreGraft assertGoodSrcSpan :: SrcSpan -> IO () assertGoodSrcSpan srcSpan =- case srcSpan of- RealSrcSpan rss -> do- assertGoodSrcLoc (realSrcSpanStart rss)- assertGoodSrcLoc (realSrcSpanEnd rss)- UnhelpfulSpan _ ->+ case getRealSpan srcSpan of+ Just rss -> assertGoodRealSrcSpan rss+ Nothing -> assertFailure "only real src spans should be generated"++assertGoodRealSrcSpan :: RealSrcSpan -> IO ()+assertGoodRealSrcSpan rss = do+ assertGoodSrcLoc (realSrcSpanStart rss)+ assertGoodSrcLoc (realSrcSpanEnd rss) assertGoodSrcLoc :: RealSrcLoc -> IO () assertGoodSrcLoc srcLoc = do
tests/Demo.hs view
@@ -3,7 +3,6 @@ -- This source code is licensed under the MIT license found in the -- LICENSE file in the root directory of this source tree. ---{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Demo (stringToFooArg) where @@ -16,11 +15,7 @@ stringToFooArg _ctxt match | MatchResult substitution template <- match , Just (HoleExpr expr) <- lookupSubst "arg" substitution-#if __GLASGOW_HASKELL__ < 806- , L _ (HsLit (HsString _ str)) <- astA expr = do-#else , L _ (HsLit _ (HsString _ str)) <- astA expr = do-#endif newExpr <- case lookup str argMapping of Nothing -> parseExpr $ "error \"invalid argument: " ++ unpackFS str ++ "\""
tests/inputs/Adhoc.test view
@@ -6,6 +6,9 @@ --adhoc "forall f g xs. map f (map g xs) = map (f . g) xs" --adhoc "forall p xs. length (filter p xs) = count p xs" -u Adhoc.foo+--adhoc-type "MyMaybe a = Maybe a"+--adhoc "MyNothing = Nothing"+--adhoc "forall x. MyJust x = Just x" === module Adhoc where @@ -22,3 +25,12 @@ where - zs = map (+1) (map (*3) ys) + zs = map ((+1) . (*3)) ys++ data MyMaybe a = MyNothing | MyJust a++-baz :: Maybe a -> MyMaybe a ++baz :: Maybe a -> Maybe a+-baz Nothing = MyNothing++baz Nothing = Nothing+-baz (Just y) = MyJust y++baz (Just y) = Just y
+ tests/inputs/PatternSyn1.test view
@@ -0,0 +1,55 @@+# Copyright (c) Facebook, Inc. and its affiliates.+#+# This source code is licensed under the MIT license found in the+# LICENSE file in the root directory of this source tree.+#+--pattern-forward PatternSyn1.JustUnit+--pattern-forward PatternSyn1.Some+--pattern-forward PatternSyn1.SomeUni+--pattern-forward PatternSyn1.LeftSomething+--pattern-forward PatternSyn1.JustNot+--adhoc-pattern "SomeAdhoc x = Just x"+--adhoc-pattern "SomeAdhoc2 x <- Just x"+===+ {-# LANGUAGE PatternSynonyms #-}+ {-# LANGUAGE ViewPatterns #-}+ module PatternSyn1 where++ pattern JustUnit = Just ()+ pattern Some x <- Just x where Some x = Just x+ pattern SomeUni x <- Just x+ pattern JustNot x <- Just (not -> x) where JustNot x = Just (not x)+ pattern LeftSomething <- Left _+ pattern SomeAdhoc x = Just x+ pattern SomeAdhoc2 x = Just x++ foo :: Maybe () -> Maybe ()++-foo JustUnit = JustUnit++foo (Just ()) = Just ()++-foo (id -> JustUnit) = JustUnit++foo (id -> Just ()) = Just ()++-foo (Some ()) = Some ()++foo (Just ()) = Just ()++-foo (SomeUni ()) = Just ()++foo (Just ()) = Just ()++-foo (Some x) = let x = Some () in x++foo (Just x) = let x = Just () in x++-foo (SomeAdhoc ()) = SomeAdhoc ()++foo (Just ()) = Just ()++-foo (SomeAdhoc2 ()) = SomeAdhoc2 ()++foo (Just ()) = SomeAdhoc2 ()++ fooBool :: Maybe Bool -> MaybeBool+-fooBool (JustNot x) = JustNot x++fooBool (Just (not -> x)) = Just (not x)++ bar :: Either () () -> Either () ()+-bar LeftSomething = Left ()++bar (Left _) = Left ()
+ tests/inputs/PatternSyn2.test view
@@ -0,0 +1,30 @@+# Copyright (c) Facebook, Inc. and its affiliates.+#+# This source code is licensed under the MIT license found in the+# LICENSE file in the root directory of this source tree.+#+--pattern-backward PatternSyn2.Some+--pattern-backward PatternSyn2.JustUnit+--pattern-backward PatternSyn2.SomeUnit+===+ {-# LANGUAGE PatternSynonyms #-}+ {-# LANGUAGE ViewPatterns #-}+ module PatternSyn2 where++ pattern Some x <- Just x where Some x = Just x+ pattern JustUnit = Some ()+ pattern SomeUnit <- JustUnit++ foo :: Maybe () -> Maybe ()++-foo (Just ()) = Just ()++foo (Some ()) = Some ()++-foo (id -> Just ()) = Just ()++foo (id -> Some ()) = Some ()++-foo (Some ()) = Some ()++foo JustUnit = JustUnit++-foo JustUnit = JustUnit++foo SomeUnit = JustUnit