Last active
August 29, 2015 14:01
-
-
Save Mokosha/2b65655450981cfded65 to your computer and use it in GitHub Desktop.
Leaking Netwire Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Control.Wire | |
mkWire :: (Num b, HasTime t s, Show b, Monad m) => b -> Wire s () m a b | |
mkWire x = ((pure x) &&& (periodic 2) >>> Control.Wire.until) --> (mkWire (x + 1)) | |
main :: IO () | |
main = testWire clockSession_ (mkWire 3) |
This conundrum has been answered on Stack Overflow:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The semantics of this wire can be expressed better as:
However, I'd like to know why the wire that I've posted explodes w.r.t. memory.