on master help sign in
Use the common setup section in ParserK
71487abHarendra Kumar
core/src/Streamly/Data/ParserK.hs+1−9
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1-- |
2-- |
2-- Module : Streamly.Data.ParserK
3-- Module : Streamly.Data.ParserK
3-- Copyright : (c) 2023 Composewell Technologies
4-- Copyright : (c) 2023 Composewell Technologies
@@ -45,15 +46,6 @@
45-- Monad composition can be used for lookbehind parsers, we can dynamically
46-- Monad composition can be used for lookbehind parsers, we can dynamically
46-- compose new parsers based on the results of the previously parsed values.
47-- compose new parsers based on the results of the previously parsed values.
47--
48--
48−-- >>> :m
49−-- >>> import Control.Applicative ((<|>))
50−-- >>> import Data.Char (isDigit, isAlpha)
51−-- >>> import Streamly.Data.Parser (Parser)
52−-- >>> import Streamly.Data.ParserK (ParserK)
53−-- >>> import qualified Streamly.Data.Parser as Parser
54−-- >>> import qualified Streamly.Data.ParserK as ParserK
55−-- >>> import qualified Streamly.Internal.Data.ParserK as ParserK (adapt)
56−--
57-- If we have to parse "a9" or "9a" but not "99" or "aa" we can use the
49-- If we have to parse "a9" or "9a" but not "99" or "aa" we can use the
58-- following non-monadic, backtracking parser:
50-- following non-monadic, backtracking parser:
59--
51--