Skip to content

Commit

Permalink
simpler constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 6, 2024
1 parent a503f0b commit 5a39ea1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion solutions/src/2024/06.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ walk grid d p =

-- | Predicate for paths that loop instead of running off the edge of the map.
-- <https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare>
isLoop :: Ord a => [a] -> Bool
isLoop :: Eq a => [a] -> Bool
isLoop a = go a a
where
go (x:xs) (_:y:ys) = x == y || go xs ys
Expand Down

0 comments on commit 5a39ea1

Please sign in to comment.