Re: [Haskell-cafe] library sort

2006-02-17 Thread Radu Grigore
On 2/16/06, Jared Updike <[EMAIL PROTECTED]> wrote: > If you need an easier way to search the Haskell APIs, use Hoogle: Hoogle is very nice. Thanks to everyone who answered my question about finding a sort library function. -- regards, radu http://rgrig.blogspot.com/ ___

[Haskell-cafe] library sort

2006-02-16 Thread Radu Grigore
Is there a sort function in the libraries that come with GHC (6.4)? My search at http://www.haskell.org/ghc/docs/latest/html/libraries/index.html has failed, but I can't believe there is none. -- regards, radu http://rgrig.blogspot.com/ ___ Haskell-C

Re: [Haskell-cafe] Problems with square root...

2005-12-21 Thread Radu Grigore
On 12/21/05, Daniel Carrera <[EMAIL PROTECTED]> wrote: > > round sqrt(2) > I don't understand why it dosn't work without brackets. Function application is left associative in Haskell. -- regards, radu http://rgrig.blogspot.com/ ___ Haskell-Cafe maili

Re: [Haskell-cafe] Haskell-style proof tools?

2005-09-21 Thread Radu Grigore
On 9/21/05, Robin Green <[EMAIL PROTECTED]> wrote: > Does anyone know of a prover / proof assistant / proof verifier which uses a > vaguely Haskell-like syntax? That is to say, it allows you to express > theorems in Haskell-style syntax, print proof steps in Haskell-style syntax, > etc. Skimming t

Re: [Haskell-cafe] Coin changing algorithm

2005-07-13 Thread Radu Grigore
On 7/13/05, Dinh Tien Tuan Anh <[EMAIL PROTECTED]> wrote: > i guess i have to learn Monads then, ^_^ That's probably a good idea. But what about this problem made you think "monads"? Caching? The imperative solution you mentioned? -- regards, radu http://rgrig.blogspot.com/ ___

Re: [Haskell-cafe] Coin changing algorithm

2005-07-13 Thread Radu Grigore
On 7/13/05, ChrisK <[EMAIL PROTECTED]> wrote: > Sort the list of integers, highest at the front of the list. > (And perhaps remove duplicates with nub) The first time I wrote in the comments that 'partition' takes a "decreasing list of integers..." and then I decided to drop "decreasing". Weakest

Re: [Haskell-cafe] Coin changing algorithm

2005-07-13 Thread Radu Grigore
On 7/13/05, Dinh Tien Tuan Anh <[EMAIL PROTECTED]> wrote: > Any idea ? This is the first thing I wrote when i read your problem: === begin integer_partition.lhs === This is a solution to a question asked on Haskell cafe. The problem looks like a classical one. You are given a list of positive in

Re: [Haskell-cafe] Compiling an extremely large Haskell file (in GHC)

2005-06-28 Thread Radu Grigore
On 6/29/05, Duncan Coutts <[EMAIL PROTECTED]> wrote: > Indeed I understand from a colleague who implemented an all-pairs > shortest paths algorithm in Haskell over the weekend for a map of the > Hyde Park area of Chicago (no real reason, really!), that it takes about > 0.1 seconds to execute (if y

Re: [Haskell-cafe] Compiling an extremely large Haskell file (in GHC)

2005-06-28 Thread Radu Grigore
On 6/27/05, Arjun Guha <[EMAIL PROTECTED]> wrote: > It's the all-pairs > shortest paths data for a map of the Hyde Park area of Chicago (no real > reason, really). I wonder: is there really no way to do Floyd-Warshall in Haskell? -- regards, radu http://rgrig.blogspot.com/ _

Re: [Haskell-cafe] (small) code review request

2005-06-16 Thread Radu Grigore
On 6/16/05, Lennart Augustsson <[EMAIL PROTECTED]> wrote: > fib n = f n 1 1 >where f 0 _ b = b > f n a b = f (n-1) (a+b) a Indeed. I should have seen this. It's a pretty standard trick for making a function tail recursive. > List based solutions should also work if garbage collection

[Haskell-cafe] (small) code review request

2005-06-16 Thread Radu Grigore
The programming language I know best is C++. Wait, don't close the message. I also know OCaml and a couple of days ago I read "A Gentle Introduction to Haskell". In order to practice what I've learned a bit above "hello world" programs I chose to solve some easy tasks from SPOJ. They have automati

Re: [Haskell-cafe] I love type declarations. :-)

2005-05-06 Thread Radu Grigore
On 5/6/05, Daniel Carrera <[EMAIL PROTECTED]> wrote: > function :: Int -> Int -> [Int] > Before, when writing imperative code, I would add a comment for each > function describing its input and output. Now type declarations provide What do you mean? In C++ one would write: vector function(int a

[Haskell-cafe] ghc install

2004-12-11 Thread Radu Grigore
Hi, I try to install ghc on 6.2 on a gentoo linux distribution (from sources). It fails with --- /usr/bin/ar: creating libHSbase.a xargs: /usr/bin/ar: terminated by signal 15 --- It looks like it's a lack of resources. The computer is a Celeron 1.3GHz with 160MB RAM & 400MB swap. Isn't that enough