update to work with GHC 8.4.1

This commit is contained in:
Michiel Derhaeg
2018-03-20 22:06:18 +01:00
parent 3d3e898166
commit 86595e193e
5 changed files with 33 additions and 5 deletions

View File

@@ -38,7 +38,8 @@ import Control.Monad(mplus)
import Data.Foldable(Foldable,foldMap, sum)
import Data.Function(on)
import Data.List(sortBy)
import Data.Monoid(Monoid,mempty, mappend)
import Data.Monoid(Monoid,mempty, mappend, (<>))
import Data.Semigroup
-- $usage
@@ -202,6 +203,9 @@ instance Monoid (Tree a) where
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
makeTree _ [x] = Leaf x