[m-rev.] for review: detect cycles in typeclass hierarchy

Ralph Becket rafe at cs.mu.OZ.AU
Wed Jan 19 14:33:40 AEDT 2005


Mark Brown, Wednesday, 19 January 2005:
> On 19-Jan-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > 
> > You might want to consider using map__foldl2 to avoid constructing the
> > list of keys.
> 
> I didn't think of that.  It turns out not to work very easily, though, since
> the recursive call to find_cycles is a foldl over a list.  Making two
> versions of find_cycles, one for map and one for list, is probably not
> worth it due to the added complexity of the code.

Absolutely.

> > When there are so few "state" changes, I usually prefer to just number
> > states explicitly rather than use state variable notation.
> 
> The problem is not so much number of state changes, but number of paths
> through the code.  Using state variables avoids the need to add goals
> such as "Cycle = Cycle0" to paths that don't change the state, so in this
> case I think it is more readable to use state variables.

Fairynuff.

-- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list