Skip to content

Commit 0908f77

Browse files
committed
Add an example to make a scientific parser
1 parent afcc8ea commit 0908f77

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/Streamly/Internal/Unicode/Parser.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ data ScientificParseState
290290
-- exponent) tuple. The result can be mapped to 'Double' or any other number
291291
-- representation e.g. @Scientific@.
292292
--
293+
-- For example, using the @scientific@ package:
294+
-- >> parserScientific = uncurry Data.Scientific.scientific <$> 'number'
293295
{-# INLINE number #-}
294296
number :: Monad m => Parser Char m (Integer, Int)
295297
number = Parser (\s a -> return $ step s a) initial (return . extract)

0 commit comments

Comments
 (0)