diff options
Diffstat (limited to 'compiler/GHC/Rename/Doc.hs')
-rw-r--r-- | compiler/GHC/Rename/Doc.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler/GHC/Rename/Doc.hs b/compiler/GHC/Rename/Doc.hs new file mode 100644 index 0000000000..2f6a796196 --- /dev/null +++ b/compiler/GHC/Rename/Doc.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE ViewPatterns #-} + +module GHC.Rename.Doc ( rnHsDoc, rnLHsDoc, rnMbLHsDoc ) where + +import GhcPrelude + +import TcRnTypes +import GHC.Hs +import 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 |