[Haskell-beginners] Understanding "Signals, Not Generators"

Nathan Hüsken nathan.huesken at posteo.de
Fri May 4 16:18:30 CEST 2012


Hey

I am currently reading Signals, Not Generators". I am on page 10 where the phantom type era is introduced. I have trouble understanding because I do not understand how the system is to be used. Let us assume I have a signal and an action to print the output:

signal :: DSignal era Int
action :: Int -> Io ()
action = putStrLn . show

Now, I consume the signal:
reactive = consume signal action

=> reactive :: Reactive era (IO ())

And make an io action:

toIO reactive :: IO ()

My question is: what does this io action do?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120504/191026ec/attachment.htm>


More information about the Beginners mailing list