yesod-core: refactor the loop detector to not use Just wrapping

This commit is contained in:
Tom Sydney Kerckhove 2021-05-20 14:28:09 +02:00
parent 96a940b60c
commit 59ef730317

View File

@ -29,8 +29,8 @@ breadcrumbs = do
go back Nothing = return back
go back (Just this) = do
(title, next) <- breadcrumb this
if next `elem` (map (Just . fst) back)
if this `elem` map fst back
then
error $ "infinite recursion in breadcrumbs at" <> show title
error $ "yesod-core: infinite recursion in breadcrumbs at " <> show title
else
go ((this, title) : back) next