|
|
|
|
|
by BucketSort
2472 days ago
|
|
It's just mind boggling how universal these concepts are and how they show up in surprising ways. As a recent example, I've been learning the basics of composing music in Haskell with Euterpea[1] and wanted to make a function which played several notes over a list of octaves to make chords. It turns out the applicative operator was exactly the function I need to do this! It would be hard to go into the details in just a little blurb here... but here is a piece I made with with it[2]. And here's the line of code with the applicative operator: notePlayer notes octs dur = musicSeq $ (uncurry <$> notes) <*> ((, dur) <$> octs) Won't make much sense without context, but it's there! [1]: http://www.euterpea.com/ [2]: https://soundcloud.com/a-mathematical-way/not-enough-time-to... |
|