
27 Apr
2019
27 Apr
'19
6:07 p.m.
On Thu, Apr 18, 2019 at 11:49 PM Andreas Abel
We definitely should /not/ repeat the choice made for Data.List.NonEmpty.NonEmpty. Using non-empty lists /always/ requires a type synonym, like
import qualified Data.List.NonEmpty as NEList type NEList = NEList.NonEmpty
which is quite ugly, and type synonyms are sometimes expanded in GHC error messages, which causes additional trouble.
I’m not sure what you mean here by “always requires a type synonym”—I typically use NonEmpty like any other module meant to be imported qualified, like Text, Vector, Map, Set, &c.: import Data.List.NonEmpty (NonEmpty) import qualified Data.List.NonEmpty as NonEmpty -- or NE if I’m lazy example :: NonEmpty X -> Y