From a0d1e3da52eb418a1cd160f8fab23d3c77f78140 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Thu, 18 Jun 2020 15:50:31 -0700 Subject: [PATCH] fix monoid definition, remove obsolete version bounds --- djembe.cabal | 8 ++++---- src/Types.hs | 6 ++++-- stack.yaml | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/djembe.cabal b/djembe.cabal index 5ff413a..b9e2241 100644 --- a/djembe.cabal +++ b/djembe.cabal @@ -22,12 +22,12 @@ library Drum -- other-modules: -- other-extensions: - build-depends: base >=4.6 && <4.9 - ,lens >=4.7 && <4.14 + build-depends: base + ,lens ,hmidi >= 0.2.1 && <3.0 ,random >=1.0 && <1.2 - ,QuickCheck >=2.7 && <2.9 - ,hspec >=2.1 && <2.3 + ,QuickCheck + ,hspec ,mtl hs-source-dirs: src default-language: Haskell2010 diff --git a/src/Types.hs b/src/Types.hs index df646d9..da5a902 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -107,10 +107,12 @@ instance Monad Composition where let (Composition (b', a')) = k a in Composition (Series b b', a') +instance Semigroup (Composition ()) where + (Composition (b1, _)) <> (Composition (b2, _)) + = Composition (Parallel b1 b2, ()) + instance Monoid (Composition ()) where mempty = Composition (None, ()) - mappend (Composition (b1, _)) (Composition (b2, _)) - = Composition (Parallel b1 b2, ()) -- | Lift a function on `Hit`s over a `Composition` cmap :: (Hit -> Hit) -> Composition a -> Composition a diff --git a/stack.yaml b/stack.yaml index 69cd063..796a9e2 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,5 @@ flags: {} packages: - '.' -extra-deps: [hmidi-0.2.2.0] -resolver: lts-2.22 +extra-deps: [hmidi-0.2.2.1] +resolver: lts-16.1