Skip to content

Commit

Permalink
fix(docs): GHC 8.10 couldn't compile function docs with -- | annotati…
Browse files Browse the repository at this point in the history
…ons on types
  • Loading branch information
david-davies committed Dec 2, 2024
1 parent 4cb32ed commit 5cd9651
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
11 changes: 4 additions & 7 deletions src/Text/Gigaparsec/Internal/Token/Patterns/IntegerParsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,10 @@ lexerUnboundedParsers lexer (IntegerParserConfig{signedOrUnsigned = s, prefix, b
mkLexerCombinatorDecWithProj lexer (prefix ++ nameBase p) p (pure newTp) proj
)

lexerFixedWidthIntParsers ::
-- | The quoted lexer
Q Exp ->
-- | config
IntegerParserConfig ->
-- | Name, bitwidth and def of each generated combinator.
Q [(Name, Bits, [Dec])]
lexerFixedWidthIntParsers
:: Q Exp -- ^ The quoted lexer
-> IntegerParserConfig -- ^ config
-> Q [(Name, Bits, [Dec])] -- ^ Name, bitwidth and def of each generated combinator.
lexerFixedWidthIntParsers
lexer
(IntegerParserConfig{signedOrUnsigned = sign, prefix, bases, widths}) =
Expand Down
30 changes: 10 additions & 20 deletions src/Text/Gigaparsec/Internal/Token/Patterns/LexerCombinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,10 @@ Constructs the combinator using the given type.
Calculates the definition of the combinator using a typeclass (if possible).
-}
mkLexerCombinatorDec
-- | The quoted Lexer
:: Q Exp
-- | The name of the combinator to generate
-> String
-- | The quoted name of the original combinator
-> Name
-- | The return type of the new combinator
-> Type
:: Q Exp -- ^ The quoted Lexer
-> String -- ^ The name of the combinator to generate
-> Name -- ^ The quoted name of the original combinator
-> Type -- ^ The return type of the new combinator
-> Q [Dec]
mkLexerCombinatorDec lexer nm old tp = do
newX <- newName nm
Expand All @@ -180,18 +176,12 @@ Constructs the combinator using the given type.
Calculates the definition of the combinator using the `LexerField` typeclass (if possible).
-}
mkLexerCombinatorDecWithProj
-- | The quoted Lexer
:: Q Exp
-- | The name of the combinator to generate
-> String
-- | @old@, The quoted name of the original combinator
-> Name
-- | The return type of the new combinator
-> Q Type
-- | projection to precompose the @old@ combinator with
-> Q Exp
-- | The name of the new combinator and its declaration
-> Q (Name, [Dec])
:: Q Exp -- ^ The quoted Lexer
-> String -- ^ The name of the combinator to generate
-> Name -- ^ @old@, The quoted name of the original combinator
-> Q Type -- ^ The return type of the new combinator
-> Q Exp -- ^ projection to precompose the @old@ combinator with
-> Q (Name, [Dec]) -- ^ The name of the new combinator and its declaration
mkLexerCombinatorDecWithProj lexer nm old tp proj = do
newX <- newName nm
oldDocs <- getDoc (DeclDoc old)
Expand Down

0 comments on commit 5cd9651

Please sign in to comment.