containers: intersections for Set, along with Semigroup newtype

Ben Franksen ben.franksen at online.de
Sun Dec 20 22:05:39 UTC 2020


Am 06.12.20 um 19:58 schrieb Sven Panne:
> To me it's just the other way around: It violates aesthetics if it doesn't
> follow the mathematical definition in all cases, which is why I don't like
> NonEmpty here.

I think you've got that wrong.

  x `elem` intersections []
= {definition}
  forall xs in []. x `elem` xs
= {vacuous forall}
  true

Any proposition P(x) is true for all x in []. So the mathematical
definition of intersections::[Set a]-> Set a would not be the empty set
but the set of all x:a, which in general we have no way to construct.

Cheers
Ben



More information about the Libraries mailing list