intersections [] = empty is unacceptable to me. The options that make sense to me are the nonempty (ideally Foldable1) one, one producing a Maybe, and I guess even one that throws an error on an empty list (ouch).

On Sun, Dec 6, 2020, 1:50 PM Sven Panne <svenpanne@gmail.com> wrote:
Am So., 6. Dez. 2020 um 07:20 Uhr schrieb Reed Mullanix <reedmullanix@gmail.com>:
[...]
  intersections :: Ord a => NonEmpty (Set a) -> Set a
  intersections (s :| ss) = Foldable.foldl' intersection s ss
[...]

Why NonEmpty? I would expect "intersections [] = Set.empty", because the result contains all the elements which are in all sets, i.e. none. That's at least my intuition, is there some law which this would violate? 
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries