[reactive] Composable adapters and multiple event sources

pierre k.pierre.k at gmail.com
Tue Nov 11 11:26:44 EST 2008


On Mon, Nov 10, 2008 at 05:55:45PM -0500, David Sankel wrote:
> 
> Hrm, I'm having trouble understanding the situation here. What would the
> context around mkButton look like? Are you looking for something like the
> following?
> 
> data WidgetHeiarchy = Button Identifier (Event ())
>                     | Frame Identifyer [WidgetHeiarchy]
>                     | ...
> 
> data WidgetHeiarchyStates = SButton Color
>                           | ...
> 
> adapt :: Glade -> (WidgetHeiarchy -> Behavior WidgetHeiarchyStates ) -> IO()

Wouldn't enomous size of WidgetHeiarchy and WidgetHeiarchyStates be
problematic? GTK2 has an enormous number of events and states so
(imho) it's not practical to try to encode them all (and create an
event for each possible callback). In case of "partial encoding", i
don't know how this could be extensible.
 
> > 2. Is stacking of multiple adapters possible? In my view it's
> > essential feature for many applications, GUI network clients, for example.
> 
> I agree that it's an essential feature. If your event generators and
> behavior sinks can all run on separate threads, you're good to go. The
> situation gets complicated when event generators or behavior sinks all
> require blocking on the main thread. We had some simple legacy adapters at
> one point (forkE forkB), but I'm not sure if they're still in the source
> somewhere.
> --
> David Sankel

-- 
pierre


More information about the Reactive mailing list