Last active
August 6, 2018 21:14
-
-
Save p1xelHer0/705e8dfc9aeeed9337c09e3883bba801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Two a b = | |
Two a | |
b | |
deriving (Eq, Show) | |
instance (Semigroup a, Semigroup b) => | |
Semigroup (Two a b) where | |
(Two x1 y1) <> (Two x2 y2) = Two (x1 M.<> x2) (y1 M.<> y2) | |
instance (Monoid a, Semigroup a, Monoid b, Semigroup b) => | |
Monoid (Two a b) where | |
mempty = Two mempty mempty | |
mappend = (S.<>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment