tidal 0.9.7 → 0.9.8
raw patch · 4 files changed
+38/−9 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- Sound/Tidal/Parse.hs +12/−2
- Sound/Tidal/Pattern.hs +12/−2
- tests/test.hs +8/−2
- tidal.cabal +6/−3
Sound/Tidal/Parse.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances #-}+{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances, CPP #-} {-# LANGUAGE LambdaCase #-} module Sound.Tidal.Parse where@@ -12,7 +12,7 @@ import Data.Colour.SRGB import GHC.Exts( IsString(..) ) import Data.Monoid-import qualified Data.Semigroup as Sem+-- import qualified Data.Semigroup as Sem import Control.Exception as E import Control.Applicative ((<$>), (<*>), pure) import Data.Maybe@@ -21,6 +21,10 @@ import Sound.Tidal.Pattern import Sound.Tidal.Time (Arc, Time) +#ifdef TIDAL_SEMIGROUP+import qualified Data.Semigroup as Sem+#endif+ -- | AST representation of patterns data TPat a = TPat_Atom a@@ -40,12 +44,18 @@ | TPat_pE (TPat Int) (TPat Int) (TPat Integer) (TPat a) deriving (Show) +#ifdef TIDAL_SEMIGROUP instance Sem.Semigroup (TPat a) where (<>) = TPat_Overlay instance Parseable a => Monoid (TPat a) where mempty = TPat_Silence mappend = (<>)+#else+instance Parseable a => Monoid (TPat a) where+ mempty = TPat_Silence+ mappend = TPat_Overlay+#endif toPat :: Enumerable a => TPat a -> Pattern a toPat = \case
Sound/Tidal/Pattern.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveDataTypeable, CPP #-} {-# OPTIONS_GHC -Wall -fno-warn-orphans -fno-warn-name-shadowing #-} module Sound.Tidal.Pattern where@@ -23,7 +23,10 @@ import Text.Show.Functions () import qualified Control.Exception as E++#ifdef TIDAL_SEMIGROUP import qualified Data.Semigroup as Sem+#endif -- | The pattern datatype, a function from a time @Arc@ to @Event@ -- values. For discrete patterns, this returns the events which are@@ -162,14 +165,21 @@ (xs (s',e')) ) +#ifdef TIDAL_SEMIGROUP -- | @mappend@ a.k.a. @<>@ is a synonym for @overlay@. instance Sem.Semigroup (Pattern a) where (<>) = overlay --- | @mempty@ is a synonym for @silence@. instance Monoid (Pattern a) where mempty = silence mappend = (<>)++#else+-- | @mempty@ is a synonym for @silence@.+instance Monoid (Pattern a) where+ mempty = silence+ mappend = overlay+#endif instance Monad Pattern where return = pure
tests/test.hs view
@@ -13,7 +13,8 @@ main = defaultMain tests tests :: TestTree-tests = testGroup "Tests" [basic1+tests = testGroup "Tests" [basic1,+ parser1 -- patternsOfPatterns ] @@ -21,7 +22,12 @@ [ testCase "silence" $ same16 (fast 1.1 silence) (silence :: Pattern Double), testCase "fast" $ same16 silence (silence :: Pattern Double),- testCase "fast" $ same16 "bd*128" (rep 128 "bd")+ testCase "fast2" $ same16 "bd*128" (rep 128 "bd")+ ]++parser1 = testGroup "subpatterns"+ [+ testCase "square" $ same16 ("bd sn" :: Pattern String) ("[bd sn]" :: Pattern String) ] patternsOfPatterns =
tidal.cabal view
@@ -1,5 +1,5 @@ name: tidal-version: 0.9.7+version: 0.9.8 synopsis: Pattern language for improvised music -- description: homepage: http://tidalcycles.org/@@ -12,13 +12,16 @@ category: Sound build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.10.3, GHC == 8.0.1, GHC == 8.4.1+tested-with: GHC == 7.10.3, GHC == 8.0.1 Extra-source-files: README.md CHANGELOG.md tidal.el doc/tidal.md Description: Tidal is a domain specific language for live coding pattern. library+ if impl(ghc == 8.4.1)+ cpp-options: -DTIDAL_SEMIGROUP+ default-language: Haskell2010 Exposed-modules: Sound.Tidal.Bjorklund@@ -55,7 +58,7 @@ , websockets > 0.8 , mtl >= 2.1 - if !impl(ghc >= 8.0)+ if !impl(ghc >= 8.4.1) build-depends: semigroups == 0.18.* source-repository head