[Haskell-cafe] Re: General function to count list elements?
Peter Verswyvelen
bugfact at gmail.com
Mon Apr 20 10:17:12 EDT 2009
A solution with enums would severely suffer from the expression problem...
One would need to extent the enums every time one needs to support a new
function. Maybe could be solved with type classes, don't know.
On Mon, Apr 20, 2009 at 3:57 PM, Achim Schneider <barsoap at web.de> wrote:
> Lennart Augustsson <lennart at augustsson.net> wrote:
>
> > On Sun, Apr 19, 2009 at 10:43 PM, Peter Verswyvelen
> > <bugfact at gmail.com> wrote:
> > > For example, suppose you have a predicate a -> Bool, and a list of
> > > these predicates [a -> Bool], but you want to remove all functions
> > > that are obviously equal in the C way from the list for
> > > optimization... Okay big hack, and one could do this already with
> > > reallyUnsafePtrEquality# I guess...
> >
> > And when the need gets big enough you pull out StablePtr and use
> > that. :)
> >
> Waaagh! Don't give him ideas, he's going to do it... Make yourself an
> enum, generate your list, nub it, then transform it to a list of
> functions. Always do everything with the least information sanely
> feasible, and a function is more information than a value, even if you
> can't get at it, anymore.
>
>
> --
> (c) this sig last receiving data processing entity. Inspect headers
> for copyright history. All rights reserved. Copying, hiring, renting,
> performance and/or quoting of this signature prohibited.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090420/ac79c2aa/attachment.htm
More information about the Haskell-Cafe
mailing list