Another belated reply to an old thread...
Andrew Pimlott wrote:
On Fri, Nov 18, 2005, Paul Hudak wrote:
unwind :: Expr - Expr
unwind (Add e1 e2) = Add (unwind e1) (unwind e2)
unwind (Rec fe)= x where x = unwind (fe x)
unwind e = e
Since this discussion started around
On Sunday 27 November 2005 11:28, [EMAIL PROTECTED]
wrote:
Andrew Pimlott:
//about my highly spiritual essay on lazy computing of PI//:
In addition to being clever and terribly funny, the conclusion
foreshadows (inspired?) later work on Enron [1].
Come on, it is improbable that Master
| Andrew Pimlott:
| //about my highly spiritual essay on lazy computing of PI//:
|
| In addition to being clever and terribly funny, the conclusion
| foreshadows (inspired?) later work on Enron [1].
|
| Come on, it is improbable that Master Simon ever read my essay...
I hadn't before, but I
On Fri, Nov 18, 2005 at 11:37:40AM -0500, Paul Hudak wrote:
This is a very late response to an old thread...
ditto :-)
unwind :: Expr - Expr
unwind (Add e1 e2) = Add (unwind e1) (unwind e2)
unwind (Rec fe)= x where x = unwind (fe x)
unwind e = e
Since this discussion
Andrew Pimlott:
//about my highly spiritual essay on lazy computing of PI//:
In addition to being clever and terribly funny, the conclusion
foreshadows (inspired?) later work on Enron [1].
Come on, it is improbable that Master Simon ever read my essay...
No,... no comparison.
His work on
On Sat, Nov 19, 2005 at 02:27:06AM +0100, Benjamin Franksen wrote:
[You should read some of his papers, for instance the most unreliable
techique in the world to compute pi. I was ROTFL when I saw the title
and reading it was an eye-opener and fun too.]
In addition to being clever and
On Saturday 19 November 2005 11:56, Gracjan Polak wrote:
2005/11/19, Benjamin Franksen
[You should read some of his papers, for instance the most
unreliable techique in the world to compute pi. I was ROTFL when I
saw the title and reading it was an eye-opener and fun too.]
Care to post a
2005/11/19, Benjamin Franksen
[You should read some of his papers, for instance the most unreliable
techique in the world to compute pi. I was ROTFL when I saw the title
and reading it was an eye-opener and fun too.]
Care to post a link? Seems interesting, but unknown to google :)
--
http://users.info.unicaen.fr/~karczma/arpap/
On Sat, 19 Nov 2005, Gracjan Polak wrote:
2005/11/19, Benjamin Franksen
[You should read some of his papers, for instance the most unreliable
techique in the world to compute pi. I was ROTFL when I saw the title
and reading it was an eye-opener
This is a very late response to an old thread...
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive
data structures? For example, is it possible to determine that
cyclic has a loop? ...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr
cyclic
On Fri, 18 Nov 2005, Paul Hudak wrote:
For example:
fe1,fe2 :: Fix Expr
fe1 e = Add (Const 1) (Const 1) -- non-recursive
fe2 e = Add (Const 1) e -- recursive
Do you mean
fe1 _ = Add (Const 1) Loop
?
___
Haskell-Cafe mailing list
--- Paul Hudak [EMAIL PROTECTED] wrote:
This is a very late response to an old thread...
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive
data structures? For example, is it possible to determine that
cyclic has a loop? ...
data Expr =
Henning Thielemann wrote:
On Fri, 18 Nov 2005, Paul Hudak wrote:
For example:
fe1,fe2 :: Fix Expr
fe1 e = Add (Const 1) (Const 1) -- non-recursive
fe2 e = Add (Const 1) e -- recursive
Do you mean
fe1 _ = Add (Const 1) Loop
?
No, I really meant it as written. I included this
Greg Woodhouse wrote:
--- Paul Hudak [EMAIL PROTECTED] wrote:
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive
data structures? For example, is it possible to determine that
cyclic has a loop? ...
data Expr = Constant Int | Addition Expr Expr
--- Paul Hudak [EMAIL PROTECTED] wrote:
I suspect from your other post that you haven't seen the standard
trick of encoding infinite data structures as fixpoints. Suppose you
have a lambda calculus term for cons, as well as for the numeral 1.
Then the infinite list of ones is just:
Greg Woodhouse wrote:
--- Paul Hudak [EMAIL PROTECTED] wrote:
Y (\ones. cons 1 ones)
where Y (aka the paradoxical combinator or fixed point
combinator) is defined as:
\f. (\x. f (x x)) (\x. f (x x))
Now, this is I have seen, but it frankly strikes me as a formal
trick. I've never felt that
--- Paul Hudak [EMAIL PROTECTED] wrote:
The important property of Y is this:
Y f = f (Y f)
Right. This is just a formal statement of the property thaat f fixex Y
f. I'm with you so far.
In this way you can see it as unwinding the function, one step at a
time. If we define f as
Greg Woodhouse wrote:
--- Paul Hudak [EMAIL PROTECTED] wrote:
The important property of Y is this:
Y f = f (Y f)
Right. This is just a formal statement of the property thaat f fixex Y
f. I'm with you so far.
In this way you can see it as unwinding the function, one step at a
time. If
My simple-mindness and naïveté begin to bother me. I begin to get lost,
and I don't know anymore what is the problem...
Greg Woodhouse a eacute;crit:
--- Paul Hudak [EMAIL PROTECTED] wrote:
...
The important property of Y is this:
Y f = f (Y f)
Right. This is just a formal statement of
On Saturday 19 November 2005 02:16, Greg Woodhouse wrote:
--- [EMAIL PROTECTED] wrote:
fix f = f (fix f) -- Here you have your Y. No typeless lambda.
g f n = n : f n-- This is a generic *non-recursive* `repeat`
ones = fix g 1 -- Guess what.
Very nice! I honestly would not have
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive data
structures? For example, is it possible to determine that cyclic has
a loop? ...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr
cyclic = Addition (Constant 1) cyclic
Or phased
Lennart Augustsson wrote:
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive data
structures? For example, is it possible to determine that cyclic
has a loop? ...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr
cyclic = Addition (Constant 1)
Tom Hawkins wrote:
Lennart Augustsson wrote:
Tom Hawkins wrote:
In a pure language, is it possible to detect cycles in recursive data
structures? For example, is it possible to determine that cyclic
has a loop? ...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr
cyclic =
Hello,
On 10/27/05, Tom Hawkins [EMAIL PROTECTED] wrote:
...
data Expr = Constant Int | Addition Expr Expr
cyclic :: Expr
cyclic = Addition (Constant 1) cyclic
...
And there is nothing that says that your definition of cyclic
will actually have a cycle in the implementation.
On Thu, 27 Oct 2005, Lennart Augustsson [EMAIL PROTECTED] wrote:
Tom Hawkins wrote:
Or phased differently, is it possible to make Expr an instance of
Eq such that cyclic == cyclic is smart enough to avoid a recursive
decent?
No. And there is nothing that says that your definition of
Hello Tom,
Thursday, October 27, 2005, 6:46:41 PM, you wrote:
TH In a pure language, is it possible to detect cycles in recursive data
TH structures?
no, but it is possible in GHC. Einar Karttunen in his SerTH - Binary
Serialization library for Haskell used makeStableName and
unsafeCoerce# to
26 matches
Mail list logo