Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Yang
On 10/8/06, Udo Stenzel u.stenzel-at-web.de |haskell-cafe| <...> wrote: Yang wrote: > type Poly = [(Int,Int)] > > addPoly1 :: Poly -> Poly -> Poly > addPoly1 p1@(p1h@(p1c,p1d):p1t) p2@(p2h@(p2c,p2d):p2t) >| p1d == p2d = (p1c + p2c, p1d) : addPoly1 p1t p2t >| p1d < p2d = p1h : addPoly1 p1t

[Haskell-cafe] Bizarre garbage collection behaviour

2006-10-08 Thread Guillaume Theoret
I'm using Hugs98 for .NET and I'm running into some bizarre garbage collection issues. I hope I'm posting at the right spot. I didn't want to post this in Hugs bugs since I'm pretty new to Haskell and it's entirely possible I'm doing something a way I shouldn't. Back to the problem at hand. My s

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Udo Stenzel
Yang wrote: > type Poly = [(Int,Int)] > > addPoly1 :: Poly -> Poly -> Poly > addPoly1 p1@(p1h@(p1c,p1d):p1t) p2@(p2h@(p2c,p2d):p2t) >| p1d == p2d = (p1c + p2c, p1d) : addPoly1 p1t p2t >| p1d < p2d = p1h : addPoly1 p1t p2 >| p1d > p2d = p2h : addPoly1 p1 p2t > addPoly1 p1 [] = p1 > addP

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Donald Bruce Stewart
duncan.coutts: > On Sun, 2006-10-08 at 15:25 -0700, Jason Dagit wrote: > > > Another good idea when you have a pretty version which is easy to > > verify for correctness and an ugly version that is harder to verify is > > to use QuickCheck or SmallCheck and define a property that says both > > ver

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Duncan Coutts
On Sun, 2006-10-08 at 15:25 -0700, Jason Dagit wrote: > Another good idea when you have a pretty version which is easy to > verify for correctness and an ugly version that is harder to verify is > to use QuickCheck or SmallCheck and define a property that says both > versions are equal for all inp

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Jason Dagit
On 10/8/06, ihope <[EMAIL PROTECTED]> wrote: On 10/8/06, Yang <[EMAIL PROTECTED]> wrote: > And do most (experienced) Haskell > users sacrifice cleanliness for speed, or speed for cleanliness? Keep the internals of your code--that which will be looked at a lot--fast and ugly, while the rest can b

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread ihope
On 10/8/06, ihope <[EMAIL PROTECTED]> wrote: Keep the internals of your code--that which will be looked at a lot--fast and ugly, while the rest can be clean. Sorry. Meant "that which will be used a lot". ___ Haskell-Cafe mailing list Haskell-Cafe@hask

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread ihope
On 10/8/06, Yang <[EMAIL PROTECTED]> wrote: And do most (experienced) Haskell users sacrifice cleanliness for speed, or speed for cleanliness? Keep the internals of your code--that which will be looked at a lot--fast and ugly, while the rest can be clean. If you have a function that does someth

[Haskell-cafe] Re: Haskell performance (again)!

2006-10-08 Thread apfelmus
Hello, admittedly, there is a lack of material on lazy evaluation and performance. IMHO, the current wiki(book) and other articles are somewhat inadequate which stems from the fact that current rumor is "strictness is fast" and "arrays must be unboxed" or so. I don't agree with this, so I post som

[Haskell-cafe] Trying to serialize HList

2006-10-08 Thread Matthias Fischmann
... and here is the code I am giving up on for today: Serialization of HLists. Questions below. {-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-undecidable-instances #-} {-# OPTIONS -fallow-overlapping-instances #-} module Foo where import Char import List import Monad import Permutation i

[Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Yang
This email actually turned out much longer than I expected, but I hope it sparks interesting (and hopefully, thorough!) discussion on points that weren't touched on by previous threads on this topic. What follows describes my journey thus far exploring what I see (as a newcomer to Haskell) as a ma

Re: [Haskell-cafe] collection monads

2006-10-08 Thread Matthias Fischmann
On Sun, Oct 08, 2006 at 10:57:46PM +1300, [EMAIL PROTECTED] wrote: > To: haskell-cafe@haskell.org > From: [EMAIL PROTECTED] > Date: Sun, 08 Oct 2006 22:57:46 +1300 > Subject: [Haskell-cafe] collection monads > > Matthias Fischmann wrote: > > > Do you expect the contained type x to change during a

[Haskell-cafe] Trying to understand HList / hSequence now (it works, but why?! :-0)

2006-10-08 Thread Matthias Fischmann
Hi, here is how you do sequencing for HList, and a question why the type signatures are valid. Here is the code: {-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-undecidable-instances #-} module Foo where import Char import HListPrelude class (Monad m, HList l) => HSequence m l l' | l ->

Re: [Haskell-cafe] Haskell speaking Spanish

2006-10-08 Thread Bulat Ziganshin
Hello Luis, Friday, October 6, 2006, 6:52:04 AM, you wrote: > I have recently started editing a page on the Haskell.org wiki site > dedicated to our spanish-speaker community.[0] i had the same idea about Russian page although still not implemented it > I also expect we could get some of the ma

[Haskell-cafe] collection monads

2006-10-08 Thread tpledger
Matthias Fischmann wrote: > > Do you expect the contained type x to change during a > > sequence of monadic actions? e.g. would you ever use (>>=) > > at the type 'Permutation Int -> (Int -> Permutation Bool) -> > > Permutation Bool'? > > no, i don't need that. but aside from > the fact that > >