{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Haddock.Types
( module Haddock.Types
, HsDocString
, LHsDocString
, Fixity (..)
, module Documentation.Haddock.Types
) where
import Control.DeepSeq
import Control.Exception (throw)
import Control.Monad.Catch
import Control.Monad.State.Strict
import Data.Data (Data)
import Data.Map (Map)
import qualified Data.Map as Map
import qualified Data.Set as Set
import GHC
import qualified GHC.Data.Strict as Strict
import GHC.Driver.Session (Language)
import qualified GHC.LanguageExtensions as LangExt
import GHC.Core.InstEnv (is_dfun_name)
import GHC.Types.Fixity (Fixity (..))
import GHC.Types.Name (stableNameCmp)
import GHC.Types.Name.Occurrence
import GHC.Types.Name.Reader (RdrName (..))
import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan)
import GHC.Types.Var (Specificity)
import GHC.Utils.Outputable
import Documentation.Haddock.Types
type IfaceMap = Map Module Interface
type InstIfaceMap = Map Module InstalledInterface
type DocMap a = Map Name (MDoc a)
type ArgMap a = Map Name (Map Int (MDoc a))
type SubMap = Map Name [Name]
type DeclMap = Map Name DeclMapEntry
type InstMap = Map RealSrcSpan Name
type FixMap = Map Name Fixity
data DocPaths = DocPaths
{ DocPaths -> FilePath
docPathsHtml :: FilePath
, DocPaths -> Maybe FilePath
docPathsSources :: Maybe FilePath
}
type WarningMap = Map Name (Doc Name)
data Interface = Interface
{ Interface -> Module
ifaceMod :: !Module
, Interface -> Bool
ifaceIsSig :: !Bool
, Interface -> HaddockModInfo Name
ifaceInfo :: !(HaddockModInfo Name)
, Interface -> Documentation Name
ifaceDoc :: !(Documentation Name)
, Interface -> Documentation DocName
ifaceRnDoc :: !(Documentation DocName)
, Interface -> [DocOption]
ifaceOptions :: [DocOption]
, Interface -> DocMap Name
ifaceDocMap :: !(DocMap Name)
, Interface -> ArgMap Name
ifaceArgMap :: !(ArgMap Name)
, Interface -> [(OccName, Name)]
ifaceDefMeths :: !([(OccName, Name)])
, Interface -> Map Name Fixity
ifaceFixMap :: !(Map Name Fixity)
, Interface -> [ExportItem GhcRn]
ifaceExportItems :: [ExportItem GhcRn]
, Interface -> [ExportItem DocNameI]
ifaceRnExportItems :: [ExportItem DocNameI]
, Interface -> [Name]
ifaceExports :: [Name]
, Interface -> [Name]
ifaceVisibleExports :: [Name]
, Interface -> [ClsInst]
ifaceInstances :: [ClsInst]
, Interface -> [DocInstance GhcRn]
ifaceOrphanInstances :: [DocInstance GhcRn]
, Interface -> [DocInstance DocNameI]
ifaceRnOrphanInstances :: [DocInstance DocNameI]
, Interface -> (Int, Int)
ifaceHaddockCoverage :: (Int, Int)
, Interface -> WarningMap
ifaceWarningMap :: WarningMap
, Interface -> FilePath
ifaceHieFile :: !FilePath
, Interface -> DynFlags
ifaceDynFlags :: !DynFlags
}
data InstalledInterface = InstalledInterface
{ InstalledInterface -> Module
instMod :: Module
, InstalledInterface -> Bool
instIsSig :: Bool
, InstalledInterface -> HaddockModInfo Name
instInfo :: HaddockModInfo Name
, InstalledInterface -> DocMap Name
instDocMap :: DocMap Name
, InstalledInterface -> ArgMap Name
instArgMap :: ArgMap Name
, InstalledInterface -> [(OccName, Name)]
instDefMeths :: [(OccName, Name)]
, InstalledInterface -> [Name]
instExports :: [Name]
, InstalledInterface -> [Name]
instVisibleExports :: [Name]
, InstalledInterface -> [DocOption]
instOptions :: [DocOption]
, InstalledInterface -> Map Name Fixity
instFixMap :: Map Name Fixity
, InstalledInterface -> WarningMap
instWarningMap :: WarningMap
, InstalledInterface -> Map Name RealSrcSpan
instInstanceLocMap :: Map Name RealSrcSpan
}
toInstalledIface :: Interface -> InstalledInterface
toInstalledIface :: Interface -> InstalledInterface
toInstalledIface Interface
interface =
InstalledInterface
{ instMod :: Module
instMod = Interface
interface.ifaceMod
, instIsSig :: Bool
instIsSig = Interface
interface.ifaceIsSig
, instInfo :: HaddockModInfo Name
instInfo = Interface
interface.ifaceInfo
, instDocMap :: DocMap Name
instDocMap = Interface
interface.ifaceDocMap
, instArgMap :: ArgMap Name
instArgMap = Interface
interface.ifaceArgMap
, instExports :: [Name]
instExports = Interface
interface.ifaceExports
, instVisibleExports :: [Name]
instVisibleExports = Interface
interface.ifaceVisibleExports
, instOptions :: [DocOption]
instOptions = Interface
interface.ifaceOptions
, instFixMap :: Map Name Fixity
instFixMap = Interface
interface.ifaceFixMap
, instDefMeths :: [(OccName, Name)]
instDefMeths = Interface
interface.ifaceDefMeths
, instWarningMap :: WarningMap
instWarningMap = Interface
interface.ifaceWarningMap
, instInstanceLocMap :: Map Name RealSrcSpan
instInstanceLocMap = [(Name, RealSrcSpan)] -> Map Name RealSrcSpan
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Name
inst_name, RealSrcSpan
loc) | ClsInst
i <- Interface
interface.ifaceInstances, let inst_name :: Name
inst_name = ClsInst -> Name
is_dfun_name ClsInst
i, Just RealSrcSpan
loc <- [SrcSpan -> Maybe RealSrcSpan
srcSpanToRealSrcSpan (Name -> SrcSpan
nameSrcSpan Name
inst_name)]]
}
newtype IfM m a = IfM {forall (m :: Type -> Type) a. IfM m a -> StateT (IfEnv m) m a
unIfM :: StateT (IfEnv m) m a}
deriving newtype instance Functor m => Functor (IfM m)
deriving newtype instance (Monad m, Applicative m) => Applicative (IfM m)
deriving newtype instance Monad m => Monad (IfM m)
deriving newtype instance MonadIO m => MonadIO (IfM m)
deriving newtype instance Monad m => MonadState (IfEnv m) (IfM m)
data IfEnv m = IfEnv
{ forall (m :: Type -> Type). IfEnv m -> Name -> m (Maybe TyThing)
ifeLookupName :: Name -> m (Maybe TyThing)
, forall (m :: Type -> Type). IfEnv m -> Set FilePath
ifeOutOfScopeNames :: !(Set.Set String)
, forall (m :: Type -> Type). IfEnv m -> Set FilePath
ifeAmbiguousNames :: !(Set.Set String)
}
runIfM
:: Monad m
=> (Name -> m (Maybe TyThing))
-> IfM m a
-> m a
runIfM :: forall (m :: Type -> Type) a.
Monad m =>
(Name -> m (Maybe TyThing)) -> IfM m a -> m a
runIfM Name -> m (Maybe TyThing)
lookup_name IfM m a
action = do
let
if_env :: IfEnv m
if_env =
IfEnv
{ ifeLookupName :: Name -> m (Maybe TyThing)
ifeLookupName = Name -> m (Maybe TyThing)
lookup_name
, ifeOutOfScopeNames :: Set FilePath
ifeOutOfScopeNames = Set FilePath
forall a. Set a
Set.empty
, ifeAmbiguousNames :: Set FilePath
ifeAmbiguousNames = Set FilePath
forall a. Set a
Set.empty
}
StateT (IfEnv m) m a -> IfEnv m -> m a
forall (m :: Type -> Type) s a. Monad m => StateT s m a -> s -> m a
evalStateT (IfM m a -> StateT (IfEnv m) m a
forall (m :: Type -> Type) a. IfM m a -> StateT (IfEnv m) m a
unIfM IfM m a
action) IfEnv m
if_env
lookupName :: Monad m => Name -> IfM m (Maybe TyThing)
lookupName :: forall (m :: Type -> Type).
Monad m =>
Name -> IfM m (Maybe TyThing)
lookupName Name
name = StateT (IfEnv m) m (Maybe TyThing) -> IfM m (Maybe TyThing)
forall (m :: Type -> Type) a. StateT (IfEnv m) m a -> IfM m a
IfM (StateT (IfEnv m) m (Maybe TyThing) -> IfM m (Maybe TyThing))
-> StateT (IfEnv m) m (Maybe TyThing) -> IfM m (Maybe TyThing)
forall a b. (a -> b) -> a -> b
$ do
lookup_name <- (IfEnv m -> Name -> m (Maybe TyThing))
-> StateT (IfEnv m) m (Name -> m (Maybe TyThing))
forall s (m :: Type -> Type) a. MonadState s m => (s -> a) -> m a
gets IfEnv m -> Name -> m (Maybe TyThing)
forall (m :: Type -> Type). IfEnv m -> Name -> m (Maybe TyThing)
ifeLookupName
lift (lookup_name name)
warn :: MonadIO m => String -> IfM m ()
warn :: forall (m :: Type -> Type). MonadIO m => FilePath -> IfM m ()
warn FilePath
msg = IO () -> IfM m ()
forall a. IO a -> IfM m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> IfM m ()) -> IO () -> IfM m ()
forall a b. (a -> b) -> a -> b
$ FilePath -> IO ()
putStrLn FilePath
msg
data ExportItem name
=
ExportDecl (XExportDecl name)
|
ExportNoDecl
{ forall name. ExportItem name -> IdP name
expItemName :: !(IdP name)
, forall name. ExportItem name -> [IdP name]
expItemSubs :: [IdP name]
}
|
ExportGroup
{ forall name. ExportItem name -> Int
expItemSectionLevel :: !Int
, forall name. ExportItem name -> FilePath
expItemSectionId :: !String
, forall name. ExportItem name -> Doc (IdP name)
expItemSectionText :: !(Doc (IdP name))
}
|
ExportDoc !(MDoc (IdP name))
|
ExportModule !Module
type family XExportDecl x where
XExportDecl GhcRn = ExportD GhcRn
XExportDecl DocNameI = RnExportD
data ExportD name = ExportD
{ forall name. ExportD name -> LHsDecl name
expDDecl :: !(LHsDecl name)
, forall name. ExportD name -> [(HsDecl name, DocForDecl (IdP name))]
expDPats :: [(HsDecl name, DocForDecl (IdP name))]
, forall name. ExportD name -> DocForDecl (IdP name)
expDMbDoc :: !(DocForDecl (IdP name))
, forall name. ExportD name -> [(IdP name, DocForDecl (IdP name))]
expDSubDocs :: [(IdP name, DocForDecl (IdP name))]
, forall name. ExportD name -> [DocInstance name]
expDInstances :: [DocInstance name]
, forall name. ExportD name -> [(IdP name, Fixity)]
expDFixities :: [(IdP name, Fixity)]
, forall name. ExportD name -> Bool
expDSpliced :: !Bool
}
data RnExportD = RnExportD
{ RnExportD -> ExportD DocNameI
rnExpDExpD :: !(ExportD DocNameI)
, RnExportD -> [FilePath]
rnExpDHoogle :: [String]
}
data Documentation name = Documentation
{ forall name. Documentation name -> Maybe (MDoc name)
documentationDoc :: Maybe (MDoc name)
, forall name. Documentation name -> Maybe (Doc name)
documentationWarning :: Maybe (Doc name)
}
deriving ((forall a b. (a -> b) -> Documentation a -> Documentation b)
-> (forall a b. a -> Documentation b -> Documentation a)
-> Functor Documentation
forall a b. a -> Documentation b -> Documentation a
forall a b. (a -> b) -> Documentation a -> Documentation b
forall (f :: Type -> Type).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Documentation a -> Documentation b
fmap :: forall a b. (a -> b) -> Documentation a -> Documentation b
$c<$ :: forall a b. a -> Documentation b -> Documentation a
<$ :: forall a b. a -> Documentation b -> Documentation a
Functor)
instance NFData name => NFData (Documentation name) where
rnf :: Documentation name -> ()
rnf (Documentation Maybe (MDoc name)
d Maybe (Doc name)
w) = Maybe (MDoc name)
d Maybe (MDoc name) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Maybe (Doc name)
w Maybe (Doc name) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
type FnArgsDoc name = Map Int (MDoc name)
type DocForDecl name = (Documentation name, FnArgsDoc name)
noDocForDecl :: DocForDecl name
noDocForDecl :: forall name. DocForDecl name
noDocForDecl = (Maybe (MDoc name) -> Maybe (Doc name) -> Documentation name
forall name.
Maybe (MDoc name) -> Maybe (Doc name) -> Documentation name
Documentation Maybe (MDoc name)
forall a. Maybe a
Nothing Maybe (Doc name)
forall a. Maybe a
Nothing, FnArgsDoc name
forall a. Monoid a => a
mempty)
data DeclMapEntry
= EValD !SrcSpan
| EOther (LHsDecl GhcRn)
instance Semigroup DeclMapEntry where
(EValD SrcSpan
_) <> :: DeclMapEntry -> DeclMapEntry -> DeclMapEntry
<> DeclMapEntry
e = DeclMapEntry
e
DeclMapEntry
e <> DeclMapEntry
_ = DeclMapEntry
e
toDeclMapEntry :: LHsDecl GhcRn -> DeclMapEntry
toDeclMapEntry :: LHsDecl GhcRn -> DeclMapEntry
toDeclMapEntry (L SrcSpanAnnA
l (ValD XValD GhcRn
_ HsBind GhcRn
_)) = SrcSpan -> DeclMapEntry
EValD (SrcSpanAnnA -> SrcSpan
forall a. HasLoc a => a -> SrcSpan
locA SrcSpanAnnA
l)
toDeclMapEntry LHsDecl GhcRn
d = LHsDecl GhcRn -> DeclMapEntry
EOther LHsDecl GhcRn
d
type LinkEnv = Map Name Module
data NsRdrName = NsRdrName
{ NsRdrName -> Namespace
namespace :: !Namespace
, NsRdrName -> RdrName
rdrName :: !RdrName
}
instance NFData NsRdrName where
rnf :: NsRdrName -> ()
rnf (NsRdrName Namespace
ns RdrName
rdrN) = Namespace
ns Namespace -> () -> ()
forall a b. a -> b -> b
`seq` RdrName
rdrN RdrName -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
data DocName
=
Documented Name Module
|
Undocumented Name
deriving (DocName -> DocName -> Bool
(DocName -> DocName -> Bool)
-> (DocName -> DocName -> Bool) -> Eq DocName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocName -> DocName -> Bool
== :: DocName -> DocName -> Bool
$c/= :: DocName -> DocName -> Bool
/= :: DocName -> DocName -> Bool
Eq, Typeable DocName
Typeable DocName =>
(forall (c :: Type -> Type).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocName -> c DocName)
-> (forall (c :: Type -> Type).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocName)
-> (DocName -> Constr)
-> (DocName -> DataType)
-> (forall (t :: Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocName))
-> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocName))
-> ((forall b. Data b => b -> b) -> DocName -> DocName)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r)
-> (forall u. (forall d. Data d => d -> u) -> DocName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DocName -> u)
-> (forall (m :: Type -> Type).
Monad m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName)
-> (forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName)
-> (forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName)
-> Data DocName
DocName -> Constr
DocName -> DataType
(forall b. Data b => b -> b) -> DocName -> DocName
forall a.
Typeable a =>
(forall (c :: Type -> Type).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: Type -> Type).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: Type -> Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: Type -> Type).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DocName -> u
forall u. (forall d. Data d => d -> u) -> DocName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
forall (m :: Type -> Type).
Monad m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
forall (c :: Type -> Type).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocName
forall (c :: Type -> Type).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocName -> c DocName
forall (t :: Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocName)
forall (t :: Type -> Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocName)
$cgfoldl :: forall (c :: Type -> Type).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocName -> c DocName
gfoldl :: forall (c :: Type -> Type).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocName -> c DocName
$cgunfold :: forall (c :: Type -> Type).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocName
gunfold :: forall (c :: Type -> Type).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocName
$ctoConstr :: DocName -> Constr
toConstr :: DocName -> Constr
$cdataTypeOf :: DocName -> DataType
dataTypeOf :: DocName -> DataType
$cdataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocName)
dataCast1 :: forall (t :: Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocName)
$cdataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocName)
dataCast2 :: forall (t :: Type -> Type -> Type) (c :: Type -> Type).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocName)
$cgmapT :: (forall b. Data b => b -> b) -> DocName -> DocName
gmapT :: (forall b. Data b => b -> b) -> DocName -> DocName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DocName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DocName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DocName -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocName -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocName -> u
$cgmapM :: forall (m :: Type -> Type).
Monad m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
gmapM :: forall (m :: Type -> Type).
Monad m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
$cgmapMp :: forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
gmapMp :: forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
$cgmapMo :: forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
gmapMo :: forall (m :: Type -> Type).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocName -> m DocName
Data)
data DocNameI
type instance NoGhcTc DocNameI = DocNameI
type instance IdP DocNameI = DocName
instance CollectPass DocNameI where
collectXXPat :: CollectFlag DocNameI
-> XXPat DocNameI -> [IdP DocNameI] -> [IdP DocNameI]
collectXXPat CollectFlag DocNameI
_ XXPat DocNameI
ext = DataConCantHappen -> [DocName] -> [DocName]
forall a. DataConCantHappen -> a
dataConCantHappen XXPat DocNameI
DataConCantHappen
ext
collectXXHsBindsLR :: forall pR.
XXHsBindsLR DocNameI pR -> [IdP DocNameI] -> [IdP DocNameI]
collectXXHsBindsLR XXHsBindsLR DocNameI pR
ext = DataConCantHappen -> [DocName] -> [DocName]
forall a. DataConCantHappen -> a
dataConCantHappen XXHsBindsLR DocNameI pR
DataConCantHappen
ext
collectXSplicePat :: CollectFlag DocNameI
-> XSplicePat DocNameI -> [IdP DocNameI] -> [IdP DocNameI]
collectXSplicePat CollectFlag DocNameI
_ XSplicePat DocNameI
ext = DataConCantHappen -> [DocName] -> [DocName]
forall a. DataConCantHappen -> a
dataConCantHappen XSplicePat DocNameI
DataConCantHappen
ext
instance NamedThing DocName where
getName :: DocName -> Name
getName (Documented Name
name Module
_) = Name
name
getName (Undocumented Name
name) = Name
name
instance Outputable DocName where
ppr :: DocName -> SDoc
ppr = Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr (Name -> SDoc) -> (DocName -> Name) -> DocName -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocName -> Name
forall a. NamedThing a => a -> Name
getName
instance OutputableBndr DocName where
pprBndr :: BindingSite -> DocName -> SDoc
pprBndr BindingSite
_ = Name -> SDoc
forall a. Outputable a => a -> SDoc
ppr (Name -> SDoc) -> (DocName -> Name) -> DocName -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocName -> Name
forall a. NamedThing a => a -> Name
getName
pprPrefixOcc :: DocName -> SDoc
pprPrefixOcc = Name -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprPrefixOcc (Name -> SDoc) -> (DocName -> Name) -> DocName -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocName -> Name
forall a. NamedThing a => a -> Name
getName
pprInfixOcc :: DocName -> SDoc
pprInfixOcc = Name -> SDoc
forall a. OutputableBndr a => a -> SDoc
pprInfixOcc (Name -> SDoc) -> (DocName -> Name) -> DocName -> SDoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocName -> Name
forall a. NamedThing a => a -> Name
getName
class NamedThing name => SetName name where
setName :: Name -> name -> name
instance SetName Name where
setName :: Name -> Name -> Name
setName Name
name' Name
_ = Name
name'
instance SetName DocName where
setName :: Name -> DocName -> DocName
setName Name
name' (Documented Name
_ Module
mdl) = Name -> Module -> DocName
Documented Name
name' Module
mdl
setName Name
name' (Undocumented Name
_) = Name -> DocName
Undocumented Name
name'
data Wrap n
=
Unadorned {forall n. Wrap n -> n
unwrap :: n}
|
Parenthesized {unwrap :: n}
|
Backticked {unwrap :: n}
deriving (Int -> Wrap n -> ShowS
[Wrap n] -> ShowS
Wrap n -> FilePath
(Int -> Wrap n -> ShowS)
-> (Wrap n -> FilePath) -> ([Wrap n] -> ShowS) -> Show (Wrap n)
forall n. Show n => Int -> Wrap n -> ShowS
forall n. Show n => [Wrap n] -> ShowS
forall n. Show n => Wrap n -> FilePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall n. Show n => Int -> Wrap n -> ShowS
showsPrec :: Int -> Wrap n -> ShowS
$cshow :: forall n. Show n => Wrap n -> FilePath
show :: Wrap n -> FilePath
$cshowList :: forall n. Show n => [Wrap n] -> ShowS
showList :: [Wrap n] -> ShowS
Show, (forall a b. (a -> b) -> Wrap a -> Wrap b)
-> (forall a b. a -> Wrap b -> Wrap a) -> Functor Wrap
forall a b. a -> Wrap b -> Wrap a
forall a b. (a -> b) -> Wrap a -> Wrap b
forall (f :: Type -> Type).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Wrap a -> Wrap b
fmap :: forall a b. (a -> b) -> Wrap a -> Wrap b
$c<$ :: forall a b. a -> Wrap b -> Wrap a
<$ :: forall a b. a -> Wrap b -> Wrap a
Functor, (forall m. Monoid m => Wrap m -> m)
-> (forall m a. Monoid m => (a -> m) -> Wrap a -> m)
-> (forall m a. Monoid m => (a -> m) -> Wrap a -> m)
-> (forall a b. (a -> b -> b) -> b -> Wrap a -> b)
-> (forall a b. (a -> b -> b) -> b -> Wrap a -> b)
-> (forall b a. (b -> a -> b) -> b -> Wrap a -> b)
-> (forall b a. (b -> a -> b) -> b -> Wrap a -> b)
-> (forall a. (a -> a -> a) -> Wrap a -> a)
-> (forall a. (a -> a -> a) -> Wrap a -> a)
-> (forall a. Wrap a -> [a])
-> (forall a. Wrap a -> Bool)
-> (forall a. Wrap a -> Int)
-> (forall a. Eq a => a -> Wrap a -> Bool)
-> (forall a. Ord a => Wrap a -> a)
-> (forall a. Ord a => Wrap a -> a)
-> (forall a. Num a => Wrap a -> a)
-> (forall a. Num a => Wrap a -> a)
-> Foldable Wrap
forall a. Eq a => a -> Wrap a -> Bool
forall a. Num a => Wrap a -> a
forall a. Ord a => Wrap a -> a
forall m. Monoid m => Wrap m -> m
forall a. Wrap a -> Bool
forall a. Wrap a -> Int
forall a. Wrap a -> [a]
forall a. (a -> a -> a) -> Wrap a -> a
forall m a. Monoid m => (a -> m) -> Wrap a -> m
forall b a. (b -> a -> b) -> b -> Wrap a -> b
forall a b. (a -> b -> b) -> b -> Wrap a -> b
forall (t :: Type -> Type).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Wrap m -> m
fold :: forall m. Monoid m => Wrap m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Wrap a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Wrap a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Wrap a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Wrap a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Wrap a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Wrap a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Wrap a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Wrap a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Wrap a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Wrap a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Wrap a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Wrap a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Wrap a -> a
foldr1 :: forall a. (a -> a -> a) -> Wrap a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Wrap a -> a
foldl1 :: forall a. (a -> a -> a) -> Wrap a -> a
$ctoList :: forall a. Wrap a -> [a]
toList :: forall a. Wrap a -> [a]
$cnull :: forall a. Wrap a -> Bool
null :: forall a. Wrap a -> Bool
$clength :: forall a. Wrap a -> Int
length :: forall a. Wrap a -> Int
$celem :: forall a. Eq a => a -> Wrap a -> Bool
elem :: forall a. Eq a => a -> Wrap a -> Bool
$cmaximum :: forall a. Ord a => Wrap a -> a
maximum :: forall a. Ord a => Wrap a -> a
$cminimum :: forall a. Ord a => Wrap a -> a
minimum :: forall a. Ord a => Wrap a -> a
$csum :: forall a. Num a => Wrap a -> a
sum :: forall a. Num a => Wrap a -> a
$cproduct :: forall a. Num a => Wrap a -> a
product :: forall a. Num a => Wrap a -> a
Foldable, Functor Wrap
Foldable Wrap
(Functor Wrap, Foldable Wrap) =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Wrap a -> f (Wrap b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
Wrap (f a) -> f (Wrap a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Wrap a -> m (Wrap b))
-> (forall (m :: Type -> Type) a.
Monad m =>
Wrap (m a) -> m (Wrap a))
-> Traversable Wrap
forall (t :: Type -> Type).
(Functor t, Foldable t) =>
(forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: Type -> Type) a.
Applicative f =>
t (f a) -> f (t a))
-> (forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: Type -> Type) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: Type -> Type) a. Monad m => Wrap (m a) -> m (Wrap a)
forall (f :: Type -> Type) a.
Applicative f =>
Wrap (f a) -> f (Wrap a)
forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Wrap a -> m (Wrap b)
forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Wrap a -> f (Wrap b)
$ctraverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Wrap a -> f (Wrap b)
traverse :: forall (f :: Type -> Type) a b.
Applicative f =>
(a -> f b) -> Wrap a -> f (Wrap b)
$csequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Wrap (f a) -> f (Wrap a)
sequenceA :: forall (f :: Type -> Type) a.
Applicative f =>
Wrap (f a) -> f (Wrap a)
$cmapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Wrap a -> m (Wrap b)
mapM :: forall (m :: Type -> Type) a b.
Monad m =>
(a -> m b) -> Wrap a -> m (Wrap b)
$csequence :: forall (m :: Type -> Type) a. Monad m => Wrap (m a) -> m (Wrap a)
sequence :: forall (m :: Type -> Type) a. Monad m => Wrap (m a) -> m (Wrap a)
Traversable)
instance NFData n => NFData (Wrap n) where
rnf :: Wrap n -> ()
rnf Wrap n
w = case Wrap n
w of
Unadorned n
n -> n -> ()
forall a. NFData a => a -> ()
rnf n
n
Parenthesized n
n -> n -> ()
forall a. NFData a => a -> ()
rnf n
n
Backticked n
n -> n -> ()
forall a. NFData a => a -> ()
rnf n
n
instance Outputable n => Outputable (Wrap n) where
ppr :: Wrap n -> SDoc
ppr (Unadorned n
n) = n -> SDoc
forall a. Outputable a => a -> SDoc
ppr n
n
ppr (Parenthesized n
n) = [SDoc] -> SDoc
forall doc. IsLine doc => [doc] -> doc
hcat [Char -> SDoc
forall doc. IsLine doc => Char -> doc
char Char
'(', n -> SDoc
forall a. Outputable a => a -> SDoc
ppr n
n, Char -> SDoc
forall doc. IsLine doc => Char -> doc
char Char
')']
ppr (Backticked n
n) = [SDoc] -> SDoc
forall doc. IsLine doc => [doc] -> doc
hcat [Char -> SDoc
forall doc. IsLine doc => Char -> doc
char Char
'`', n -> SDoc
forall a. Outputable a => a -> SDoc
ppr n
n, Char -> SDoc
forall doc. IsLine doc => Char -> doc
char Char
'`']
showWrapped :: (a -> String) -> Wrap a -> String
showWrapped :: forall a. (a -> FilePath) -> Wrap a -> FilePath
showWrapped a -> FilePath
f (Unadorned a
n) = a -> FilePath
f a
n
showWrapped a -> FilePath
f (Parenthesized a
n) = FilePath
"(" FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ a -> FilePath
f a
n FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
")"
showWrapped a -> FilePath
f (Backticked a
n) = FilePath
"`" FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ a -> FilePath
f a
n FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
"`"
instance HasOccName DocName where
occName :: DocName -> OccName
occName = Name -> OccName
forall name. HasOccName name => name -> OccName
occName (Name -> OccName) -> (DocName -> Name) -> DocName -> OccName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocName -> Name
forall a. NamedThing a => a -> Name
getName
newtype SName = SName Name
deriving newtype (SName -> ()
(SName -> ()) -> NFData SName
forall a. (a -> ()) -> NFData a
$crnf :: SName -> ()
rnf :: SName -> ()
NFData)
instance Eq SName where
SName Name
n1 == :: SName -> SName -> Bool
== SName Name
n2 = Name
n1 Name -> Name -> Ordering
`stableNameCmp` Name
n2 Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
EQ
instance Ord SName where
SName Name
n1 compare :: SName -> SName -> Ordering
`compare` SName Name
n2 = Name
n1 Name -> Name -> Ordering
`stableNameCmp` Name
n2
data SimpleType
= SimpleType SName [SimpleType]
| SimpleIntTyLit Integer
| SimpleStringTyLit String
| SimpleCharTyLit Char
deriving (SimpleType -> SimpleType -> Bool
(SimpleType -> SimpleType -> Bool)
-> (SimpleType -> SimpleType -> Bool) -> Eq SimpleType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SimpleType -> SimpleType -> Bool
== :: SimpleType -> SimpleType -> Bool
$c/= :: SimpleType -> SimpleType -> Bool
/= :: SimpleType -> SimpleType -> Bool
Eq, Eq SimpleType
Eq SimpleType =>
(SimpleType -> SimpleType -> Ordering)
-> (SimpleType -> SimpleType -> Bool)
-> (SimpleType -> SimpleType -> Bool)
-> (SimpleType -> SimpleType -> Bool)
-> (SimpleType -> SimpleType -> Bool)
-> (SimpleType -> SimpleType -> SimpleType)
-> (SimpleType -> SimpleType -> SimpleType)
-> Ord SimpleType
SimpleType -> SimpleType -> Bool
SimpleType -> SimpleType -> Ordering
SimpleType -> SimpleType -> SimpleType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SimpleType -> SimpleType -> Ordering
compare :: SimpleType -> SimpleType -> Ordering
$c< :: SimpleType -> SimpleType -> Bool
< :: SimpleType -> SimpleType -> Bool
$c<= :: SimpleType -> SimpleType -> Bool
<= :: SimpleType -> SimpleType -> Bool
$c> :: SimpleType -> SimpleType -> Bool
> :: SimpleType -> SimpleType -> Bool
$c>= :: SimpleType -> SimpleType -> Bool
>= :: SimpleType -> SimpleType -> Bool
$cmax :: SimpleType -> SimpleType -> SimpleType
max :: SimpleType -> SimpleType -> SimpleType
$cmin :: SimpleType -> SimpleType -> SimpleType
min :: SimpleType -> SimpleType -> SimpleType
Ord)
instance NFData SimpleType where
rnf :: SimpleType -> ()
rnf SimpleType
st =
case SimpleType
st of
SimpleType SName
sn [SimpleType]
sts -> SName
sn SName -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` [SimpleType]
sts [SimpleType] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
SimpleIntTyLit Integer
i -> Integer -> ()
forall a. NFData a => a -> ()
rnf Integer
i
SimpleStringTyLit FilePath
s -> FilePath -> ()
forall a. NFData a => a -> ()
rnf FilePath
s
SimpleCharTyLit Char
c -> Char -> ()
forall a. NFData a => a -> ()
rnf Char
c
data InstType name
= ClassInst
{ forall name. InstType name -> [HsType name]
clsiCtx :: [HsType name]
, forall name. InstType name -> LHsQTyVars name
clsiTyVars :: LHsQTyVars name
, forall name. InstType name -> [Sig name]
clsiSigs :: [Sig name]
, forall name. InstType name -> [DocInstance name]
clsiAssocTys :: [DocInstance name]
}
|
TypeInst (Maybe (HsType name))
|
DataInst (TyClDecl name)
instance
OutputableBndrId p
=> Outputable (InstType (GhcPass p))
where
ppr :: InstType (GhcPass p) -> SDoc
ppr (ClassInst{[DocInstance (GhcPass p)]
[HsType (GhcPass p)]
[Sig (GhcPass p)]
LHsQTyVars (GhcPass p)
clsiCtx :: forall name. InstType name -> [HsType name]
clsiTyVars :: forall name. InstType name -> LHsQTyVars name
clsiSigs :: forall name. InstType name -> [Sig name]
clsiAssocTys :: forall name. InstType name -> [DocInstance name]
clsiCtx :: [HsType (GhcPass p)]
clsiTyVars :: LHsQTyVars (GhcPass p)
clsiSigs :: [Sig (GhcPass p)]
clsiAssocTys :: [DocInstance (GhcPass p)]
..}) =
FilePath -> SDoc
forall doc. IsLine doc => FilePath -> doc
text FilePath
"ClassInst"
SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> [HsType (GhcPass p)] -> SDoc
forall a. Outputable a => a -> SDoc
ppr [HsType (GhcPass p)]
clsiCtx
SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> LHsQTyVars (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
ppr LHsQTyVars (GhcPass p)
clsiTyVars
SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> [Sig (GhcPass p)] -> SDoc
forall a. Outputable a => a -> SDoc
ppr [Sig (GhcPass p)]
clsiSigs
ppr (TypeInst Maybe (HsType (GhcPass p))
a) = FilePath -> SDoc
forall doc. IsLine doc => FilePath -> doc
text FilePath
"TypeInst" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> Maybe (HsType (GhcPass p)) -> SDoc
forall a. Outputable a => a -> SDoc
ppr Maybe (HsType (GhcPass p))
a
ppr (DataInst TyClDecl (GhcPass p)
a) = FilePath -> SDoc
forall doc. IsLine doc => FilePath -> doc
text FilePath
"DataInst" SDoc -> SDoc -> SDoc
forall doc. IsLine doc => doc -> doc -> doc
<+> TyClDecl (GhcPass p) -> SDoc
forall a. Outputable a => a -> SDoc
ppr TyClDecl (GhcPass p)
a
type DocInstance name = (InstHead name, Maybe (MDoc (IdP name)), Located (IdP name), Maybe Module)
data InstHead name = InstHead
{ forall name. InstHead name -> IdP name
ihdClsName :: IdP name
, forall name. InstHead name -> [HsType name]
ihdTypes :: [HsType name]
, forall name. InstHead name -> InstType name
ihdInstType :: InstType name
}
data InstOrigin name
= OriginClass name
| OriginData name
| OriginFamily name
instance NamedThing name => NamedThing (InstOrigin name) where
getName :: InstOrigin name -> Name
getName (OriginClass name
name) = name -> Name
forall a. NamedThing a => a -> Name
getName name
name
getName (OriginData name
name) = name -> Name
forall a. NamedThing a => a -> Name
getName name
name
getName (OriginFamily name
name) = name -> Name
forall a. NamedThing a => a -> Name
getName name
name
type LDoc id = Located (Doc id)
type Doc id = DocH (Wrap (ModuleName, OccName)) (Wrap id)
type MDoc id = MetaDoc (Wrap (ModuleName, OccName)) (Wrap id)
type DocMarkup id a = DocMarkupH (Wrap (ModuleName, OccName)) id a
instance NFData MetaSince where
rnf :: MetaSince -> ()
rnf (MetaSince Maybe FilePath
v Version
p) = Maybe FilePath
v Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Version
p Version -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData Meta where
rnf :: Meta -> ()
rnf (Meta Maybe MetaSince
since) = Maybe MetaSince
since Maybe MetaSince -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (MDoc id) where
rnf :: MDoc id -> ()
rnf (MetaDoc Meta
m DocH (Wrap (ModuleName, OccName)) (Wrap id)
d) = Meta
m Meta -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` DocH (Wrap (ModuleName, OccName)) (Wrap id)
d DocH (Wrap (ModuleName, OccName)) (Wrap id) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance
(NFData a, NFData mod)
=> NFData (DocH mod a)
where
rnf :: DocH mod a -> ()
rnf DocH mod a
doc = case DocH mod a
doc of
DocH mod a
DocEmpty -> ()
DocAppend DocH mod a
a DocH mod a
b -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` DocH mod a
b DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocString FilePath
a -> FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocParagraph DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocIdentifier a
a -> a
a a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocIdentifierUnchecked mod
a -> mod
a mod -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocModule ModLink (DocH mod a)
a -> ModLink (DocH mod a)
a ModLink (DocH mod a) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocWarning DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocEmphasis DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocBold DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocMonospaced DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocUnorderedList [DocH mod a]
a -> [DocH mod a]
a [DocH mod a] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocOrderedList [(Int, DocH mod a)]
a -> [(Int, DocH mod a)]
a [(Int, DocH mod a)] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocDefList [(DocH mod a, DocH mod a)]
a -> [(DocH mod a, DocH mod a)]
a [(DocH mod a, DocH mod a)] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocCodeBlock DocH mod a
a -> DocH mod a
a DocH mod a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocHyperlink Hyperlink (DocH mod a)
a -> Hyperlink (DocH mod a)
a Hyperlink (DocH mod a) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocPic Picture
a -> Picture
a Picture -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocMathInline FilePath
a -> FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocMathDisplay FilePath
a -> FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocAName FilePath
a -> FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocProperty FilePath
a -> FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocExamples [Example]
a -> [Example]
a [Example] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocHeader Header (DocH mod a)
a -> Header (DocH mod a)
a Header (DocH mod a) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
DocTable Table (DocH mod a)
a -> Table (DocH mod a)
a Table (DocH mod a) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (Header id) where
rnf :: Header id -> ()
rnf (Header Int
a id
b) = Int
a Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` id
b id -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (Hyperlink id) where
rnf :: Hyperlink id -> ()
rnf (Hyperlink FilePath
a Maybe id
b) = FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Maybe id
b Maybe id -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (ModLink id) where
rnf :: ModLink id -> ()
rnf (ModLink FilePath
a Maybe id
b) = FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Maybe id
b Maybe id -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData Picture where
rnf :: Picture -> ()
rnf (Picture FilePath
a Maybe FilePath
b) = FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Maybe FilePath
b Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData Example where
rnf :: Example -> ()
rnf (Example FilePath
a [FilePath]
b) = FilePath
a FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` [FilePath]
b [FilePath] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (Table id) where
rnf :: Table id -> ()
rnf (Table [TableRow id]
h [TableRow id]
b) = [TableRow id]
h [TableRow id] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` [TableRow id]
b [TableRow id] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (TableRow id) where
rnf :: TableRow id -> ()
rnf (TableRow [TableCell id]
cs) = [TableCell id]
cs [TableCell id] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData id => NFData (TableCell id) where
rnf :: TableCell id -> ()
rnf (TableCell Int
i Int
j id
c) = Int
i Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Int
j Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` id
c id -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
exampleToString :: Example -> String
exampleToString :: Example -> FilePath
exampleToString (Example FilePath
expression [FilePath]
result) =
FilePath
">>> " FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
expression FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
"\n" FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ [FilePath] -> FilePath
unlines [FilePath]
result
instance NFData name => NFData (HaddockModInfo name) where
rnf :: HaddockModInfo name -> ()
rnf (HaddockModInfo{[Extension]
Maybe FilePath
Maybe Language
Maybe (Doc name)
hmi_description :: Maybe (Doc name)
hmi_copyright :: Maybe FilePath
hmi_license :: Maybe FilePath
hmi_maintainer :: Maybe FilePath
hmi_stability :: Maybe FilePath
hmi_portability :: Maybe FilePath
hmi_safety :: Maybe FilePath
hmi_language :: Maybe Language
hmi_extensions :: [Extension]
hmi_extensions :: forall name. HaddockModInfo name -> [Extension]
hmi_language :: forall name. HaddockModInfo name -> Maybe Language
hmi_safety :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_portability :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_stability :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_maintainer :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_license :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_copyright :: forall name. HaddockModInfo name -> Maybe FilePath
hmi_description :: forall name. HaddockModInfo name -> Maybe (Doc name)
..}) =
Maybe (Doc name)
hmi_description Maybe (Doc name) -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_copyright Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_license Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_maintainer Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_stability Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_portability Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe FilePath
hmi_safety Maybe FilePath -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe Language
hmi_language Maybe Language -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[Extension]
hmi_extensions [Extension] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
instance NFData LangExt.Extension
data HaddockModInfo name = HaddockModInfo
{ forall name. HaddockModInfo name -> Maybe (Doc name)
hmi_description :: Maybe (Doc name)
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_copyright :: Maybe String
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_license :: Maybe String
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_maintainer :: Maybe String
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_stability :: Maybe String
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_portability :: Maybe String
, forall name. HaddockModInfo name -> Maybe FilePath
hmi_safety :: Maybe String
, forall name. HaddockModInfo name -> Maybe Language
hmi_language :: Maybe Language
, forall name. HaddockModInfo name -> [Extension]
hmi_extensions :: [LangExt.Extension]
}
emptyHaddockModInfo :: HaddockModInfo a
emptyHaddockModInfo :: forall a. HaddockModInfo a
emptyHaddockModInfo =
HaddockModInfo
{ hmi_description :: Maybe (Doc a)
hmi_description = Maybe (Doc a)
forall a. Maybe a
Nothing
, hmi_copyright :: Maybe FilePath
hmi_copyright = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_license :: Maybe FilePath
hmi_license = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_maintainer :: Maybe FilePath
hmi_maintainer = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_stability :: Maybe FilePath
hmi_stability = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_portability :: Maybe FilePath
hmi_portability = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_safety :: Maybe FilePath
hmi_safety = Maybe FilePath
forall a. Maybe a
Nothing
, hmi_language :: Maybe Language
hmi_language = Maybe Language
forall a. Maybe a
Nothing
, hmi_extensions :: [Extension]
hmi_extensions = []
}
data DocOption
=
OptHide
| OptPrune
|
OptIgnoreExports
|
OptNotHome
|
OptShowExtensions
|
OptPrintRuntimeRep
deriving (DocOption -> DocOption -> Bool
(DocOption -> DocOption -> Bool)
-> (DocOption -> DocOption -> Bool) -> Eq DocOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocOption -> DocOption -> Bool
== :: DocOption -> DocOption -> Bool
$c/= :: DocOption -> DocOption -> Bool
/= :: DocOption -> DocOption -> Bool
Eq, Int -> DocOption -> ShowS
[DocOption] -> ShowS
DocOption -> FilePath
(Int -> DocOption -> ShowS)
-> (DocOption -> FilePath)
-> ([DocOption] -> ShowS)
-> Show DocOption
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocOption -> ShowS
showsPrec :: Int -> DocOption -> ShowS
$cshow :: DocOption -> FilePath
show :: DocOption -> FilePath
$cshowList :: [DocOption] -> ShowS
showList :: [DocOption] -> ShowS
Show)
data QualOption
=
OptNoQual
|
OptFullQual
|
OptLocalQual
|
OptRelativeQual
data Qualification
= NoQual
| FullQual
| LocalQual Module
| RelativeQual Module
makeContentsQual :: QualOption -> Qualification
makeContentsQual :: QualOption -> Qualification
makeContentsQual QualOption
qual =
case QualOption
qual of
QualOption
OptNoQual -> Qualification
NoQual
QualOption
_ -> Qualification
FullQual
makeModuleQual :: QualOption -> Module -> Qualification
makeModuleQual :: QualOption -> Module -> Qualification
makeModuleQual QualOption
qual Module
mdl =
case QualOption
qual of
QualOption
OptLocalQual -> Module -> Qualification
LocalQual Module
mdl
QualOption
OptRelativeQual -> Module -> Qualification
RelativeQual Module
mdl
QualOption
OptFullQual -> Qualification
FullQual
QualOption
OptNoQual -> Qualification
NoQual
data HideEmptyContexts
= HideEmptyContexts
| ShowEmptyToplevelContexts
data SinceQual
= Always
|
External
type Renamer = String -> (NameSpace -> Bool) -> [Name]
data HaddockException
= HaddockException String
| WithContext [String] SomeException
instance Show HaddockException where
show :: HaddockException -> FilePath
show (HaddockException FilePath
str) = FilePath
str
show (WithContext [FilePath]
ctxts SomeException
se) = [FilePath] -> FilePath
unlines ([FilePath] -> FilePath) -> [FilePath] -> FilePath
forall a b. (a -> b) -> a -> b
$ [FilePath
"While " FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
ctxt FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
":\n" | FilePath
ctxt <- [FilePath] -> [FilePath]
forall a. [a] -> [a]
reverse [FilePath]
ctxts] [FilePath] -> [FilePath] -> [FilePath]
forall a. [a] -> [a] -> [a]
++ [SomeException -> FilePath
forall a. Show a => a -> FilePath
show SomeException
se]
throwE :: String -> a
instance Exception HaddockException
throwE :: forall a. FilePath -> a
throwE FilePath
str = HaddockException -> a
forall a e. (HasCallStack, Exception e) => e -> a
throw (FilePath -> HaddockException
HaddockException FilePath
str)
withExceptionContext :: MonadCatch m => String -> m a -> m a
withExceptionContext :: forall (m :: Type -> Type) a.
MonadCatch m =>
FilePath -> m a -> m a
withExceptionContext FilePath
ctxt =
(HaddockException -> m a) -> m a -> m a
forall (m :: Type -> Type) e a.
(HasCallStack, MonadCatch m, Exception e) =>
(e -> m a) -> m a -> m a
handle
( \HaddockException
ex ->
case HaddockException
ex of
HaddockException FilePath
_ -> HaddockException -> m a
forall e a. (HasCallStack, Exception e) => e -> m a
forall (m :: Type -> Type) e a.
(MonadThrow m, HasCallStack, Exception e) =>
e -> m a
throwM (HaddockException -> m a) -> HaddockException -> m a
forall a b. (a -> b) -> a -> b
$ [FilePath] -> SomeException -> HaddockException
WithContext [FilePath
ctxt] (HaddockException -> SomeException
forall e. Exception e => e -> SomeException
toException HaddockException
ex)
WithContext [FilePath]
ctxts SomeException
se -> HaddockException -> m a
forall e a. (HasCallStack, Exception e) => e -> m a
forall (m :: Type -> Type) e a.
(MonadThrow m, HasCallStack, Exception e) =>
e -> m a
throwM (HaddockException -> m a) -> HaddockException -> m a
forall a b. (a -> b) -> a -> b
$ [FilePath] -> SomeException -> HaddockException
WithContext (FilePath
ctxt FilePath -> [FilePath] -> [FilePath]
forall a. a -> [a] -> [a]
: [FilePath]
ctxts) SomeException
se
)
(m a -> m a) -> (m a -> m a) -> m a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SomeException -> m a) -> m a -> m a
forall (m :: Type -> Type) e a.
(HasCallStack, MonadCatch m, Exception e) =>
(e -> m a) -> m a -> m a
handle (HaddockException -> m a
forall e a. (HasCallStack, Exception e) => e -> m a
forall (m :: Type -> Type) e a.
(MonadThrow m, HasCallStack, Exception e) =>
e -> m a
throwM (HaddockException -> m a)
-> (SomeException -> HaddockException) -> SomeException -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [FilePath] -> SomeException -> HaddockException
WithContext [FilePath
ctxt])
type instance XRec DocNameI a = GenLocated (Anno a) a
instance UnXRec DocNameI where
unXRec :: forall a. XRec DocNameI a -> a
unXRec = XRec DocNameI a -> a
GenLocated (Anno a) a -> a
forall l e. GenLocated l e -> e
unLoc
instance MapXRec DocNameI where
mapXRec :: forall a b.
(Anno a ~ Anno b) =>
(a -> b) -> XRec DocNameI a -> XRec DocNameI b
mapXRec = (a -> b) -> XRec DocNameI a -> XRec DocNameI b
(a -> b) -> GenLocated (Anno b) a -> GenLocated (Anno b) b
forall a b.
(a -> b) -> GenLocated (Anno b) a -> GenLocated (Anno b) b
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
fmap
instance WrapXRec DocNameI (HsType DocNameI) where
wrapXRec :: HsType DocNameI -> XRec DocNameI (HsType DocNameI)
wrapXRec = HsType DocNameI -> XRec DocNameI (HsType DocNameI)
HsType DocNameI -> GenLocated SrcSpanAnnA (HsType DocNameI)
forall e a. HasAnnotation e => a -> GenLocated e a
noLocA
type instance Anno DocName = SrcSpanAnnN
type instance Anno (HsTyVarBndr flag DocNameI) = SrcSpanAnnA
type instance Anno [LocatedA (HsType DocNameI)] = SrcSpanAnnC
type instance Anno (HsType DocNameI) = SrcSpanAnnA
type instance Anno (DataFamInstDecl DocNameI) = SrcSpanAnnA
type instance Anno (DerivStrategy DocNameI) = EpAnn NoEpAnns
type instance Anno (FieldOcc DocNameI) = SrcSpanAnnA
type instance Anno (ConDeclField DocNameI) = SrcSpan
type instance Anno (Located (ConDeclField DocNameI)) = SrcSpan
type instance Anno [Located (ConDeclField DocNameI)] = SrcSpan
type instance Anno (ConDecl DocNameI) = SrcSpan
type instance Anno (FunDep DocNameI) = SrcSpan
type instance Anno (TyFamInstDecl DocNameI) = SrcSpanAnnA
type instance Anno [LocatedA (TyFamInstDecl DocNameI)] = SrcSpanAnnL
type instance Anno (FamilyDecl DocNameI) = SrcSpan
type instance Anno (Sig DocNameI) = SrcSpan
type instance Anno (InjectivityAnn DocNameI) = EpAnn NoEpAnns
type instance Anno (HsDecl DocNameI) = SrcSpanAnnA
type instance Anno (FamilyResultSig DocNameI) = EpAnn NoEpAnns
type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA
type instance Anno (HsSigType DocNameI) = SrcSpanAnnA
type XRecCond a =
( XParTy a ~ (EpToken "(", EpToken ")")
, NoGhcTc a ~ a
, MapXRec a
, UnXRec a
, WrapXRec a (HsType a)
)
type instance XValArg DocNameI = NoExtField
type instance XTypeArg DocNameI = NoExtField
type instance XArgPar DocNameI = NoExtField
type instance XXArg DocNameI = DataConCantHappen
type instance XBndrRequired DocNameI = NoExtField
type instance XBndrInvisible DocNameI = NoExtField
type instance XXBndrVis DocNameI = DataConCantHappen
type instance XUnrestrictedArrow _ DocNameI = NoExtField
type instance XLinearArrow _ DocNameI = NoExtField
type instance XExplicitMult _ DocNameI = NoExtField
type instance XXArrow _ DocNameI = DataConCantHappen
type instance XForAllTy DocNameI = EpAnn NoEpAnns
type instance XQualTy DocNameI = EpAnn NoEpAnns
type instance XTyVar DocNameI = EpAnn NoEpAnns
type instance XStarTy DocNameI = EpAnn NoEpAnns
type instance XAppTy DocNameI = EpAnn NoEpAnns
type instance XAppKindTy DocNameI = EpAnn NoEpAnns
type instance XFunTy DocNameI = EpAnn NoEpAnns
type instance XListTy DocNameI = EpAnn AnnParen
type instance XTupleTy DocNameI = EpAnn AnnParen
type instance XSumTy DocNameI = EpAnn AnnParen
type instance XOpTy DocNameI = EpAnn NoEpAnns
type instance XParTy DocNameI = (EpToken "(", EpToken ")")
type instance XIParamTy DocNameI = EpAnn NoEpAnns
type instance XKindSig DocNameI = EpAnn NoEpAnns
type instance XSpliceTy DocNameI = DataConCantHappen
type instance XDocTy DocNameI = EpAnn NoEpAnns
type instance XBangTy DocNameI = EpAnn NoEpAnns
type instance XRecTy DocNameI = EpAnn NoEpAnns
type instance XExplicitListTy DocNameI = EpAnn NoEpAnns
type instance XExplicitTupleTy DocNameI = EpAnn NoEpAnns
type instance XTyLit DocNameI = EpAnn NoEpAnns
type instance XWildCardTy DocNameI = EpAnn NoEpAnns
type instance XXType DocNameI = HsCoreTy
type instance XNumTy DocNameI = NoExtField
type instance XStrTy DocNameI = NoExtField
type instance XCharTy DocNameI = NoExtField
type instance XXTyLit DocNameI = DataConCantHappen
type instance XHsForAllVis DocNameI = NoExtField
type instance XHsForAllInvis DocNameI = NoExtField
type instance XXHsForAllTelescope DocNameI = DataConCantHappen
type instance XTyVarBndr DocNameI = NoExtField
type instance XXTyVarBndr DocNameI = DataConCantHappen
type instance XBndrVar DocNameI = NoExtField
type instance XBndrWildCard DocNameI = NoExtField
type instance XXBndrVar DocNameI = DataConCantHappen
type instance XBndrKind DocNameI = NoExtField
type instance XBndrNoKind DocNameI = NoExtField
type instance XXBndrKind DocNameI = DataConCantHappen
type instance XCFieldOcc DocNameI = RdrName
type instance XXFieldOcc DocNameI = DataConCantHappen
type instance XFixitySig DocNameI = NoExtField
type instance XFixSig DocNameI = NoExtField
type instance XPatSynSig DocNameI = NoExtField
type instance XClassOpSig DocNameI = NoExtField
type instance XTypeSig DocNameI = NoExtField
type instance XMinimalSig DocNameI = NoExtField
type instance XForeignExport DocNameI = NoExtField
type instance XForeignImport DocNameI = NoExtField
type instance XCImport DocNameI = NoExtField
type instance XCExport DocNameI = NoExtField
type instance XXForeignImport DocNameI = DataConCantHappen
type instance XXForeignExport DocNameI = DataConCantHappen
type instance XConDeclGADT DocNameI = NoExtField
type instance XConDeclH98 DocNameI = NoExtField
type instance XXConDecl DocNameI = DataConCantHappen
type instance XPrefixConGADT DocNameI = NoExtField
type instance XRecConGADT DocNameI = NoExtField
type instance XXConDeclGADTDetails DocNameI = DataConCantHappen
type instance XDerivD DocNameI = NoExtField
type instance XInstD DocNameI = NoExtField
type instance XForD DocNameI = NoExtField
type instance XSigD DocNameI = NoExtField
type instance XTyClD DocNameI = NoExtField
type instance XNoSig DocNameI = NoExtField
type instance XCKindSig DocNameI = NoExtField
type instance XTyVarSig DocNameI = NoExtField
type instance XXFamilyResultSig DocNameI = DataConCantHappen
type instance XCFamEqn DocNameI _ = NoExtField
type instance XXFamEqn DocNameI _ = DataConCantHappen
type instance XCClsInstDecl DocNameI = NoExtField
type instance XCDerivDecl DocNameI = NoExtField
type instance XStockStrategy DocNameI = NoExtField
type instance XAnyClassStrategy DocNameI = NoExtField
type instance XNewtypeStrategy DocNameI = NoExtField
type instance XViaStrategy DocNameI = LHsSigType DocNameI
type instance XDataFamInstD DocNameI = NoExtField
type instance XTyFamInstD DocNameI = NoExtField
type instance XClsInstD DocNameI = NoExtField
type instance XCHsDataDefn DocNameI = NoExtField
type instance XCFamilyDecl DocNameI = NoExtField
type instance XClassDecl DocNameI = NoExtField
type instance XDataDecl DocNameI = NoExtField
type instance XSynDecl DocNameI = NoExtField
type instance XFamDecl DocNameI = NoExtField
type instance XXFamilyDecl DocNameI = DataConCantHappen
type instance XXTyClDecl DocNameI = DataConCantHappen
type instance XHsWC DocNameI _ = NoExtField
type instance XHsOuterExplicit DocNameI _ = NoExtField
type instance XHsOuterImplicit DocNameI = NoExtField
type instance XXHsOuterTyVarBndrs DocNameI = DataConCantHappen
type instance XHsSig DocNameI = NoExtField
type instance XXHsSigType DocNameI = DataConCantHappen
type instance XHsQTvs DocNameI = NoExtField
type instance XConDeclField DocNameI = NoExtField
type instance XXConDeclField DocNameI = DataConCantHappen
type instance XXPat DocNameI = DataConCantHappen
type instance XXHsBindsLR DocNameI a = DataConCantHappen
type instance XSplicePat DocNameI = DataConCantHappen
type instance XCInjectivityAnn DocNameI = NoExtField
type instance XCFunDep DocNameI = NoExtField
type instance XCTyFamInstDecl DocNameI = NoExtField
instance NFData RdrName where
rnf :: RdrName -> ()
rnf (Unqual OccName
on) = OccName -> ()
forall a. NFData a => a -> ()
rnf OccName
on
rnf (Qual ModuleName
mn OccName
on) = ModuleName
mn ModuleName -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` OccName
on OccName -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
rnf (Orig Module
m OccName
on) = Module
m Module -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` OccName
on OccName -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
rnf (Exact Name
n) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
n
instance NFData FixityDirection where
rnf :: FixityDirection -> ()
rnf FixityDirection
InfixL = ()
rnf FixityDirection
InfixR = ()
rnf FixityDirection
InfixN = ()
instance NFData Fixity where
rnf :: Fixity -> ()
rnf (Fixity Int
n FixityDirection
dir) =
Int
n Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` FixityDirection
dir FixityDirection -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData (EpAnn NameAnn) where
rnf :: EpAnn NameAnn -> ()
rnf (EpAnn EpaLocation
en NameAnn
ann EpAnnComments
cs) = EpaLocation
en EpaLocation -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` NameAnn
ann NameAnn -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` EpAnnComments
cs EpAnnComments -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData NameAnn where
rnf :: NameAnn -> ()
rnf (NameAnn NameAdornment
a EpaLocation
b [TrailingAnn]
c) =
NameAdornment
a NameAdornment -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
EpaLocation
b EpaLocation -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
c [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnCommas NameAdornment
a [EpToken ","]
b [TrailingAnn]
c) =
NameAdornment
a NameAdornment -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[EpToken ","]
b [EpToken ","] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
c [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnBars (EpToken "(#", EpToken "#)")
a [EpToken "|"]
b [TrailingAnn]
c) =
(EpToken "(#", EpToken "#)")
a (EpToken "(#", EpToken "#)") -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[EpToken "|"]
b [EpToken "|"] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
c [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnOnly NameAdornment
a [TrailingAnn]
b) =
NameAdornment
a NameAdornment -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
b [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnRArrow Maybe (EpToken "(")
a TokRarrow
b Maybe (EpToken ")")
c [TrailingAnn]
d) =
Maybe (EpToken "(")
a Maybe (EpToken "(") -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
TokRarrow
b TokRarrow -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
Maybe (EpToken ")")
c Maybe (EpToken ")") -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
d [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnQuote EpToken "'"
a EpAnn NameAnn
b [TrailingAnn]
c) =
EpToken "'"
a EpToken "'" -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
EpAnn NameAnn
b EpAnn NameAnn -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
[TrailingAnn]
c [TrailingAnn] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq`
()
rnf (NameAnnTrailing [TrailingAnn]
a) = [TrailingAnn] -> ()
forall a. NFData a => a -> ()
rnf [TrailingAnn]
a
instance NFData TrailingAnn where
rnf :: TrailingAnn -> ()
rnf (AddSemiAnn EpToken ";"
epaL) = EpToken ";" -> ()
forall a. NFData a => a -> ()
rnf EpToken ";"
epaL
rnf (AddCommaAnn EpToken ","
epaL) = EpToken "," -> ()
forall a. NFData a => a -> ()
rnf EpToken ","
epaL
rnf (AddVbarAnn EpToken "|"
epaL) = EpToken "|" -> ()
forall a. NFData a => a -> ()
rnf EpToken "|"
epaL
rnf (AddDarrowAnn TokDarrow
epaL) = TokDarrow -> ()
forall a. NFData a => a -> ()
rnf TokDarrow
epaL
instance NFData NameAdornment where
rnf :: NameAdornment -> ()
rnf (NameParens EpToken "("
o EpToken ")"
c) = EpToken "("
o EpToken "(" -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` EpToken ")"
c EpToken ")" -> () -> ()
forall a b. a -> b -> b
`seq` ()
rnf (NameParensHash EpToken "(#"
o EpToken "#)"
c) = EpToken "(#"
o EpToken "(#" -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` EpToken "#)"
c EpToken "#)" -> () -> ()
forall a b. a -> b -> b
`seq` ()
rnf (NameBackquotes EpToken "`"
o EpToken "`"
c) = EpToken "`"
o EpToken "`" -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` EpToken "`"
c EpToken "`" -> () -> ()
forall a b. a -> b -> b
`seq` ()
rnf (NameSquare EpToken "["
o EpToken "]"
c) = EpToken "["
o EpToken "[" -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` EpToken "]"
c EpToken "]" -> () -> ()
forall a b. a -> b -> b
`seq` ()
rnf NameAdornment
NameNoAdornment = ()
instance NFData NoComments where
rnf :: NoComments -> ()
rnf NoComments
NoComments = ()
instance NFData a => NFData (EpaLocation' a) where
rnf :: EpaLocation' a -> ()
rnf (EpaSpan SrcSpan
ss) = SrcSpan -> ()
forall a. NFData a => a -> ()
rnf SrcSpan
ss
rnf (EpaDelta SrcSpan
ss DeltaPos
dp a
lc) = SrcSpan
ss SrcSpan -> () -> ()
forall a b. a -> b -> b
`seq` DeltaPos
dp DeltaPos -> () -> ()
forall a b. a -> b -> b
`seq` a
lc a -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData EpAnnComments where
rnf :: EpAnnComments -> ()
rnf (EpaComments [LEpaComment]
cs) = [LEpaComment] -> ()
forall a. NFData a => a -> ()
rnf [LEpaComment]
cs
rnf (EpaCommentsBalanced [LEpaComment]
cs1 [LEpaComment]
cs2) = [LEpaComment]
cs1 [LEpaComment] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` [LEpaComment]
cs2 [LEpaComment] -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData EpaComment where
rnf :: EpaComment -> ()
rnf (EpaComment EpaCommentTok
t RealSrcSpan
rss) = EpaCommentTok
t EpaCommentTok -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` RealSrcSpan
rss RealSrcSpan -> () -> ()
forall a b. a -> b -> b
`seq` ()
instance NFData EpaCommentTok where
rnf :: EpaCommentTok -> ()
rnf (EpaDocComment HsDocString
ds) = HsDocString -> ()
forall a. NFData a => a -> ()
rnf HsDocString
ds
rnf (EpaDocOptions FilePath
s) = FilePath -> ()
forall a. NFData a => a -> ()
rnf FilePath
s
rnf (EpaLineComment FilePath
s) = FilePath -> ()
forall a. NFData a => a -> ()
rnf FilePath
s
rnf (EpaBlockComment FilePath
s) = FilePath -> ()
forall a. NFData a => a -> ()
rnf FilePath
s
instance NFData a => NFData (Strict.Maybe a) where
rnf :: Maybe a -> ()
rnf Maybe a
Strict.Nothing = ()
rnf (Strict.Just a
x) = a -> ()
forall a. NFData a => a -> ()
rnf a
x
instance NFData BufSpan where
rnf :: BufSpan -> ()
rnf (BufSpan BufPos
p1 BufPos
p2) = BufPos
p1 BufPos -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` BufPos
p2 BufPos -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData BufPos where
rnf :: BufPos -> ()
rnf (BufPos Int
n) = Int -> ()
forall a. NFData a => a -> ()
rnf Int
n
instance NFData DeltaPos where
rnf :: DeltaPos -> ()
rnf (SameLine Int
n) = Int -> ()
forall a. NFData a => a -> ()
rnf Int
n
rnf (DifferentLine Int
n Int
m) = Int
n Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` Int
m Int -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
instance NFData (EpToken tok) where
rnf :: EpToken tok -> ()
rnf (EpTok EpaLocation
l) = EpaLocation -> ()
forall a. NFData a => a -> ()
rnf EpaLocation
l
rnf EpToken tok
NoEpTok = ()
instance NFData (EpUniToken tok toku) where
rnf :: EpUniToken tok toku -> ()
rnf (EpUniTok EpaLocation
l IsUnicodeSyntax
s) = EpaLocation
l EpaLocation -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` IsUnicodeSyntax
s IsUnicodeSyntax -> () -> ()
forall a b. NFData a => a -> b -> b
`deepseq` ()
rnf EpUniToken tok toku
NoEpUniTok = ()
instance NFData IsUnicodeSyntax where
rnf :: IsUnicodeSyntax -> ()
rnf IsUnicodeSyntax
NormalSyntax = ()
rnf IsUnicodeSyntax
UnicodeSyntax = ()