GHC.Hs.Doc

ghc-8.10.4: The GHC API

Safe Haskell | None
Language | Haskell2010

GHC.Hs.Doc

Synopsis

- data HsDocString
- type LHsDocString = Located HsDocString
- mkHsDocString :: String -> HsDocString
- mkHsDocStringUtf8ByteString :: ByteString -> HsDocString
- unpackHDS :: HsDocString -> String
- hsDocStringToByteString :: HsDocString -> ByteString
- ppr_mbDoc :: Maybe LHsDocString -> SDoc
- appendDocs :: HsDocString -> HsDocString -> HsDocString
- concatDocs :: [HsDocString] -> Maybe HsDocString
- newtype DeclDocMap = DeclDocMap (Map Name HsDocString)
- emptyDeclDocMap :: DeclDocMap
- newtype ArgDocMap = ArgDocMap (Map Name (Map Int HsDocString))
- emptyArgDocMap :: ArgDocMap

# Documentation

data HsDocString #

Haskell Documentation String

Internally this is a UTF8-Encoded `ByteString`.

#### Instances

Instances details

Eq HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods (==) :: HsDocString -> HsDocString -> Bool # (/=) :: HsDocString -> HsDocString -> Bool #
Data HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsDocString -> c HsDocString Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsDocString Source # toConstr :: HsDocString -> Constr Source # dataTypeOf :: HsDocString -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsDocString) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsDocString) Source # gmapT :: (forall b. Data b => b -> b) -> HsDocString -> HsDocString Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsDocString -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsDocString -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsDocString -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsDocString -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsDocString -> m HsDocString Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsDocString -> m HsDocString Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsDocString -> m HsDocString Source #
Show HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods showsPrec :: Int -> HsDocString -> ShowS Source # show :: HsDocString -> String Source # showList :: [HsDocString] -> ShowS Source #
Outputable HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods ppr :: HsDocString -> SDoc # pprPrec :: Rational -> HsDocString -> SDoc #
Binary HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> HsDocString -> IO () # put :: BinHandle -> HsDocString -> IO (Bin HsDocString) # get :: BinHandle -> IO HsDocString #

type LHsDocString = Located HsDocString #

Located Haskell Documentation String

mkHsDocString :: String -> HsDocString #

mkHsDocStringUtf8ByteString :: ByteString -> HsDocString #

Create a `HsDocString` from a UTF8-encoded `ByteString`.

unpackHDS :: HsDocString -> String #

hsDocStringToByteString :: HsDocString -> ByteString #

Return the contents of a `HsDocString` as a UTF8-encoded `ByteString`.

ppr_mbDoc :: Maybe LHsDocString -> SDoc #

appendDocs :: HsDocString -> HsDocString -> HsDocString #

Join two docstrings.

Non-empty docstrings are joined with two newlines in between, resulting in separate paragraphs.

concatDocs :: [HsDocString] -> Maybe HsDocString #

Concat docstrings with two newlines in between.

Empty docstrings are skipped.

If all inputs are empty, `Nothing` is returned.

newtype DeclDocMap #

Docs for declarations: functions, data types, instances, methods etc.

Constructors

DeclDocMap (Map Name HsDocString) |

#### Instances

Instances details

Outputable DeclDocMap # |
Instance details Defined in GHC.Hs.Doc Methods ppr :: DeclDocMap -> SDoc # pprPrec :: Rational -> DeclDocMap -> SDoc #
Binary DeclDocMap # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> DeclDocMap -> IO () # put :: BinHandle -> DeclDocMap -> IO (Bin DeclDocMap) # get :: BinHandle -> IO DeclDocMap #

emptyDeclDocMap :: DeclDocMap #

newtype ArgDocMap #

Docs for arguments. E.g. function arguments, method arguments.

Constructors

ArgDocMap (Map Name (Map Int HsDocString)) |

#### Instances

Instances details

Outputable ArgDocMap # |
Instance details Defined in GHC.Hs.Doc Methods ppr :: ArgDocMap -> SDoc # pprPrec :: Rational -> ArgDocMap -> SDoc #
Binary ArgDocMap # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> ArgDocMap -> IO () # put :: BinHandle -> ArgDocMap -> IO (Bin ArgDocMap) # get :: BinHandle -> IO ArgDocMap #

emptyArgDocMap :: ArgDocMap #