[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-05 Thread Ben Franksen
Achim Schneider wrote: ...is a paper about automatic specialisation of functions by unboxing arguments, one could say. I'm only on page 6, but already survived the first formalisms, which is bound to mean that the rest of the paper is likewise accessible, as hinted on at ltu.

[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-05 Thread Ben Franksen
Isaac Dupree wrote: Achim Schneider wrote: http://www.cs.nott.ac.uk/~gmh/wrapper.pdf on page 6, stronger vs weaker seemed backwards to me... isn't (wrap ◦ unwrap = idA) a stronger condition than (wrap ◦ unwrap ◦ body = body), because it tells you more, and is true in fewer cases? (which is

[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Achim Schneider
Achim Schneider [EMAIL PROTECTED] wrote: [...] I'm trying to grok that [] = id ++ = . in the context of Hughes lists. I guess it would stop to slip away if I knew what : corresponds to. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information.

Re: [Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Brent Yorgey
On Jan 3, 2008 6:08 AM, Achim Schneider [EMAIL PROTECTED] wrote: Achim Schneider [EMAIL PROTECTED] wrote: [...] I'm trying to grok that [] = id ++ = . in the context of Hughes lists. I guess it would stop to slip away if I knew what : corresponds to. Well, (:) has type a - [a] -

[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Achim Schneider
Brent Yorgey [EMAIL PROTECTED] wrote: Well, (:) has type a - [a] - [a], so a function corresponding to (:) for Hughes lists should have type foo :: a - H a - H a [...] I think the key sentence from the paper is this: by representing a list xs as the function (xs ++) that appends this

[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Achim Schneider
Achim Schneider [EMAIL PROTECTED] wrote: Brent Yorgey [EMAIL PROTECTED] wrote: Well, (:) has type a - [a] - [a], so a function corresponding to (:) for Hughes lists should have type foo :: a - H a - H a [...] I think the key sentence from the paper is this: by representing

Re: [Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Isaac Dupree
Achim Schneider wrote: Achim Schneider [EMAIL PROTECTED] wrote: [...] I'm trying to grok that [] = id ++ = . in the context of Hughes lists. they are also known as difference lists, and also used at type String in the Prelude as ShowS, to help avoid quadratic behavior when making

[Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Achim Schneider
Achim Schneider [EMAIL PROTECTED] wrote: (define (cons x y) (lambda (m) (m x y))) (define (car z) (z (lambda (p q) p))) (define (cdr z) (z (lambda (p q) q))) , which, just for completeness, can be of course also be done in Haskell: cons :: a - b - (a - b - c) - c cons x y m

Re: [Haskell-cafe] Re: The Worker/Wrapper Transformation

2008-01-03 Thread Jonathan Cast
On 3 Jan 2008, at 4:49 AM, Isaac Dupree wrote: Achim Schneider wrote: Achim Schneider [EMAIL PROTECTED] wrote: [...] I'm trying to grok that [] = id ++ = . in the context of Hughes lists. they are also known as difference lists, and also used at type String in the Prelude as ShowS, to