[Haskell-cafe] viewing HS files in Firefox

2007-10-27 Thread Isaac Dupree
When I try to go to one of the Module.hs files, e.g. on 
darcs.haskell.org, it now has type HS and Firefox refuses to display it 
(and only lets me download it).  Does anyone know how to make Firefox 
treat certain file types as others (HS as plain text, in particular)? 
so that I can browse them with any convenience


Thanks,
Isaac
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] viewing HS files in Firefox

2007-10-27 Thread Dougal Stanton
On 27/10/2007, Isaac Dupree [EMAIL PROTECTED] wrote:
 When I try to go to one of the Module.hs files, e.g. on
 darcs.haskell.org, it now has type HS and Firefox refuses to display it
 (and only lets me download it).  Does anyone know how to make Firefox
 treat certain file types as others (HS as plain text, in particular)?
 so that I can browse them with any convenience

I've looked into this before but haven't found a satisfactory answer.
At best, you can get the offending MIME types to open in a third party
text viewer. But I don't know how to force the internal text viewer.

Actually, a thought occurs. The address bar prefix view-source: works
for html. As in, http://www.haskell.org; -
view-source:http://www.haskell.org;. This might be an effective
workaround though I don't have a page to test it on right now.

Cheers,

D.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fusing foldr's

2007-10-27 Thread Josef Svenningsson
On 10/26/07, Dan Weston [EMAIL PROTECTED] wrote:
 Thanks for letting me know about the Data.Strict library on Hackage. I
 will definitely make use of that! BTW, you left out an import
 Data.List(foldl') in your example.

Yes, Data.Strict can be pretty handy for getting the right strictness.
Sorry about the missing import.

 My timing test is an order of magnitude worse than yours. Do you have an
 extra zero in your list endpoint?

   I fed these functions to ghc with the -O2 and -threaded flags and
   timed them using the list [1..1000]. The result (best times out of
   several runs):
   avg4: 284 ms
   avgS: 184 ms
   avgP: 248 ms

 Using ghc -threaded -O2 --make Avg.hs for ghc 6.6.1, I ran your tests on
 [1..1000] and got the user times:

 avg4: 12.75 s
 avgS:  3.65 s
 avgP: 15.56 s

 The funny thing is that avg4/avgS = 3.5 for and only 1.5 for you. I
 understand that with only 1 processor my avgP time may be twice yours,
 but not the avgS or avg4.

Oooops.. My numbers are totally bogus. I had code that looked like the
following:
\begin{code}
main = do
time avg4 [1..1000]
time avg4 [1..1000]
time avg4 [1..1000]
time avgS [1..1000]
time avgS [1..1000]
time avgS [1..1000]
time avgP [1..1000]
time avgP [1..1000]
time avgP [1..1000]
\end{code}
Not very elegant I know but I thought it would do the job. Apparently
I was wrong. GHC does common subexpression elimination on all the
lists so they're all shared between the different calls. Of course,
the first function call would always take long time but I ignored it,
thinking it was some anomaly. Anyway, I was totally sure that GHC only
did cse on constructor expressions and not on arbitrary computations.
Guess I was wrong. A little searching revealed the following quote by
Simon PJ:

 GHC does a very simple form of CSE. If it sees
let x = e in e
 it replaces the inner 'e' by x.  But that's all at the moment.

Lesson learned.

Less bogus timing:
avg4: 18.0s
avgS: 2.2s
avgP: 17.4s

OK, so these figures make an even stronger case for my conclusion :-)
Single traversal can be much faster than multiple traversals *when
done right*.

 I have the following machine:

 Main memory size: 2026 Mbytes
 Num Processors: 1
 Processor Type: Intel(R) Xeon(TM) CPU 2.80GHz x32
 Clock Speed: 2790 MHZ

In case you're still interested my machine looks like this:

Memory: 2026 Mbytes
Processor: AMD Turion(tm) 64 X2 Mobile Technology TL-56
Clock Speed: 1800MHz

All the best,

/Josef
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] viewing HS files in Firefox

2007-10-27 Thread Isaac Dupree

Dougal Stanton wrote:

On 27/10/2007, Isaac Dupree [EMAIL PROTECTED] wrote:

When I try to go to one of the Module.hs files, e.g. on
darcs.haskell.org, it now has type HS and Firefox refuses to display it
(and only lets me download it).  Does anyone know how to make Firefox
treat certain file types as others (HS as plain text, in particular)?
so that I can browse them with any convenience


I've looked into this before but haven't found a satisfactory answer.
At best, you can get the offending MIME types to open in a third party
text viewer. But I don't know how to force the internal text viewer.

Actually, a thought occurs. The address bar prefix view-source: works
for html. As in, http://www.haskell.org; -
view-source:http://www.haskell.org;. This might be an effective
workaround though I don't have a page to test it on right now.


hmm, taking

http://darcs.haskell.org/ghc-6.6/packages/base/Data/Map.hs

that works, but it's rather inconvenient to convince Firefox to put the 
URL into the address bar so I can type view-source in front.  I had to 
use copy link location, make a new tab, and paste into the empty 
address bar (unless there's some way I didn't find)


ISaac
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fusing foldr's

2007-10-27 Thread Isaac Dupree

Josef Svenningsson wrote:

Less bogus timing:
avg4: 18.0s
avgS: 2.2s
avgP: 17.4s

OK, so these figures make an even stronger case for my conclusion :-)
Single traversal can be much faster than multiple traversals *when
done right*.


Did you use +RTS -N2 on your program (or whatever it is that makes GHC 
actually use multiple threads? or is that not necessary?)  Anyway I 
assume you wouldn't get better than 9.0s, which is still much worse than 
2.2s.


Isaac
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] viewing HS files in Firefox

2007-10-27 Thread Thomas Schilling
On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote:
 When I try to go to one of the Module.hs files, e.g. on 
 darcs.haskell.org, it now has type HS and Firefox refuses to display it 
 (and only lets me download it).  Does anyone know how to make Firefox 
 treat certain file types as others (HS as plain text, in particular)? 
 so that I can browse them with any convenience


I believe those kinds of problem have to do with the MIME-encoding on
the server side:  The server uses text/x-haskell.  For Firefox to
display the document inline it probably has to be text/plain.  Not sure
what the proper fix is, though.

/ Thomas

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Tim Sweeney and multi-cores .... and Haskell

2007-10-27 Thread Galchin Vasili
http://www.americanscientist.org/content/AMSCI/AMSCI/ArticleAltFormat/2007102151724_866.pdf
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe