haddock-library-1.0.1: Library exposing some functionality of Haddock.

Portabilityportable
Stabilityexperimental
Maintainerhaddock@projects.haskell.org
Safe HaskellNone

Documentation.Haddock.Parser

Description

Parser used for Haddock comments. For external users of this library, the most commonly used combination of functions is going to be

toRegular . parseParas

Synopsis

Documentation

parseString :: String -> DocH mod IdentifierSource

Parse a text paragraph. Actually just a wrapper over parseStringBS which drops leading whitespace and encodes the string to UTF8 first.

parseParasSource

Arguments

:: String

String to parse

-> DocH mod Identifier 

Main entry point to the parser. Appends the newline character to the input string.

overIdentifier :: (String -> Maybe a) -> DocH mod Identifier -> DocH mod aSource

Maps over DocIdentifiers over String with potentially failing conversion using user-supplied function. If the conversion fails, the identifier is deemed to not be valid and is treated as a regular string.

toRegular :: DocH mod Identifier -> DocH mod StringSource

Drops the quotes/backticks around all identifiers, as if they were valid but still Strings.

type Identifier = (Char, String, Char)Source

Identifier string surrounded with opening and closing quotes/backticks.