Open Martoon-00 opened 2 years ago
In #238 I have added FromList typeclass with fromList that behaves very similar to GHC.Exts.IsList.fromList.
FromList
fromList
GHC.Exts.IsList.fromList
And it is defined for NonEmpty too. This means that the following code:
NonEmpty
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.
IsList
We should consider pros and cons of removing this instance.
I'm not really a fan of such an instance myself. It's not hard to just use the constructor properly instead.
I also agree that removing the instance would be better.
In #238 I have added
FromList
typeclass withfromList
that behaves very similar toGHC.Exts.IsList.fromList
.And it is defined for
NonEmpty
too. This means that the following code:as well as the following code:
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.