mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 04:31:52 -07:00
Fix -Wnoncanonical-monoid-instances warnings
This commit is contained in:
@@ -190,14 +190,13 @@ instance Functor Tree where
|
||||
fmap f (Branch l r) = Branch (fmap f l) (fmap f r)
|
||||
fmap _ Empty = Empty
|
||||
|
||||
instance Semigroup (Tree a) where
|
||||
Empty <> x = x
|
||||
x <> Empty = x
|
||||
x <> y = Branch x y
|
||||
|
||||
instance Monoid (Tree a) where
|
||||
mempty = Empty
|
||||
mappend Empty x = x
|
||||
mappend x Empty = x
|
||||
mappend x y = Branch x y
|
||||
|
||||
instance Semigroup (Tree a) where
|
||||
(<>) = mappend
|
||||
|
||||
makeTree :: (Num a1, Ord a1) => (a -> a1) -> [a] -> Tree a
|
||||
makeTree _ [] = Empty
|
||||
|
Reference in New Issue
Block a user