Skip to content

Commit

Permalink
fix generate' so that mempty is included in the truncated list
Browse files Browse the repository at this point in the history
  • Loading branch information
emilypi committed Dec 7, 2020
1 parent f81584a commit 54c3ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/Group.hs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ generated' :: (Eq a, Cyclic a) => [a]
generated' = unfoldr go (generator, 0 :: Integer)
where
go (a, n)
| a == mempty, n > 0 = Nothing
| a == generator, n > 0 = Nothing
| otherwise = Just (a, (a <> generator, succ n))

instance Cyclic () where
Expand Down

0 comments on commit 54c3ab5

Please sign in to comment.