@@ -61,8 +61,8 @@ data Pattern a = Pattern {query :: State -> [Event a], steps :: Maybe (Rational)
61
61
62
62
instance (NFData a ) => NFData (Pattern a )
63
63
64
- pattern :: (State -> [Event a ]) -> Pattern a
65
- pattern f = Pattern f Nothing Nothing
64
+ pattern_ :: (State -> [Event a ]) -> Pattern a
65
+ pattern_ f = Pattern f Nothing Nothing
66
66
67
67
setSteps :: Maybe Rational -> Pattern a -> Pattern a
68
68
setSteps r p = p {steps = r}
@@ -145,7 +145,7 @@ instance Applicative Pattern where
145
145
infixl 4 <* , *> , <<*
146
146
147
147
applyPatToPat :: (Maybe Arc -> Maybe Arc -> Maybe (Maybe Arc )) -> Pattern (a -> b ) -> Pattern a -> Pattern b
148
- applyPatToPat combineWholes pf px = pattern q
148
+ applyPatToPat combineWholes pf px = pattern_ q
149
149
where
150
150
q st = catMaybes $ concatMap match $ query pf st
151
151
where
@@ -160,7 +160,7 @@ applyPatToPat combineWholes pf px = pattern q
160
160
(query px $ st {arc = wholeOrPart ef})
161
161
162
162
applyPatToPatBoth :: Pattern (a -> b ) -> Pattern a -> Pattern b
163
- applyPatToPatBoth pf px = pattern q
163
+ applyPatToPatBoth pf px = pattern_ q
164
164
where
165
165
q st = catMaybes $ (concatMap match $ query pf st) ++ (concatMap matchX $ query (filterAnalog px) st)
166
166
where
@@ -177,7 +177,7 @@ applyPatToPatBoth pf px = pattern q
177
177
return (Event (combineContexts [context ef, context ex]) whole' part' (value ef $ value ex))
178
178
179
179
applyPatToPatLeft :: Pattern (a -> b ) -> Pattern a -> Pattern b
180
- applyPatToPatLeft pf px = pattern q
180
+ applyPatToPatLeft pf px = pattern_ q
181
181
where
182
182
q st = catMaybes $ concatMap match $ query pf st
183
183
where
@@ -188,7 +188,7 @@ applyPatToPatLeft pf px = pattern q
188
188
return (Event (combineContexts [context ef, context ex]) whole' part' (value ef $ value ex))
189
189
190
190
applyPatToPatRight :: Pattern (a -> b ) -> Pattern a -> Pattern b
191
- applyPatToPatRight pf px = pattern q
191
+ applyPatToPatRight pf px = pattern_ q
192
192
where
193
193
q st = catMaybes $ concatMap match $ query px st
194
194
where
@@ -292,7 +292,7 @@ squeezeJoin pp = pp {query = q, pureValue = Nothing}
292
292
return (Event (combineContexts [iContext, oContext]) w' p' v)
293
293
294
294
_trigJoin :: Bool -> Pattern (Pattern a ) -> Pattern a
295
- _trigJoin cycleZero pat_of_pats = pattern q
295
+ _trigJoin cycleZero pat_of_pats = pattern_ q
296
296
where
297
297
q st =
298
298
concatMap
@@ -384,7 +384,7 @@ instance Monoid (Pattern a) where
384
384
385
385
instance Semigroup (Pattern a ) where
386
386
(<>) :: Pattern a -> Pattern a -> Pattern a
387
- (<>) ! p ! p' = pattern $ \ st -> query p st ++ query p' st
387
+ (<>) ! p ! p' = pattern_ $ \ st -> query p st ++ query p' st
388
388
389
389
instance (Num a , Ord a ) => Real (Pattern a ) where
390
390
toRational :: (Num a , Ord a ) => Pattern a -> Rational
@@ -878,7 +878,7 @@ filterAnalog :: Pattern a -> Pattern a
878
878
filterAnalog = filterEvents isAnalog
879
879
880
880
playFor :: Time -> Time -> Pattern a -> Pattern a
881
- playFor s e pat = pattern $ \ st -> maybe [] (\ a -> query pat (st {arc = a})) $ subArc (Arc s e) (arc st)
881
+ playFor s e pat = pattern_ $ \ st -> maybe [] (\ a -> query pat (st {arc = a})) $ subArc (Arc s e) (arc st)
882
882
883
883
-- | Splits a pattern into a list containing the given 'n' number of
884
884
-- patterns. Each one plays every 'n'th cycle, successfully offset by
0 commit comments