Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/Scanner/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ instance Functor Scanner where

instance Applicative Scanner where
{-# INLINE pure #-}
pure = return
pure a = Scanner $ \bs next ->
next bs a
{-# INLINE (<*>) #-}
(<*>) = ap

Expand All @@ -57,10 +58,6 @@ instance Applicative Scanner where
s1 <* s2 = s1 >>= \a -> s2 >> return a

instance Monad Scanner where
{-# INLINE return #-}
return a = Scanner $ \bs next ->
next bs a

{-# INLINE (>>=) #-}
s1 >>= s2 = Scanner $ \bs next ->
run s1 bs $ \bs' a ->
Expand Down