on master help sign in
Add Fuse annotation to parser constructors
ba08f9fHarendra Kumar
src/Streamly/Internal/Data/Parse/Types.hs+4
@@ -51,6 +51,8 @@ module Streamly.Internal.Data.Parse.Types
51 )
51 )
52where
52where
53
53
54+import Fusion.Plugin.Types (Fuse(..))
55+
54-- | The return type of a fold step. A fold is driven by a fold driver one step
56-- | The return type of a fold step. A fold is driven by a fold driver one step
55-- at a time, at any time the driver may @extract@ and examine the result of
57-- at a time, at any time the driver may @extract@ and examine the result of
56-- the fold. The fold may backtrack at any point, therefore, the driver holds
58-- the fold. The fold may backtrack at any point, therefore, the driver holds
@@ -64,6 +66,7 @@ where
64--
66--
65-- /Internal/
67-- /Internal/
66--
68--
69+{-# ANN type Step Fuse #-}
67data Step s =
70data Step s =
68 Hold s -- ^ Hold the current input in the buffer, the input is
71 Hold s -- ^ Hold the current input in the buffer, the input is
69 -- accepted tentatively, but the fold may later fail with the
72 -- accepted tentatively, but the fold may later fail with the
@@ -116,6 +119,7 @@ instance Monad m => Functor (Parse m a) where
116 {-# INLINE (<$) #-}
119 {-# INLINE (<$) #-}
117 (<$) b = \_ -> pure b
120 (<$) b = \_ -> pure b
118
121
122+{-# ANN type SeqParseState Fuse #-}
119data SeqParseState sl f sr =
123data SeqParseState sl f sr =
120 SeqParseL sl | SeqParseR f sr | SeqParseLErr String
124 SeqParseL sl | SeqParseR f sr | SeqParseLErr String
121
125