summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Doc.hs
blob: bd9fd60b732ee0b018aa44354b871a77ec1e00f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE ViewPatterns #-}

module GHC.Rename.Doc ( rnHsDoc, rnLHsDoc, rnMbLHsDoc ) where

import GhcPrelude

import GHC.Tc.Types
import GHC.Hs
import GHC.Types.SrcLoc


rnMbLHsDoc :: Maybe LHsDocString -> RnM (Maybe LHsDocString)
rnMbLHsDoc mb_doc = case mb_doc of
  Just doc -> do
    doc' <- rnLHsDoc doc
    return (Just doc')
  Nothing -> return Nothing

rnLHsDoc :: LHsDocString -> RnM LHsDocString
rnLHsDoc (L pos doc) = do
  doc' <- rnHsDoc doc
  return (L pos doc')

rnHsDoc :: HsDocString -> RnM HsDocString
rnHsDoc = pure