cobbpg/elerea — pull request #7 by maoe (2014-11-20 05:57:40+00:00)
Title: Add MonadIO instance for SignalGen

Is there any reason why `SignalGen` isn't an instance of `MonadIO`? `execute` seems to satisfy the MonadIO laws:

```
1) execute . return = return

execute . return
= \x -> execute (return x)
= \x -> SG (\_ -> return x)

return
= \x -> SG (\_ -> return x)

2) execute (m >>= f) = execute m >>= execute . f

execute (m >>= f)
= SG (\_ -> m >>= f)

execute m >>= execute . f
= SG (\_ -> m) >>= execute . f
= SG (\p -> (\_ -> m) p >>= \x -> unSG (execute (f x)) p)
= SG (\p -> m >>= \x -> unSG (execute (f x)) p)
= SG (\p -> m >>= \x -> unSG (SG (\_ -> f x)) p)
= SG (\p -> m >>= \x -> (\_ -> f x) p)
= SG (\_ -> m >>= \x -> f x)
= SG (\_ -> m >>= f)
```