Hi

>  From your thesis/paper, it seems that queries, such as 'bill' in the
>  Paradise benchmark, are the worst offenders, performancewise, and applying
> your techniques for Uniplate to the SYB query for 'bill' seems to achieve a
> similar reduction in runtime.
>  'contains' is interesting, and seems to generalise directly to SYB, one
>  just needs to know the domains of functions - I have long wanted a way to
> specify the domain of SYB-style overloaded functions (instead of
>  hiding specific domains in near polymorphic types), but never considered
> IntSets of TypeRepKeys!-)

IntSet's are only possible in 6.8 due to API changes :-)


>  I couldn't quite figure out how to make a type-dependent CAF in the class
> instances, as your paper suggests, so I made my CAF at the top-level
> instead

instance Domain a b where
   domain = \_ -> res
       where res = ... the computed domain ...

class Domain a b where
   domain :: (a,b) -> IntSet

That should work.

> like the Company type (having to list
> those roots explicitly is not so
>  nice, presumably your approach avoids that?).

The Biplate a b instance specifies the source and target types, so all
instances know this information before they start.

>  The query and scheme change only minimally, to add the domain
>  of the query function, and to shortcut the scheme if there are no
>  domain members in the substructure types:

I really don't like this approach. You specify two things, with an
intricate relationship between them, and if you get it wrong its not a
type error - the operation just gives the wrong result. I think it
overcomplicates the type, in ways that aren't really necessary.

>  While your optimizations are nice, your text might have
>  mentioned that some of them apply to SYB as well?-)

I think the revised text will mention that :-) [I think an early draft
at one point actually did]

> SYB can also be roughly as fast as Uniplate over SYB

With lots of changes, including the domain thing and a different
everywhere - and even Uniplate over SYB is too slow for some people. I
think the generics paper when it says that "Uniplate is one of the
fastest" is actually measuring Uniplate over SYB, so its seems that
with these tweaks SYB would be also one of the fastest.

Thanks

Neil

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to