Re: [Haskell-cafe] Haskell Cheat Sheet?

On Wed, 2007-09-26 at 17:09 -0500, Derek Elkins wrote:
On Wed, 2007-09-26 at 14:12 -0700, Jonathan Cast wrote:
On Wed, 2007-09-26 at 11:43 -0700, Dan Weston wrote:
It seems no one liked idea #2. I still think fix is the wrong name for this, maybe limit would be better.
It calculates least fixed points. `fix' is as good a name as any.
`limit' is terrible; the argument to fix, a -> a, is neither a sequence nor diagram nor net type, and hence its values don't have limits...
jcc
PS Yes, I know fix a = sup_{i=0}^inf f^i(bot). That sequence is rather different than the input function...
Actually, f :: a -> a -is- a diagram and its limit -is- fix f.
In what way? I'm not disputing you, but I don't see how to interpret it as such.
That said, limit is still a horrible name for it. fix isn't much better, and Y is even worse. I'm not sure what an immediately intuitive name would be, so might as well go with the historical one.
recursive (at least for my usage). jcc

Not to beat a dead horse, but I wasn't suggesting to rename the fix function that everyone knows and loves: fix :: (a -> a) -> a fix f = let f' = f f' in f' I was merely trying to suggest that it would be wise to rename the function in http://haskell.org/haskellwiki/Reference_card that redefined fix to mean: fix :: Eq x => (x -> x) -> x -> x fix f x = if x == x' then x else fix f x' where x' = f x It is this latter function which I suggested to be renamed limit, since it returns the limit (converged value) of f^n x, where n -> inf, and doesn't even have the same type or arity as the standard fix function. Somehow this (admittedly minor) point got lost in the heat of battle. Dan Weston Jonathan Cast wrote:
On Wed, 2007-09-26 at 17:09 -0500, Derek Elkins wrote:
On Wed, 2007-09-26 at 14:12 -0700, Jonathan Cast wrote:
On Wed, 2007-09-26 at 11:43 -0700, Dan Weston wrote:
It seems no one liked idea #2. I still think fix is the wrong name for this, maybe limit would be better. It calculates least fixed points. `fix' is as good a name as any.
`limit' is terrible; the argument to fix, a -> a, is neither a sequence nor diagram nor net type, and hence its values don't have limits...
jcc
PS Yes, I know fix a = sup_{i=0}^inf f^i(bot). That sequence is rather different than the input function... Actually, f :: a -> a -is- a diagram and its limit -is- fix f.
In what way? I'm not disputing you, but I don't see how to interpret it as such.
That said, limit is still a horrible name for it. fix isn't much better, and Y is even worse. I'm not sure what an immediately intuitive name would be, so might as well go with the historical one.
recursive (at least for my usage).
jcc
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Sep 26, 2007 at 05:23:58PM -0700, Dan Weston wrote:
It is this latter function which I suggested to be renamed limit, since it returns the limit (converged value) of f^n x, where n -> inf, and doesn't even have the same type or arity as the standard fix function.
Somehow this (admittedly minor) point got lost in the heat of battle.
It did? I thought the response was that they /both/ calculated fixed points. This "limit" seems to look for an attractive fixed point[1] in a fairly straightforward (and possibly naive) way. As a matter of fact, its only differences from the standard fix definition seem to be: 1) A parameterized initial state 2) A terminating condition (and the necessary type context) Am I crazy? Devin [1] http://en.wikipedia.org/wiki/Fixpoint#Attractive_fixed_points

On Wed, 2007-09-26 at 17:23 -0700, Dan Weston wrote:
Not to beat a dead horse, but I wasn't suggesting to rename the fix function that everyone knows and loves:
fix :: (a -> a) -> a fix f = let f' = f f' in f'
I was merely trying to suggest that it would be wise to rename the function in http://haskell.org/haskellwiki/Reference_card that redefined fix to mean:
fix :: Eq x => (x -> x) -> x -> x fix f x = if x == x' then x else fix f x' where x' = f x
It is this latter function which I suggested to be renamed limit, since it returns the limit (converged value) of f^n x, where n -> inf, and doesn't even have the same type or arity as the standard fix function.
Somehow this (admittedly minor) point got lost in the heat of battle.
How 'bout just 'fixpoint' or 'fixedpoint' or 'findFixedPoint'.
participants (4)
-
Dan Weston
-
Derek Elkins
-
Devin Mullins
-
Jonathan Cast