Skip to content

Commit

Permalink
spread and spread'
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu committed Feb 26, 2013
1 parent a5aca3c commit 0204b8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Strategies.hs
Expand Up @@ -20,7 +20,9 @@ brak = every 2 (((1%4) <~) . (\x -> cat [x, silence]))
-- samples "jvbass [~ latibro] [jvbass [latibro jvbass]]" ((1%2) <~ slow 6 "[1 6 8 7 3]") -- samples "jvbass [~ latibro] [jvbass [latibro jvbass]]" ((1%2) <~ slow 6 "[1 6 8 7 3]")
samples p p' = sample <$> p <*> p' samples p p' = sample <$> p <*> p'


spread f xs p = cat $ map (\x -> f x p) xs



spread' :: (a -> Sequence b -> Sequence c) -> Sequence a -> Sequence b -> Sequence c

spread' f timepat pat =

Sequence $ \r -> concatMap (\(r', x) -> (range (f x pat) r')) (rs r)
where rs r = mapFsts (mapSnd Just) $ range (filterOffsets timepat) r

0 comments on commit 0204b8b

Please sign in to comment.