On Oct 29, 2007, at 3:36 , Tim Newsham wrote:
or go through the trouble of defining a bunch of binops
f <+> g = liftM2 (+) f g
n +> g = return n <+> g
f <+ n = f <+> return n
read' = liftM read
This looks a lot like Control.Applicative to me.
--
brandon s. allbery [solaris,fre
I would love to have the ability to define binary operator modifiers.
For example:
f \overline{op} g = liftM2 op f g
f \overleftarrow{op} n = liftM2 op f (return n)
n \overrightarrow{op} g = liftM2 op (return n) f
\widehat{f} x = liftM f x
so that for example you could d
John Lato wrote:
I'm working
with moderate-sized files (tens to hundreds of MBs) that have some
ascii header data followed by a bunch of 32-bit ints.
but I don't know if [Int32] is actually the best choice. It seems to me
that something like a lazy list of strict arrays (analogous to a lazy
b
jwlato:
> Hello,
> I've been following the list optimization thread with great interest,
> as it pertains to something I'm working on at the moment. I'm working
> with moderate-sized files (tens to hundreds of MBs) that have some
> ascii header data followed by a bunch of 32-bit ints. I can read
Please pardon this intrusion for an elementary
question on setting the GHC search path.
I have installed GHC on my work Windows XP machine,
and would like to be able to search for files in the
following directory:
D:\From C Drive\Documents and
Settings\DekuDekuplex\Programming Practice\Haskell\GH
Hello,
I've been following the list optimization thread with great interest,
as it pertains to something I'm working on at the moment. I'm working
with moderate-sized files (tens to hundreds of MBs) that have some
ascii header data followed by a bunch of 32-bit ints. I can read the
files into a l
peter:
> Don Stewart wrote:
> >>C++ version times: 1.109; 1.125; 1.125
> >>Int32 cpu times: 1.359; 1.359; 1.375
> >>Int64 cpu times: 11.688; 11.719; 11.766
> >>Integer cpu times: 9.719; 9.703; 9.703
> >>
> >>Great result from ghc.
> >
> >What Haskell program were you using for this test? The origin
G'day all.
Quoting Don Stewart <[EMAIL PROTECTED]>:
That fits with my experience writing low level numeric code -- Integer
can be a killer.
Mind you, if you're intending to work with large integers or rationals,
Integer is great! The bottleneck is almost always "show".
Cheers,
Andrew Bromag
On Sun, 2007-10-28 at 23:34 +0100, Peter Hercek wrote:
> Don Stewart wrote:
> >> C++ version times: 1.109; 1.125; 1.125
> >> Int32 cpu times: 1.359; 1.359; 1.375
> >> Int64 cpu times: 11.688; 11.719; 11.766
> >> Integer cpu times: 9.719; 9.703; 9.703
> >>
> >> Great result from ghc.
> >
> > What H
Peter Hercek wrote:
MS cl.exe version 13.10.3077 (options /G7 /MD)
And I had cl options wrong too - I need to start to
optimize not only to set the optimization target.
/G7 /MD -> 1.109; 1.125; 1.125
/Ox /G7 /MD -> 0.922; 0.984; 0.984
Still it does not change the results too much.
Pet
Don Stewart wrote:
C++ version times: 1.109; 1.125; 1.125
Int32 cpu times: 1.359; 1.359; 1.375
Int64 cpu times: 11.688; 11.719; 11.766
Integer cpu times: 9.719; 9.703; 9.703
Great result from ghc.
What Haskell program were you using for this test? The original
naive/high level implementation?
Hi everyone,
HSWM was my attempt at a Haskell Window Manager, mostly written
during the first half of 2006 as a personal research project, and
out of frustration with some not to be named other window
managers. Although I have been running it myself for almost two
years, I never got around to poli
peter:
> Peter Hercek wrote:
> >C++ version times: 1.125; 1.109; 1.125
> >Int32 cpu times: 3.203; 3.172; 3.172
> >Int64 cpu times: 11.734; 11.797; 11.844
> >Integer cpu times: 9.609; 9.609; 9.500
>
> Ooops, my results ware wrong (nonoptimizing ms cl
> compiler used and I used -O instead of -O2 in
Peter Hercek wrote:
C++ version times: 1.125; 1.109; 1.125
Int32 cpu times: 3.203; 3.172; 3.172
Int64 cpu times: 11.734; 11.797; 11.844
Integer cpu times: 9.609; 9.609; 9.500
Ooops, my results ware wrong (nonoptimizing ms cl
compiler used and I used -O instead of -O2 in ghc).
C++ version time
peter:
> Daniel Fischer wrote:
> >What perpetually puzzles me is that in C long long int has very good
> >performance, *much* faster than gmp, in Haskell, on my computer, Int64 is
> >hardly faster than Integer.
>
> I tried the example with Int64 and Integer. The integer version
> was actually
Daniel Fischer wrote:
What perpetually puzzles me is that in C long long int has very good
performance, *much* faster than gmp, in Haskell, on my computer, Int64 is
hardly faster than Integer.
I tried the example with Int64 and Integer. The integer version
was actually quicker ... which is t
dons:
> stefanor:
> > On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
> > > Finally, we can manually translate the C code into a confusing set of
> > > nested
> > > loops with interleaved IO,
> > >
> > > main = loop 1
> > > where
> > > loop !i | i > 1 = return
On 10/28/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote:
> On Sun, Oct 28, 2007 at 01:43:07PM -0700, Don Stewart wrote:
> > stefanor:
> > > IO blocks unboxing in GHC. How fast is your mock-C code refactored to
> > > do IO outside of the loops only?
> >
> > It doesn't! The above code yields:
> >
> >
On Sun, Oct 28, 2007 at 01:43:07PM -0700, Don Stewart wrote:
> stefanor:
> > IO blocks unboxing in GHC. How fast is your mock-C code refactored to
> > do IO outside of the loops only?
>
> It doesn't! The above code yields:
>
> Main.$wloop :: GHC.Prim.Int#
>-> GHC.Prim.Sta
stefanor:
> On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
> > Finally, we can manually translate the C code into a confusing set of nested
> > loops with interleaved IO,
> >
> > main = loop 1
> > where
> > loop !i | i > 1 = return ()
> > | othe
On Sun, Oct 28, 2007 at 01:25:19PM -0700, Don Stewart wrote:
> Finally, we can manually translate the C code into a confusing set of nested
> loops with interleaved IO,
>
> main = loop 1
> where
> loop !i | i > 1 = return ()
> | otherwise = if i == go i 0 1 t
On Sun, Oct 28, 2007 at 08:40:28PM +0100, Daniel Fischer wrote:
> Am Sonntag, 28. Oktober 2007 20:09 schrieb Derek Elkins:
>
> > >
> > > That fits with my experience writing low level numeric code -- Integer
> > > can be a killer.
> >
> > Inline machine operations v. out-of-line calls to an arbitr
rendel:
> Prabhakar Ragde wrote:
> >divisors i = [j | j<-[1..i-1], i `mod` j == 0]
> >main = print [i | i<-[1..1], i == sum (divisors i)]
>
> Jerzy Karczmarczuk wrote:
> >My point didn't concern that point. Haskell compiler cannot change an
> >algorithm using lists into something which deals w
One thing I've noticed is that turning on optimizations significantly
increases the speed of haskell code. Are you comparing code between
languages with -O2 or without opts?
On 10/28/07, Prabhakar Ragde <[EMAIL PROTECTED]> wrote:
>
> For the purposes of learning, I am trying to optimize some varia
Shachaf Ben-Kiki wrote:
Richard Kelsall wrote:
Thomas Schilling wrote:
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).
Hi,
Prabhakar Ragde wrote:
divisors i = [j | j<-[1..i-1], i `mod` j == 0]
main = print [i | i<-[1..1], i == sum (divisors i)]
Jerzy Karczmarczuk wrote:
My point didn't concern that point. Haskell compiler cannot change an
algorithm using lists into something which deals with indexable arr
Am Sonntag, 28. Oktober 2007 20:09 schrieb Derek Elkins:
> >
> > That fits with my experience writing low level numeric code -- Integer
> > can be a killer.
>
> Inline machine operations v. out-of-line calls to an arbitrary precision
> integer C library: there shouldn't be any surprise here.
Ob
On Sun, 2007-10-28 at 12:01 -0700, Don Stewart wrote:
> jerzy.karczmarczuk:
> > Stefan O'Rear adds to the dialogue:
> >
> > >Prabhakar Ragde wrote:
> > >>Jerzy Karczmarczuk wrote:
> > >>
> > >>>Just a trivial comment... 1. Don't speak about comparing *languages*
> > >>>when you compare *algorit
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 wi
jerzy.karczmarczuk:
> Stefan O'Rear adds to the dialogue:
>
> >Prabhakar Ragde wrote:
> >>Jerzy Karczmarczuk wrote:
> >>
> >>>Just a trivial comment... 1. Don't speak about comparing *languages*
> >>>when you compare *algorithms*,
> >>> and in particular data structures.
> >>>2. Please, DO cod
On Sun, 2007-10-28 at 10:23 -0400, Prabhakar Ragde wrote:
> Jaak Randmets wrote:
> > On 10/28/07, Prabhakar Ragde <[EMAIL PROTECTED]> wrote:
> >> For the purposes of learning, I am trying to optimize some variation of
> >> the following code for computing all perfect numbers less than 1.
> >>
>
Stefan O'Rear adds to the dialogue:
Prabhakar Ragde wrote:
Jerzy Karczmarczuk wrote:
Just a trivial comment... 1. Don't speak about comparing *languages* when
you compare *algorithms*,
and in particular data structures.
2. Please, DO code the above in C, using linked lists. Compare then. 3
Isaac Dupree wrote:
Mushfeq Khan wrote:
I'm new to Haskell and am trying to find a good way to organize my HUnit
tests. Having used some of the other XUnit frameworks, I tended towards
trying to organize them all in a parallel "test" folder structure,
but this
seems to be a bad fit for Haskell
On 10/28/07, Duncan Coutts <[EMAIL PROTECTED]> wrote:
> Yes, I get the same. It works fine on Linux and the text has the wrong
> position on Windows. I'm doing a new Gtk2Hs build soon for compatibility
> with ghc-6.8 and I can try with a more recent version of cairo then and
> see if the bug has be
Prabhakar Ragde wrote:
You could try giving divisors type signature:
divisors :: Int -> [Int]
Thank you. That brings the time down to 0.5 seconds. I'm glad it was
something as simple as that. --PR
I assume GHC was smart enough to do inlining and such in this case, so
the difference is that
On Sun, 2007-10-28 at 15:07 +0100, Peter Verswyvelen wrote:
> I have a strange problem, which is so elementary that I think I must
> be missing something...
>
> In GTK2HS, when I draw text using using textPath, the text is located
> at different locations depending on which backend is used. I'm no
Mushfeq Khan wrote:
I'm new to Haskell and am trying to find a good way to organize my HUnit
tests. Having used some of the other XUnit frameworks, I tended towards
trying to organize them all in a parallel "test" folder structure, but this
seems to be a bad fit for Haskell, since the test module
On Sun, Oct 28, 2007 at 11:26:46AM -0400, Prabhakar Ragde wrote:
> Jerzy Karczmarczuk wrote:
>
>> Just a trivial comment... 1. Don't speak about comparing *languages* when
>> you compare *algorithms*,
>> and in particular data structures.
>> 2. Please, DO code the above in C, using linked lists.
I'm new to Haskell and am trying to find a good way to organize my HUnit
tests. Having used some of the other XUnit frameworks, I tended towards
trying to organize them all in a parallel "test" folder structure, but this
seems to be a bad fit for Haskell, since the test modules cannot see the
sourc
Jerzy Karczmarczuk wrote:
Just a trivial comment...
1. Don't speak about comparing *languages* when you compare *algorithms*,
and in particular data structures.
2. Please, DO code the above in C, using linked lists. Compare then.
3. Check the influence of bare printing, separated from the
On Sun, 2007-10-28 at 15:28 +0100, Peter Verswyvelen wrote:
> If I understand this blog correctly, F# leaves the research lab and
> becomes an "official" Visual Studio language?
>
> http://blogs.msdn.com/somasegar/archive/2007/10/17/f-a-functional-programming-language.aspx
>
> Okay it's not Haske
Prabhakar Ragde writes:
For the purposes of learning, I am trying to optimize some variation of
the following code for computing all perfect numbers less than 1.
divisors i = [j | j<-[1..i-1], i `mod` j == 0]
main = print [i | i<-[1..1], i == sum (divisors i)]
I know this is mathema
If I understand this blog correctly, F# leaves the research lab and
becomes an "official" Visual Studio language?
http://blogs.msdn.com/somasegar/archive/2007/10/17/f-a-functional-programming-language.aspx
Okay it's not Haskell, but I think it's good news anyway...
Cheers,
Peter
PS: Shouldn't
On 28/10/2007, Galchin Vasili <[EMAIL PROTECTED]> wrote:
> http://www.americanscientist.org/content/AMSCI/AMSCI/ArticleAltFormat/2007102151724_866.pdf
Am I missing something? I didn't see anything about Haskell, nor Tim
Sweeney for that matter, in that article.
--
Sebastian Sylvan
+44(0)7857-30
Jaak Randmets wrote:
On 10/28/07, Prabhakar Ragde <[EMAIL PROTECTED]> wrote:
For the purposes of learning, I am trying to optimize some variation of
the following code for computing all perfect numbers less than 1.
divisors i = [j | j<-[1..i-1], i `mod` j == 0]
main = print [i | i<-[1..1000
Thomas Schilling wrote:
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 fil
I have a strange problem, which is so elementary that I think I must be
missing something...
In GTK2HS, when I draw text using using textPath, the text is located at
different locations depending on which backend is used. I'm not talking
about a difference of a couple of pixels , but in my cas
On 10/28/07, Prabhakar Ragde <[EMAIL PROTECTED]> wrote:
> For the purposes of learning, I am trying to optimize some variation of
> the following code for computing all perfect numbers less than 1.
>
> divisors i = [j | j<-[1..i-1], i `mod` j == 0]
> main = print [i | i<-[1..1], i == sum (d
For the purposes of learning, I am trying to optimize some variation of
the following code for computing all perfect numbers less than 1.
divisors i = [j | j<-[1..i-1], i `mod` j == 0]
main = print [i | i<-[1..1], i == sum (divisors i)]
I know this is mathematically stupid, but the poin
Thomas Schilling wrote:
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
The "Open in Browser" Firefox extension -- quite possibly the
handiest thing since hoogle as a custom search engine plugin (if not
handier!)
http://www.spasche.net/mozilla/
--S
On Oct 27, 2007, at 8:16 PM, Thomas Schilling wrote:
On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote:
Whe
51 matches
Mail list logo