atzeus / FRPNow

Other
89 stars 14 forks source link

futuristic causes plan to not be executed #13

Closed ocharles closed 9 years ago

ocharles commented 9 years ago

My understanding is that the following should print two lines, but it only prints once.

module Main where

import Control.Concurrent
import Control.FRPNow

main :: IO ()
main =
  runNowMaster
    (do (later,fireLater) <- callback
        plan (fmap (const (sync (putStrLn "later"))) later)
        reallyLater <-
           sample (futuristic (return later))
        plan (fmap (const (sync (putStrLn "reallyLater"))) reallyLater)
        async (threadDelay 100000 >> fireLater ())
        return never)

However, I guess this is questionable use of futuristic, as return later doesn't really denote a Behavior where the Event is always in the future, though no error is thrown either.

atzeus commented 9 years ago

Fixed!