[Haskell-cafe] GHCi and HXT

2006-11-27 Thread Alexis Hazell
Hi all, i'm having a bit of difficulty using GHCi to try out HXT. i brought the Text.XML.HXT.Arrow module into scope using :m. Then i entered: let contact = mkelem "stream:stream" [ sattr "xmlns:stream" "http://etherx.jabber.org/streams";, sattr "xmlns" "jabber:client", sattr "to" "liv

[Haskell-cafe] [Redirect] polymorphism and existential types

2006-11-27 Thread Donald Bruce Stewart
Redirected to haskell-cafe@haskell.org, the right list. -- Don - Forwarded message from Louis-Julien Guillemette <[EMAIL PROTECTED]> - Date: Mon, 27 Nov 2006 16:15:26 -0500 (EST) From: Louis-Julien Guillemette Subject: [Haskell] polymorphism and existential types Supposing a polymorphic

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Donald Bruce Stewart
trevion: > Hello, > > First, and forgive me if I'm making unwarranted assumptions, but > http://haskell.org/haskellwiki/Homework_help might be useful. Yes, almost certainly this is the case. The same questions were asked on #haskell at pretty much the same time... 15:54:34 --- join: greg_lun

[Haskell-cafe] RE: why are implicit types different? (cleanup)

2006-11-27 Thread Benjamin Franksen
S. Alexander Jacobson wrote: > Ok, I'm not sure I understand the answer here, but how about a > workaround. My current code looks like this: > > tt = let ?withPassNet=wpn > ?withPassNet'=wpn > ?withPassNet''=wpn > in passNet "passnet" ["user"] regImpl b > >

[Haskell-cafe] Re: Re: The Future of MissingH

2006-11-27 Thread Benjamin Franksen
Bulat Ziganshin wrote: > Monday, November 27, 2006, 1:46:34 AM, you wrote: >> I hate to be nitpicking but GPL is not only compatible with but >> encourages commerce in general and commercial software in particular. It >> is incompatible with proprietary software. There's a difference. > > of cours

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Mark T.B. Carroll
escafia <[EMAIL PROTECTED]> writes: > Hi, > > i've one fuction receiving an int . The objective is return the respective > binary code of that int. > > For example, if i receive 28 the fuction will return 011100. In GHCi, Prelude> Numeric.showIntAtBase 2 (head . show) 28 $ "" "11100" > My ques

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Stefan O'Rear
On Mon, Nov 27, 2006 at 06:20:15PM -0600, J. Garrett Morris wrote: > First, and forgive me if I'm making unwarranted assumptions, but > http://haskell.org/haskellwiki/Homework_help might be useful. > > On 11/25/06, escafia <[EMAIL PROTECTED]> wrote: > >i've one fuction receiving an int . The objec

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Valentin Gjorgjioski
On 28.11.2006 01:20 J. Garrett Morris wrote: Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Second: div, mod, reverse, and the unfoldr function from Data.List will do what you want. /g On 11/25/06, escafia

Re: [Haskell-cafe] c2hs and cabal?

2006-11-27 Thread Duncan Coutts
On Mon, 2006-11-27 at 22:26 +, Magnus Therning wrote: > Can I use cabal to build packages that incorporates C libraries and FFI > Haskell created using c2hs? Yes you can. Cabal understands a bit about .chs files. I think all you need to do is specify the module in the exposed-modules or other-

Re: [Haskell-cafe] Binary code

2006-11-27 Thread J. Garrett Morris
Hello, First, and forgive me if I'm making unwarranted assumptions, but http://haskell.org/haskellwiki/Homework_help might be useful. Second: div, mod, reverse, and the unfoldr function from Data.List will do what you want. /g On 11/25/06, escafia <[EMAIL PROTECTED]> wrote: Hi, i've one fuc

[Haskell-cafe] Binary code

2006-11-27 Thread escafia
Hi, i've one fuction receiving an int . The objective is return the respective binary code of that int. For example, if i receive 28 the fuction will return 011100. My question is that there is any fuction in libraries that do this? If not, anyone has any suggestion? Thank you. -- View this

[Haskell-cafe] c2hs and cabal?

2006-11-27 Thread Magnus Therning
Can I use cabal to build packages that incorporates C libraries and FFI Haskell created using c2hs? Any pointers on how to do that? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] http://therning.org/magnus Softwar

[Haskell-cafe] Re: Difficult memory leak in array processing

2006-11-27 Thread apfelmus
> nor that I would really understand the code you've posted. On the positive > side of things, you've given me a lot to think about. Maybe in the > fullness of time I shall return and say 'Lo! I can write leakless > Haskell code!'. But alas, that time seems so distant now. I tried to show how the

RE: [Haskell-cafe] why are implicit types different? (cleanup)

2006-11-27 Thread S. Alexander Jacobson
Ok, I'm not sure I understand the answer here, but how about a workaround. My current code looks like this: tt = let ?withPassNet=wpn ?withPassNet'=wpn ?withPassNet''=wpn in passNet "passnet" ["user"] regImpl b The type of wpn is: wpn :: Ev PassNet ev a -

Re: [Haskell-cafe] Difficult memory leak in array processing

2006-11-27 Thread Claus Reinke
In fact it turned out that the example code I posted did not exhibit the memory leak at all. It just took a /very long time/ to complete (compared to a Java version), but it did complete. My complete code, which also counted the instances of a given number from the array, does however exhibit the

[Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Max Vasin
> "Bulat" == Bulat Ziganshin <[EMAIL PROTECTED]> writes: Bulat> Hello Max, Hello, Bulat> Monday, November 27, 2006, 10:04:15 AM, you wrote: > A small addition: some GPLed libraries (libstdc++ AFAIK) allow >> linking with proprietary software by adding clause to lisence >> which relaxes GPL r

Re: [Haskell-cafe] Difficult memory leak in array processing

2006-11-27 Thread Niko Korhonen
Ian Lynagh wrote: > I'm also unable to reproduce this. Can you tell us exactly what > commandline you are using to compile and run the program please? In fact it turned out that the example code I posted did not exhibit the memory leak at all. It just took a /very long time/ to complete (compared

Re: [Haskell-cafe] Difficult memory leak in array processing

2006-11-27 Thread Niko Korhonen
I can say neither that I have any idea what an 'undead array' is nor that I would really understand the code you've posted. On the positive side of things, you've given me a lot to think about. Maybe in the fullness of time I shall return and say 'Lo! I can write leakless Haskell code!'. But alas,

RE: [Haskell-cafe] why are implicit types different? (cleanup)

2006-11-27 Thread Simon Peyton-Jones
Implicit parameters have monotypes, not polytypes. So ?f in g gets type (Char->Char). I rather doubt that something more general (implicit parameters get polytypes) would work, given the implicit "improvement" rules that implicit parameters require. Simon | -Original Message- | From

Re: [Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Alex Queiroz
Hallo, On 11/27/06, Max Vasin <[EMAIL PROTECTED]> wrote: A small addition: some GPLed libraries (libstdc++ AFAIK) allow linking with proprietary software by adding clause to lisence which relaxes GPL requirements. Nope, it's LGPL with an extra binary linking permission. Cheers, -- -alex

[Haskell-cafe] ANN: NeHe Tutorials in Haskell

2006-11-27 Thread Jason Dagit
Hello, I was recently reminded by http://haskell.org/haskellwiki/How_to_write_a_Haskell_program that you should announce your haskell projects! About a year ago I started converting the (somewhat) famous NeHe tutorials for OpenGL to HOpenGL. I have created a darcs repository for anyone interest

Re: [Haskell-cafe] Optimizing a hash function

2006-11-27 Thread Ivan Tomac
Hi, I've seen that guide before and followed the suggestions in there but somehow I missed the -funfolding-use-threshhold option. After setting it to 24 the code now runs about 2-3 times slower than C which is a significant improvement from a factor of 10. Thanks :) Ivan On 27/11/2006, a

Re: [Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Bulat Ziganshin
Hello Max, Monday, November 27, 2006, 10:04:15 AM, you wrote: > A small addition: some GPLed libraries (libstdc++ AFAIK) allow > linking with proprietary software by adding clause to lisence > which relaxes GPL requirements. a GPL license text is the same for any GPLed software, otherwise it can

Re: [Haskell-cafe] Re: The Future of MissingH

2006-11-27 Thread Bulat Ziganshin
Hello Benjamin, Monday, November 27, 2006, 1:46:34 AM, you wrote: > I hate to be nitpicking but GPL is not only compatible with but encourages > commerce in general and commercial software in particular. It is > incompatible with proprietary software. There's a difference. of course, but on prac

RE: [Haskell] Re: [Haskell-cafe] SimonPJ and Tim Harris explain STM - video

2006-11-27 Thread Simon Peyton-Jones
| Normally after a retry the STM block is rolled back and put to sleep and will | only be awakened and re-executed if one of the STM variables it had read from is | committed to by a different STM block. The *semantics* are that it is retried anytime in the future. The *pragmatics* are as you d