Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 2ccd8e1

Browse files
committed
Show the matched thing, not the rule that matched it.
1 parent 1f74e60 commit 2ccd8e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Assigning/Assignment.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ instance MonadFail (Assignment ast grammar) where
356356
fail :: HasCallStack => String -> Assignment ast grammar a
357357
fail s = tracing (Fail s) `Then` pure
358358

359-
instance (Enum grammar, Eq1 ast, Ix grammar, Show grammar, Show1 ast) => Parsing (Assignment ast grammar) where
359+
instance (Enum grammar, Eq1 ast, Ix grammar, Show grammar) => Parsing (Assignment ast grammar) where
360360
try = id
361361

362362
(<?>) :: HasCallStack => Assignment ast grammar a -> String -> Assignment ast grammar a
@@ -369,7 +369,7 @@ instance (Enum grammar, Eq1 ast, Ix grammar, Show grammar, Show1 ast) => Parsing
369369
eof = tracing End `Then` pure
370370

371371
notFollowedBy :: (HasCallStack, Show a) => Assignment ast grammar a -> Assignment ast grammar ()
372-
notFollowedBy a = a *> unexpected (show a) <|> pure ()
372+
notFollowedBy a = (a >>= unexpected . show) <|> pure ()
373373

374374
instance (Enum grammar, Eq1 ast, Ix grammar, Show grammar) => MonadError (Error (Either String grammar)) (Assignment ast grammar) where
375375
throwError :: HasCallStack => Error (Either String grammar) -> Assignment ast grammar a

0 commit comments

Comments
 (0)