Re: Extending fold/build fusion

2014-09-05 Thread Dan Doel
To answer myself some after having fiddled with this more The failure-to-fuse is apparently only an issue if I put the fusible thing in the same module as the combinators, for reasons I can't explain. If a separate module imports and defines bar, things fuse fine. I'm still not sure what to d

Re: Extending fold/build fusion

2014-09-04 Thread Dan Doel
I've been looking into this a bit in the past day or so, and I feel like some of the stuff in the repository doesn't make sense (to me, at least). For instance, if you start examining the generated code, you'll see quirks like, taking map as an example: map f xs = go xs [] where g

Re: Extending fold/build fusion

2014-09-03 Thread Joachim Breitner
Dear Akio, Am Mittwoch, den 12.03.2014, 19:36 +0100 schrieb Joachim Breitner: > Dear Akio, > > Am Dienstag, den 11.02.2014, 08:04 +0900 schrieb Akio Takano: > > I modified the base library to use foldrW/buildW, with no changes to > > foldl yet. nofib showed a very big regression in cryptarithm2,

Re: Extending fold/build fusion

2014-03-12 Thread Akio Takano
On Thu, Mar 13, 2014 at 3:36 AM, Joachim Breitner wrote: > Dear Akio, > > Am Dienstag, den 11.02.2014, 08:04 +0900 schrieb Akio Takano: >> I modified the base library to use foldrW/buildW, with no changes to >> foldl yet. nofib showed a very big regression in cryptarithm2, so I'm >> looking into i

Re: Extending fold/build fusion

2014-03-12 Thread Joachim Breitner
Dear Akio, Am Dienstag, den 11.02.2014, 08:04 +0900 schrieb Akio Takano: > I modified the base library to use foldrW/buildW, with no changes to > foldl yet. nofib showed a very big regression in cryptarithm2, so I'm > looking into it. any news on this front? Did you find out what happened in cryp

Re: Extending fold/build fusion

2014-02-10 Thread Akio Takano
I modified the base library to use foldrW/buildW, with no changes to foldl yet. nofib showed a very big regression in cryptarithm2, so I'm looking into it. Thank you for your help, Akio On Mon, Feb 10, 2014 at 7:50 PM, Joachim Breitner wrote: > Dear Takano, > > did you manage to apply fold/build

Re: Extending fold/build fusion

2014-02-10 Thread Joachim Breitner
Dear Takano, did you manage to apply fold/build fusion to the standard libraries, and run nofib? I guess your starting point should be http://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources and then you can start changing libraries/base. Best if you create two working copies, one that y

Re: Extending fold/build fusion

2014-02-02 Thread Akio Takano
On Fri, Jan 31, 2014 at 6:18 PM, Joachim Breitner wrote: > Dear Akio, > > Am Freitag, den 31.01.2014, 16:54 +0900 schrieb Akio Takano: >> > Can you implement build via buildW, so that existing code like >> > "map" [~1] forall f xs. map f xs = build (\c n -> foldr (mapFB c f) n >> > xs) >> > ca

Re: Extending fold/build fusion

2014-02-01 Thread Joachim Breitner
Dear Akio, Am Samstag, den 01.02.2014, 16:52 +0900 schrieb Akio Takano: > On Sat, Feb 1, 2014 at 12:17 AM, Joachim Breitner > wrote: > Yes, this is supposed to work. Fortunately it was an easy fix: > > https://github.com/takano-akio/ww-fusion/commit/ae26b18b135d92e0df7513e5efc0388e085698bf > >

Re: Extending fold/build fusion

2014-01-31 Thread Akio Takano
On Sat, Feb 1, 2014 at 12:17 AM, Joachim Breitner wrote: > Dar Akio, > > I just noticed that even with your approach, the code for foldl-as-foldr > is not automatically beautiful. Consider this: > > I modified the eft function to do to some heavy work at each step (or at > least to look like that)

Re: Extending fold/build fusion

2014-01-31 Thread Joachim Breitner
Dar Akio, I just noticed that even with your approach, the code for foldl-as-foldr is not automatically beautiful. Consider this: I modified the eft function to do to some heavy work at each step (or at least to look like that): myEft :: Int -> Int -> [Int] myEft = \from to -> buildW (myEftFB fr

Re: Extending fold/build fusion

2014-01-31 Thread Joachim Breitner
Dear Akio, Am Freitag, den 31.01.2014, 16:54 +0900 schrieb Akio Takano: > > Can you implement build via buildW, so that existing code like > > "map" [~1] forall f xs. map f xs = build (\c n -> foldr (mapFB c f) n xs) > > can be used unmodified? But probably not... but that would mean a > > noti

Re: Extending fold/build fusion

2014-01-30 Thread Akio Takano
Hi Joachim, On Wed, Jan 29, 2014 at 3:06 AM, Joachim Breitner wrote: > Dear Akio, > > Am Freitag, den 03.01.2014, 23:20 +0900 schrieb Akio Takano: >> I have been thinking about how foldl' can be turned into a good >> consumer, and I came up with something that I thought would work. So >> I'd like

Re: Extending fold/build fusion

2014-01-28 Thread Joachim Breitner
Dear Akio, Am Freitag, den 03.01.2014, 23:20 +0900 schrieb Akio Takano: > I have been thinking about how foldl' can be turned into a good > consumer, and I came up with something that I thought would work. So > I'd like to ask for opinions from the ghc devs: if this idea looks > good, if it is a k

Re: Extending fold/build fusion

2014-01-22 Thread Akio Takano
On Thu, Jan 16, 2014 at 4:20 AM, Simon Peyton Jones wrote: > > Akio > > > > Aha! So you are really talking about replacing the *entire* foldr/build > story with a new one, namely a foldW/buildW story. Presumably all producers > and consumers (map, filter, take, drop etc) must be redefined usin

RE: Extending fold/build fusion

2014-01-15 Thread Simon Peyton Jones
ection 3" or whatever. best wishes Simon From: Akio Takano [mailto:tkn.a...@gmail.com] Sent: 14 January 2014 09:22 To: Simon Peyton Jones Cc: ghc-devs Subject: Re: Extending fold/build fusion Thank you for looking at this! On Tue, Jan 14, 2014 at 1:27 AM, Simon Peyton Jones mailto:simo...@

Re: Extending fold/build fusion

2014-01-14 Thread Akio Takano
that producer. Thank you, Takano Akio > > > Simon > > > > *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Akio > Takano > *Sent:* 09 January 2014 13:25 > *To:* ghc-devs > *Subject:* Re: Extending fold/build fusion > > > > Any input on th

RE: Extending fold/build fusion

2014-01-13 Thread Simon Peyton Jones
imon From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Akio Takano Sent: 09 January 2014 13:25 To: ghc-devs Subject: Re: Extending fold/build fusion Any input on this is appreciated. In particular, I'd like to know: if I implement the idea as a patch to the base package, is

Re: Extending fold/build fusion

2014-01-09 Thread Carter Schonwald
Hey akio, it's certainly an interesting idea. If you implement it, the first step would be to run a nofib before and after to benchmark the impact of the change. On Thursday, January 9, 2014, Akio Takano wrote: > Any input on this is appreciated. In particular, I'd like to know: if I > implement

Re: Extending fold/build fusion

2014-01-09 Thread Akio Takano
Any input on this is appreciated. In particular, I'd like to know: if I implement the idea as a patch to the base package, is there a chance it is considered for merge? -- Takano Akio On Fri, Jan 3, 2014 at 11:20 PM, Akio Takano wrote: > Hi, > > I have been thinking about how foldl' can be turn