Re: [Haskell-cafe] Where do you use Haskell?

2005-05-03 Thread Jeremy Shaw
Hello, What if main had a function prototype like: main :: String - String And you passed stdin to main as string, and you print the output of main to stdout. As long as you run the program with the same stdin, when main calls 'ask_user_name stdin', you will always get the same answer, right ?

Re: [Haskell-cafe] Where do you use Haskell?

2005-05-03 Thread Tomasz Zielonka
On Tue, May 03, 2005 at 12:38:25AM -0400, Daniel Carrera wrote: So, I figure that to do these tasks you heed that do ... - work around. But that kills the whole point of using FP in the first place, right? In my experience, the amount of IO code in an average Haskell program is from 1% to

Re: [darcs-users] RE: [Haskell-cafe] fptools in darcs now available

2005-05-03 Thread Daan Leijen
Simon Marlow wrote: But what worries me is: if I just want to check out e.g. Haddock, I have to get the entire fptools repo (350M+, wasn't it?). I can build a source distribution with just the bits I want, but I can't get a darcs tree with anything but the whole lot. So, here's two potential

Re: [Haskell-cafe] Where do you use Haskell?

2005-05-03 Thread Daniel Carrera
Tomasz Zielonka wrote: In my experience, the amount of IO code in an average Haskell program is from 1% to 20%, even in applications which have to do a fair amount of interaction with the outside world (networking, CGI, system utils). Ok, I can see that. Thanks. Haskell's IO is not just a mimicry

Re: [Haskell-cafe] Where do you use Haskell?

2005-05-03 Thread Daniel Carrera
Ben Lippmeier wrote: You might like to take a deep breath and start with: Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell - Simon Peyton Jones http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/ Ok. And I'll get to

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-03 Thread Daniel Fischer
Am Dienstag, 3. Mai 2005 03:48 schrieben Sie: Daniel Fischer writes: Due to lazyness, we can have infinite lists (and other infinite structures) in Haskell (of course, in finite time, only a finite portion of those can be evaluated), e.g. ns = [1 .. ] :: [Integer] is an infinite list

Re: [Haskell-cafe] Where do you use Haskell?

2005-05-03 Thread robert dockins
Hi all, Again, I'm the new guy slowly learning this fuctional programming thing. :-) [snip] So, I'm tempted to conclude that FP is only applicable to situations where user interaction is a small part of the program. For example, for simulations. Now, I'm sure I'm not the first person to have

[Haskell-cafe] Speed comparison?

2005-05-03 Thread Daniel Carrera
Hi all, Thank you for all the information on my previous question. I learned a lot, and good pointers to more info. My next question is about speed. How fast would you consider Haskell? (say, for computational work). How would you compare it to C, Python and Ruby? I suggest C, Python and Ruby

Re: [Haskell-cafe] Speed comparison?

2005-05-03 Thread Daniel Carrera
Greg Buchholz wrote: You might find the The Great Computer Language Shootout informative... http://shootout.alioth.debian.org/ Thanks! That's a great resource. At first glance, Haskell seems to do well over-all. Cheers, Daniel. ___ Haskell-Cafe

[Haskell-cafe] Haskell vs OCaml

2005-05-03 Thread Daniel Carrera
Hey, Marcin just mentioned OCaml as another functional programming language I should keep in mind. Can anyone offer an opinion on how Haskell and OCaml compare? Is OCaml as easy to learn as Haskell? Does it have much the same virtues? I'll go take a look at it. /daniel goes to Google. Cheers,

Re: [Haskell-cafe] Haskell vs OCaml

2005-05-03 Thread Daniel Carrera
Marcin, Are you sure that OCaml is similar to Haskell? At first glance, it doesn't even look functional. It looks like an imperative language. Cheers, Daniel. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell vs OCaml

2005-05-03 Thread Sebastian Sylvan
On 5/3/05, Daniel Carrera [EMAIL PROTECTED] wrote: Marcin, Are you sure that OCaml is similar to Haskell? At first glance, it doesn't even look functional. It looks like an imperative language. It is functional, but it's not pure (ie it allows side effects) and doesn't have as nice syntax.

[Haskell-cafe] Here's a curve ball for Haskell.

2005-05-03 Thread Daniel Carrera
Alright, in Haskell there are no side-effects when you call a function twice on the same data you get the same result... I just decided I'll try to write a good pseudo random number generator in Haskell :-) I'm off to class now, but I'll try it tonight. Cheers, Daniel.

[Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread John Goerzen
On 2005-05-03, Daniel Carrera [EMAIL PROTECTED] wrote: Marcin just mentioned OCaml as another functional programming language I should keep in mind. Can anyone offer an opinion on how Haskell and OCaml compare? Is OCaml as easy to learn as Haskell? Does it have much the same virtues? I

[Haskell-cafe] Re: Speed comparison?

2005-05-03 Thread John Goerzen
On 2005-05-03, Daniel Carrera [EMAIL PROTECTED] wrote: Greg Buchholz wrote: You might find the The Great Computer Language Shootout informative... http://shootout.alioth.debian.org/ Thanks! That's a great resource. At first glance, Haskell seems to do well over-all. It's also

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Marcin 'Qrczak' Kowalczyk
John Goerzen [EMAIL PROTECTED] writes: I'd say that there are probably no features OCaml has that Haskell lacks that are worth mentioning. Its type system has some interesting features: polymorphic variants, parametric modules, labeled and optional arguments, objects, variance annotations of

Re: [Haskell-cafe] How to join two lists of lists?

2005-05-03 Thread Sebastian Sylvan
On 5/3/05, Khrystyna Mandziy [EMAIL PROTECTED] wrote: Hi all! I'm trying to join to lists of lists. The problem is, i would like to get a new list of lists of tuples and not list of tuples of lists (that what zip makes). list1 = [[1,2],[3,4],[5,6]] list2 = [[a,b],[c,d],[e,f]]

Re: [Haskell-cafe] How to join two lists of lists?

2005-05-03 Thread Tomasz Zielonka
On Tue, May 03, 2005 at 10:13:04PM +0200, Khrystyna Mandziy wrote: Hi all! I'm trying to join to lists of lists. The problem is, i would like to get a new list of lists of tuples and not list of tuples of lists (that what zip makes). list1 = [[1,2],[3,4],[5,6]] list2 = [[a,b],[c,d],[e,f]]

Re: [Haskell-cafe] How to join two lists of lists?

2005-05-03 Thread robert dockins
Hi all! I'm trying to join to lists of lists. The problem is, i would like to get a new list of lists of tuples and not list of tuples of lists (that what zip makes). list1 = [[1,2],[3,4],[5,6]] list2 = [[a,b],[c,d],[e,f]] desiredlist = [[(1,a),(2,b)],[(3,c),(4,d)],[(5,e),(6,f)]] Prelude

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Donn Cave
On Tue, 3 May 2005, Marcin 'Qrczak' Kowalczyk wrote: ... Its type system has some interesting features: polymorphic variants, parametric modules, labeled and optional arguments, objects, variance annotations of type parameters used for explicit subtyping. It has more convenient exceptions:

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Michael Vanier
Marcin gives a good capsule description of the differences between ocaml and haskell. Let me add my two cents. I also learned ocaml before learning haskell, and the biggest single difference I found is that haskell is a lazy, purely functional language and ocaml is a strict, mostly functional

[Haskell-cafe] Array functions?

2005-05-03 Thread Daniel Carrera
Hello, I hope these don't turn out to be RTFM questions, but I can't find them in my FM :-) 1) Is there a function to get the ith element from an array? 2) Is there a function to get the index of an entry in an array? I've implemented these two functions below: 1) find 0 (x:xs) = x find n (x:xs)

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Marcin 'Qrczak' Kowalczyk
Michael Vanier [EMAIL PROTECTED] writes: I also learned ocaml before learning haskell, and the biggest single difference I found is that haskell is a lazy, purely functional language and ocaml is a strict, mostly functional language. Indeed. In contrast to this one, my differences were not

Re: [Haskell-cafe] Array functions?

2005-05-03 Thread Benjamin Franksen
On Wednesday 04 May 2005 01:26, Daniel Carrera wrote: Hello, I hope these don't turn out to be RTFM questions, but I can't find them in my FM :-) Take a look at this one: http://www.haskell.org/onlinelibrary/standard-prelude.html 1) Is there a function to get the ith element from an array?

Re: [Haskell-cafe] Array functions?

2005-05-03 Thread Daniel Carrera
Hi Ben, Take a look at this one: http://www.haskell.org/onlinelibrary/standard-prelude.html Thanks. What's the Prelude ? 1) Is there a function to get the ith element from an array? From your own implementations I gather you mean 'list', not 'array'. What's the difference? Now, if you happen to

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Erik de Castro Lopo
On Tue, 3 May 2005 15:41:22 -0700 (PDT) Michael Vanier [EMAIL PROTECTED] wrote: I also learned ocaml before learning haskell, I'm a long term C, Python and (yuck) C++ programmer who picked up Ocaml about 9 months ago. I picked Ocaml over Haskell because I thought I needed objects, but I have

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-03 Thread Andrew Pimlott
On Wed, May 04, 2005 at 12:40:13PM +1000, Erik de Castro Lopo wrote: That leaves one aspect of Haskell vs Ocaml I don't yet understand. What are the advantages of lazy evaluation? The advantage of lazy evaluation is that evaluation order becomes one less thing you have to think about. The