csound-expression-typed 0.2.4 → 0.2.5
raw patch · 3 files changed
+117/−4 lines, 3 filesdep ~csound-expression-dynamicPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: csound-expression-dynamic
API changes (from Hackage documentation)
- Csound.Typed.Types.Prim: class (IsPrim a, RealFrac (PrimOf a), Val a) => SigOrD a
+ Csound.Typed.Types.Prim: class (IsPrim a, RealFrac (PrimOf a), Val a, Floating a) => SigOrD a
Files
- csound-expression-typed.cabal +2/−2
- src/Csound/Typed/Control/Mix.hs +114/−1
- src/Csound/Typed/Types/Prim.hs +1/−1
csound-expression-typed.cabal view
@@ -1,5 +1,5 @@ Name: csound-expression-typed-Version: 0.2.4+Version: 0.2.5 Cabal-Version: >= 1.22 License: BSD3 License-file: LICENSE@@ -80,7 +80,7 @@ filepath, directory, wl-pprint >= 1.2.1,- csound-expression-dynamic >= 0.3.6,+ csound-expression-dynamic >= 0.3.7, temporal-media >= 0.6.3, hashable Hs-Source-Dirs: src/
src/Csound/Typed/Control/Mix.hs view
@@ -1,4 +1,11 @@-{-# Language FlexibleContexts, ScopedTypeVariables, CPP #-}+{-# Language+ FlexibleContexts,+ FlexibleInstances,+ ScopedTypeVariables,+ TypeSynonymInstances,+ CPP,+ MultiParamTypeClasses,+ TypeFamilies #-} module Csound.Typed.Control.Mix( Mix, sco, eff, mix, mixBy, monoSco,@@ -25,6 +32,20 @@ import Data.Traversable #endif ++{-+instance MixAt Sig (SE Sig) (Sco (Mix Sig2)) where+ type MixAtOut Sig (SE Sig) (Sco (Mix Sig2)) = Sco (Mix Sig2)+ at f = eff (at f)++instance MixAt Sig (SE Sig) (Sco (Mix Sig3)) where+ type MixAtOut Sig (SE Sig) (Sco (Mix Sig3)) = Sco (Mix Sig3)+ at f = eff (at f)++instance MixAt Sig (SE Sig) (Sco (Mix Sig4)) where+ type MixAtOut Sig (SE Sig) (Sco (Mix Sig4)) = Sco (Mix Sig4)+ at f = eff (at f)+-} toCsdEventList :: Sco a -> CsdEventList a toCsdEventList = id @@ -148,3 +169,95 @@ where proxy :: (a -> f (Mix b)) -> b proxy = const undefined++-----------------------------------------------------------+-- instances++instance (Sigs a, SigSpace a) => SigSpace (Sco (Mix a)) where+ mapSig f = eff (pure . mapSig f)++instance (Sigs a, SigSpace2 a) => SigSpace2 (Sco (Mix a)) where+ mapSig2 f = eff (pure . mapSig2 f)++instance At Sig (SE Sig) (Sco (Mix Sig)) where+ type AtOut Sig (SE Sig) (Sco (Mix Sig)) = Sco (Mix Sig)+ at f = eff f++instance At Sig (SE Sig) (Sco (Mix Sig2)) where+ type AtOut Sig (SE Sig) (Sco (Mix Sig2)) = Sco (Mix Sig2)+ at f = eff (at f)++instance At Sig (SE Sig) (Sco (Mix Sig3)) where+ type AtOut Sig (SE Sig) (Sco (Mix Sig3)) = Sco (Mix Sig3)+ at f = eff (at f)++instance At Sig (SE Sig) (Sco (Mix Sig4)) where+ type AtOut Sig (SE Sig) (Sco (Mix Sig4)) = Sco (Mix Sig4)+ at f = eff (at f)++--++instance At Sig Sig2 (Sco (Mix Sig)) where+ type AtOut Sig Sig2 (Sco (Mix Sig)) = Sco (Mix Sig2)+ at f = eff (pure . f)++instance At Sig2 Sig2 (Sco (Mix Sig)) where+ type AtOut Sig2 Sig2 (Sco (Mix Sig)) = Sco (Mix Sig2)+ at f = eff (pure . at f)++instance At Sig (SE Sig2) (Sco (Mix Sig)) where+ type AtOut Sig (SE Sig2) (Sco (Mix Sig)) = Sco (Mix Sig2)+ at f = eff f++instance At Sig2 (SE Sig2) (Sco (Mix Sig)) where+ type AtOut Sig2 (SE Sig2) (Sco (Mix Sig)) = Sco (Mix Sig2)+ at f = eff (at f)++instance At Sig2 Sig2 (Sco (Mix Sig2)) where+ type AtOut Sig2 Sig2 (Sco (Mix Sig2)) = Sco (Mix Sig2)+ at f = eff (pure . f)++instance At Sig2 (SE Sig2) (Sco (Mix Sig2)) where+ type AtOut Sig2 (SE Sig2) (Sco (Mix Sig2)) = Sco (Mix Sig2)+ at f = eff f++--++instance MixAt Sig (SE Sig) (Sco (Mix Sig)) where+ mixAt k f = eff (mixAt k f)++instance MixAt Sig (SE Sig) (Sco (Mix Sig2)) where+ mixAt k f = eff (mixAt k f)++instance MixAt Sig (SE Sig) (Sco (Mix Sig3)) where+ mixAt k f = eff (mixAt k f)++instance MixAt Sig (SE Sig) (Sco (Mix Sig4)) where+ mixAt k f = eff (mixAt k f)++--++instance MixAt Sig Sig2 (Sco (Mix Sig)) where+ mixAt k f = eff (pure . mixAt k f)++instance MixAt Sig2 Sig2 (Sco (Mix Sig)) where+ mixAt k f = eff (pure . mixAt k f)++instance MixAt Sig (SE Sig2) (Sco (Mix Sig)) where+ mixAt k f = eff (\x -> fmap (cfd k (x, x)) (f x))++instance MixAt Sig2 (SE Sig2) (Sco (Mix Sig)) where+ mixAt k f = eff (\x -> fmap (cfd k (x, x)) (f (x, x)))++instance MixAt Sig2 Sig2 (Sco (Mix Sig2)) where+ mixAt k f = eff (pure . mixAt k f)++instance MixAt Sig2 (SE Sig2) (Sco (Mix Sig2)) where+ mixAt k f = eff (\x -> fmap (cfd k x) (f x))+++++++
src/Csound/Typed/Types/Prim.hs view
@@ -430,7 +430,7 @@ PrimBoolD b -> return $ if b then true else false -class (IsPrim a, RealFrac (PrimOf a), Val a) => SigOrD a where+class (IsPrim a, RealFrac (PrimOf a), Val a, Floating a) => SigOrD a where instance SigOrD Sig where instance SigOrD D where