
On Thu, Apr 24, 2008 at 11:10 PM, Ryan Ingram
More FRP stuff: a new type for Future that came to me in an inspiration this morning. But it's ugly and I need someone with better theoretical underpinnings than me to tell me what I've really built :)
data Future t a = Known t a | Unknown (t -> IO (STM (Maybe (Future t a))))
This looks similar to my friend the "free monad over exponentiation", or Suspend, which I also discovered while experimenting with FRP. After experimenting a bit, I found that the following variant lead to more elegant implementations of the same things: newtype SuspendT v m a = SuspendT (m (Either a (v -> SuspendT v m a))) Implemented pretty fully here: http://luqui.org/git/?p=luqui-misc.git;a=blob;f=work/code/haskell/frp/Fregl/... I'm not quite sure whether you can make it have all the capabilities yours does (there is no STMT...). Luke