I was reading this interesting post for the hundredth time and I am still trying to understand what's behind the different instances of Pattern and especially when it is useful to handle Monad Pattern, Functor Pattern and Applicative Pattern.
Here is what I got so far:
Functor Patterncomes handy when we want to use function from e.g. the standardPreludemodule but we don't know how to cope with thePatterncontext. We use<$>and we get a result wrapped in aPatterncontext that we can use inside Tidal.
E.g.chop (round <$> (slow 8 $ range 1 128 $ sine))- thanks @nuelmyr for the patternMonad Patterncomes handy when we have a function that returns aPatterncontext, but it does not accept a value in a context. We use>>=and theMonad Patternwill apply the function to thePatternand we get a result wrapped in aPatterncontext.
I think the example from the post is quite explicative:
fastFromList[False,False,True] >>= \ f -> if not f then run 2 else run 3
But what about Applicative Pattern: what is a pattern of functions (Pattern (a -> b))?
I am very interested in seeing some examples on how you use the different instances of Pattern to create your own functions.