haskellari / lattices

Fine-grained lattice primitives for Haskell
BSD 3-Clause "New" or "Revised" License
35 stars 15 forks source link

Make joins1, meets1 work over Foldable1 #39

Closed Icelandjack closed 7 years ago

Icelandjack commented 7 years ago

This would add a semigroupoid dependency and break compatibility but consider making join1 and meet1 work over Foldable1

joins1 :: (Foldable1 f, JoinSemiLattice j) => f j -> j
meets1 :: (Foldable1 f, MeetSemiLattice m) => f m -> m

Even adding functions in the style of sumWith1, productWith1

joinsMap1 :: (Foldable1 f, JoinSemiLattice j) => (a -> j) -> (f a -> j)
meetsMap1 :: (Foldable1 f, MeetSemiLattice m) => (a -> m) -> (f a -> m)