Skip to content

Commit

Permalink
Merge pull request #6 from emilypi/fix-generate
Browse files Browse the repository at this point in the history
Fix generate' so that mempty is included in the truncated list
  • Loading branch information
Taneb authored May 14, 2021
2 parents f81584a + 54c3ab5 commit 1d1ba2d
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 1d1ba2d

Please sign in to comment.