purescript/purescript — pull request #357 by joneshf (2014-04-07 04:06:28+00:00)
Title: Apply and Bind

Following @garyb's checklist, I attempted to add `Apply` and `Bind` into the hierarchy. `Apply` went painlessly, but `Bind` borked a couple of things.

* The examples using `Control.Monad.ST` seem to fail during the test with

```
[stdin]:26
function showNumberImpl(n) { return n.toString();};
^
TypeError: Cannot call method 'toString' of undefined
at showNumberImpl ([stdin]:26:48)
at [stdin]:623:62
at [stdin]:736:147
at [stdin]:521:88
at [stdin]:521:94
at [stdin]:521:94
at [stdin]:521:94
at Object.main ([stdin]:521:94)
at window.PS ([stdin]:758:14)
at [stdin]:759:3
```
or similar.

They seem to pass with `--no-magic-do` enabled. It also seems to compile properly, and run fine on node if you're running node as a separate process. I'm using version `v0.10.26` if that makes any difference.

* The Collatz example appears to be in an infinite loop.

* This example: https://github.com/purescript/purescript/blob/superclasses/examples/passing/Superclasses3.purs#L10-L11 has an overlapping `Functor` instance from `Monad` being a subclass of both `Applicative` and `Bind`.