-
-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
questionFurther information is requestedFurther information is requested
Milestone
Description
To my big surprise, the cycle
function from base
is partial: it fails on empty lists
ghci> :t cycle
cycle :: [a] -> [a]
ghci> cycle []
*** Exception: Prelude.cycle: empty list
It's a bit problematic, since we don't want to expose partial functions. I see the following options:
- Don't reexport
cycle
. - Change its type to
NonEmpty a -> NonEmpty a
. - Reimplement manually by returning empty list when empty list is given.
@vrom911, what do you think?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested