emilypi / smash

Smash products, Wedge products, and other Pointed stuff
34 stars 11 forks source link

Add `These` to this library #9

Open emilypi opened 4 years ago

emilypi commented 4 years ago

Let's complete the picture and just add These here. Here is the following checklist:

masaeedu commented 4 years ago

we could name it something else like Ior for "inclusive or" to avoid this.

I am strongly in favor of names that facilitate Eeyore puns

eeyore

emilypi commented 4 years ago

Omg I never noticed that until now. I always say "eye-or" not "ee-or"! 😆

subttle commented 3 years ago

Hi, just a suggestion that would perhaps ease the merging would be to implement instances for https://hackage.haskell.org/package/assoc (because this is how it's done in the these package), so for example:

-- Data.Smash
import Data.Bifunctor.Swap
import Data.Bifunctor.Assoc

instance Swap Smash where
  swap = swapSmash
instance Assoc Smash where
  assoc = reassocLR
  unassoc = reassocRL
-- Data.Can
import Data.Bifunctor.Swap
import Data.Bifunctor.Assoc

instance Swap Can where
  swap = swapCan
instance Assoc Can where
  assoc = reassocLR
  unassoc = reassocRL
-- Data.Wedge
import Data.Bifunctor.Swap
import Data.Bifunctor.Assoc

instance Swap Wedge where
  swap = swapWedge

instance Assoc Wedge where
  assoc = reassocLR
  unassoc = reassocRL

Feel free to ignore the suggestion, of course, just thought it may help. Have a nice day :)

masaeedu commented 3 years ago

Another alternative is https://github.com/masaeedu/monoidal, which has those classes plus a few more