Advanced JavaScript: Compose function
javascriptweblog.wordpress.com
javascriptweblog.wordpress.com
http://www.google.com/codesearch/p?hl=en#1oUPVh-C1Wg/trunk/e...
(.) :: (b -> c) -> (a -> b) -> a -> c
Except that of course in an impure language like JavaScript if you compose some function f with another function g, either or both functions could have side effects (via I/O, mutation etc.) that break referential transparency.
After a quick glance at the Prototype code, the bind function isn't merely changing which object the name 'this' is bound to, it also allows a kind of currying. However, this still isn't function composition.