You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
Thank you all again for all your work on this excellent package.
I wrote instances for universe's Universe and Finite classes for the These a b type.
If you are interested in having support for these instances included then please let me know, I would gladly make a PR.
The code is pretty straight forward.
importControl.Applicative (liftA2)
importData.Tagged (Tagged (..), retag)
importData.Universe (Finite (..), Universe (..))
importNumeric.Natural (Natural)
toThese::Either (Eitherab) (a, b) ->Theseab
toThese =either (eitherThisThat) (uncurryThese)
instance (Universea, Universeb) =>Universe (Theseab) whereuniverse:: [Theseab]
universe =fmap toThese universe
instance (Finitea, Finiteb) =>Finite (Theseab) where-- a + b + abcardinality::Tagged (Theseab) Natural
cardinality = liftA2 (\a b -> a + b + a * b) (retag (cardinality ::TaggedaNatural))
(retag (cardinality ::TaggedbNatural))
universeF:: [Theseab]
universeF =fmap toThese universeF
If you are not comfortable with the name toThese then it can simply be inlined to avoid giving it a name, or I am open to suggestions for a different name :)
If you are not interested then I won't take offense and please close the ticket; any feedback is certainly welcomed. Thank you for your time and consideration.
The text was updated successfully, but these errors were encountered:
Hello!
Thank you all again for all your work on this excellent package.
I wrote instances for
universe
'sUniverse
andFinite
classes for theThese a b
type.If you are interested in having support for these instances included then please let me know, I would gladly make a PR.
The code is pretty straight forward.
If you are not comfortable with the name
toThese
then it can simply be inlined to avoid giving it a name, or I am open to suggestions for a different name :)Here are some example usages in GHCi:
If you are not interested then I won't take offense and please close the ticket; any feedback is certainly welcomed. Thank you for your time and consideration.
The text was updated successfully, but these errors were encountered: