On Sun, 20 Mar 2005 [EMAIL PROTECTED] wrote:

> On Sat, Mar 19, 2005 at 12:17:46PM -0700, Kevin Atkinson wrote:
> > On Sat, 19 Mar 2005 [EMAIL PROTECTED] wrote:
> > > I would also have expected loopFG to have been defined using fixIO.
> > 
> > Could you be more specific.  Ie How?
> 
> For the type definitions
> 
>       newtype FG' a b = FG' (Control -> a -> IO (Control, b))
>       newtype FG a b = FG (FGState -> IO (FG' a b, FGState))
>       newtype Container a b = Container (FG ([WidgetP], a) b)
> 
> the usual instances would be (give or take a ~):
> 
>       instance ArrowLoop FG' where
>               loop (FG' f) = FG' $ \ c x -> do
>                       (c', x', _) <- mfix $ \ ~(_, _, y) -> do
>                               ~(c', ~(x', y')) <- f c (x, y)
>                               return (c', x', y')
>                       return (c', x')

I must admit that I am baffled by what this is doing.  But I don't think 
it has the semantics I want.  When I try substituting your 
code in I get "Exception: <<loop>>".  I have reworked the way loops are 
handled.  Please have a look at the new code at 
http://www.haskell.org/arrows/.

-- 
http://kevin.atkinson.dhs.org

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to