Two well-known examples of applicatives are monads and ziplists. Are there any other examples?
Conal Elliott writes about signal processors and how they're applicatives. Those are similar to ZipList
in nature, where each respective pair of items in the two "containers" gets combined.
I've been using this concept a lot in an unfinished yet cute game I made (cabal install DefendTheKing
to check it out).
Code snippet/example of Applicative-style usage:
draw font
<$> lstP gABoard
<*> lstP gASelection
<*> mouseMotion
<*> lstP gASide
<*> lstP gAGameIteration