Skip to content
Snippets Groups Projects
Commit b91c2ae9 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Speed up Lexer.signed

`L.signed L.decimal` now has minimal overhead over L.decimal on it's
own. We did sacrifice the possibility to write a (redundant) `+` sign
or white space between the minus and the number.
parent b7d3c264
No related branches found
No related tags found
No related merge requests found
......@@ -94,5 +94,5 @@ float = lexeme L.float
{-# INLINE float #-}
signed :: (MonadParser m, Num a) => m a -> m a
signed = L.signed spaceConsumer
signed p = option id (char '-' *> return negate) <*> p
{-# INLINE signed #-}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment