From 20eb2317c3bf8c802bc0296c36ee6c3bf4490f2a Mon Sep 17 00:00:00 2001 From: Luke Worth Date: Sun, 1 Jan 2017 11:45:32 +1100 Subject: [PATCH] Compile with lts-7.14 --- music-score.cabal | 10 +++++----- src/Data/PairMonad.hs | 5 ----- src/Data/Semigroup/Instances.hs | 11 ----------- src/Music/Score/Export/Lilypond.hs | 1 + src/Music/Time/Event.hs | 8 -------- src/Music/Time/Meta.hs | 10 ++++++++++ src/Music/Time/Voice.hs | 1 + 7 files changed, 17 insertions(+), 29 deletions(-) diff --git a/music-score.cabal b/music-score.cabal index 9759ab6..fc1198c 100755 --- a/music-score.cabal +++ b/music-score.cabal @@ -22,23 +22,23 @@ source-repository head library build-depends: base >= 4 && < 5, - base-orphans >= 0.1 && < 0.4, + base-orphans >= 0.1 && < 0.6, aeson >= 0.7.0.6 && < 1, lens >= 4.11 && < 5, - process >= 1.2 && < 1.3, + process >= 1.2 && < 1.5, containers, nats, average >= 0.6.1 && < 1, semigroups >= 0.13.0.1 && < 1, - comonad >= 4.2.2 && < 5, + comonad >= 4.2.2 && < 6, contravariant >= 1.2 && < 2, bifunctors >= 5 && < 6, -- profunctors >= 4.2.0.1 && < 5, distributive >= 0.4.4 && < 5, adjunctions >= 4.2 && < 5, mtl >= 2.1.3.1 && < 3, - transformers >= 0.4.3.0 && < 0.5, - transformers-compat >= 0.4.0.4 && < 0.5, + transformers >= 0.4.3.0 && < 0.6, + transformers-compat >= 0.4.0.4 && < 0.6, monadplus, NumInstances, colour >= 2.3.3 && < 3.0, diff --git a/src/Data/PairMonad.hs b/src/Data/PairMonad.hs index 4cd0444..7d6df52 100644 --- a/src/Data/PairMonad.hs +++ b/src/Data/PairMonad.hs @@ -17,11 +17,6 @@ import Data.Monoid import Data.Foldable import Data.Traversable --- Equivalent to the Monad Writer instance. -instance Monoid o => Monad ((,) o) where - return = pure - (o,a) >>= f = (o `mappend` o', a') where (o',a') = f a - -- #ifndef __HAS_LENS__ -- deriving instance Foldable ((,) o) -- deriving instance Traversable ((,) o) diff --git a/src/Data/Semigroup/Instances.hs b/src/Data/Semigroup/Instances.hs index 9ba6c63..6634269 100644 --- a/src/Data/Semigroup/Instances.hs +++ b/src/Data/Semigroup/Instances.hs @@ -49,17 +49,6 @@ deriving instance IsDynamics a => IsDynamics (Product a) deriving instance IsPitch a => IsPitch (Sum a) deriving instance IsPitch a => IsPitch (Product a) -deriving instance Functor Product -instance Applicative Product where - pure = Product - Product f <*> Product x = Product (f x) - -deriving instance Functor Sum -instance Applicative Sum where - pure = Sum - Sum f <*> Sum x = Sum (f x) - - {- deriving instance Floating a => Floating (Product a) instance Num a => Num (Product a) where diff --git a/src/Music/Score/Export/Lilypond.hs b/src/Music/Score/Export/Lilypond.hs index 08b39a9..daa217f 100644 --- a/src/Music/Score/Export/Lilypond.hs +++ b/src/Music/Score/Export/Lilypond.hs @@ -6,6 +6,7 @@ {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} diff --git a/src/Music/Time/Event.hs b/src/Music/Time/Event.hs index 9654803..8140b7a 100644 --- a/src/Music/Time/Event.hs +++ b/src/Music/Time/Event.hs @@ -86,14 +86,6 @@ import Music.Time.Meta -- TODO move instance Traversable AddMeta where traverse = annotated -instance Eq1 AddMeta where - eq1 = (==) -instance Eq a => Eq1 (Couple a) where - eq1 = (==) -instance Ord1 AddMeta where - compare1 = compare -instance Ord a => Ord1 (Couple a) where - compare1 = compare instance Num (f (g a)) => Num (Compose f g a) where Compose a + Compose b = Compose (a + b) diff --git a/src/Music/Time/Meta.hs b/src/Music/Time/Meta.hs index 128f69b..1f876c2 100644 --- a/src/Music/Time/Meta.hs +++ b/src/Music/Time/Meta.hs @@ -75,6 +75,7 @@ import Control.Monad.Plus import Data.Foldable (Foldable) import qualified Data.Foldable as F import Data.Functor.Adjunction (unzipR) +import Data.Functor.Classes import Data.Functor.Couple import Data.Functor.Rep import qualified Data.List as List @@ -252,6 +253,15 @@ instance HasMeta (AddMeta a) where -- twain, pair, element meta = _Wrapped . _Wrapped . _1 +instance Eq1 AddMeta where + liftEq k (AddMeta (Twain (m,a))) (AddMeta (Twain (m',b))) = k a b +instance Eq a => Eq1 (Couple a) where + liftEq k (Couple (b,a)) (Couple (b',a')) = k a a' +instance Ord1 AddMeta where + liftCompare k (AddMeta (Twain (m,a))) (AddMeta (Twain (m',b))) = k a b +instance Ord a => Ord1 (Couple a) where + liftCompare k (Couple (b,a)) (Couple (b',a')) = k a a' + -- instance FunctorWithIndex i AddMeta where -- imap f = over annotated $ imap f diff --git a/src/Music/Time/Voice.hs b/src/Music/Time/Voice.hs index 4661e8c..95c6b26 100644 --- a/src/Music/Time/Voice.hs +++ b/src/Music/Time/Voice.hs @@ -11,6 +11,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} +{-# LANGUAGE FlexibleContexts #-} ------------------------------------------------------------------------------------- -- |