Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing FromList instance for NonEmpty #264

Open
Martoon-00 opened this issue May 2, 2022 · 2 comments
Open

Consider removing FromList instance for NonEmpty #264

Martoon-00 opened this issue May 2, 2022 · 2 comments
Assignees
Labels
type:breaking Breaking change (removal, renaming, semantic change, etc.)

Comments

@Martoon-00
Copy link
Member

In #238 I have added FromList typeclass with fromList that behaves very similar to GHC.Exts.IsList.fromList.

And it is defined for NonEmpty too. This means that the following code:

a = fromList [] :: NonEmpty a

as well as the following code:

{-# LANGUAGE OverloadedLists #-}

a = [] :: NonEmpty a

will fail. However, unlike in IsList, currently we will have a callstack attached to the error.

We should consider pros and cons of removing this instance.

@Martoon-00 Martoon-00 added the type:breaking Breaking change (removal, renaming, semantic change, etc.) label May 2, 2022
@treeowl
Copy link

treeowl commented May 2, 2022

I'm not really a fan of such an instance myself. It's not hard to just use the constructor properly instead.

@Martoon-00 Martoon-00 mentioned this issue May 2, 2022
9 tasks
@Martoon-00
Copy link
Member Author

I also agree that removing the instance would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:breaking Breaking change (removal, renaming, semantic change, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants