Permutations of a list

2001-05-14 Thread Andy Fugard
Hi all, I'm currently teaching myself a little Haskell. This morning I coded the following, the main function of which, permutate, returns all the permutations of a list. (Well it seems to at least!) insertAt :: a - Int - [a] - [a] insertAt x i xs | i 0 || i length xs = error

Re: Permutations of a list

2001-05-14 Thread Ralf Hinze
Andy Fugard wrote: My main question is really what facilities of the language I should be looking at to make this code more elegant! As you can see I currently know only the basics of currying, and some list operations. Definitely list comprehensions! I digged out some old code: module

Re: Permutations of a list

2001-05-14 Thread Andy Fugard
At 13:43 14/05/01 +0200, Ralf Hinze wrote: Andy Fugard wrote: My main question is really what facilities of the language I should be looking at to make this code more elegant! As you can see I currently know only the basics of currying, and some list operations. Definitely list

permutations. Reply

2001-05-14 Thread S.D.Mechveliani
Andy Fugard [EMAIL PROTECTED] writes Hi all, I'm currently teaching myself a little Haskell. This morning I coded the following, the main function of which, permutate, returns all the permutations of a list. (Well it seems to at least!) [..] The BAL library implements several

CA proposal by D.Thurston

2001-05-14 Thread S.D.Mechveliani
I was said that there exists an algebraic library proposal for Haskell (version 0.02) dated by February (2001?), by Dylan Thurston. Who could, please, tell me where to download this document from? For I could not find it from http://haskell.org Thanks in advance for the help.

Re: CA proposal by D.Thurston

2001-05-14 Thread Ch. A. Herrmann
Hi Haskellers, S == S D Mechveliani S.D.Mechveliani writes: S I was said that there exists an algebraic library proposal for S Haskell (version 0.02) dated by February (2001?), by Dylan S Thurston. that sounds interesting for me. Sorry, that I don't have an answer to your

Re: CA proposal by D.Thurston

2001-05-14 Thread Fergus Henderson
On 14-May-2001, S.D.Mechveliani [EMAIL PROTECTED] wrote: I was said that there exists an algebraic library proposal for Haskell (version 0.02) dated by February (2001?), by Dylan Thurston. Who could, please, tell me where to download this document from? For I could not find it from

Re: Happy and Macros (was Re: ANNOUNCE: Happy 1.10 released)

2001-05-14 Thread Carl R. Witty
Manuel M. T. Chakravarty [EMAIL PROTECTED] writes: I didn't say that this works for any kind of parser combinator, I merely said that it works Doitse's and mine. Both implement SLL(1) parsers for which - as I am sure, you know - there exists a decision procedure for testing ambiguity. More

standard library. Reply

2001-05-14 Thread S.D.Mechveliani
Ch. A. Herrmann [EMAIL PROTECTED] writes [..] Anyway, an algebraic library is important: it is nice that Haskell has the rational numbers but recently, it appeared useful for me also to have the algebraic numbers, e.g., to evaluate expressions containing roots exactly. The problem is that

Re: Happy and Macros (was Re: ANNOUNCE: Happy 1.10 released)

2001-05-14 Thread Carl R. Witty
Manuel M. T. Chakravarty [EMAIL PROTECTED] writes: I didn't say that this works for any kind of parser combinator, I merely said that it works Doitse's and mine. Both implement SLL(1) parsers for which - as I am sure, you know - there exists a decision procedure for testing ambiguity. More

Things and limitations...

2001-05-14 Thread Tom Pledger
Juan Carlos Arevalo Baeza writes: : | First, about classes of heavily parametric types. Can't be done, I | believe. At least, I haven't been able to. What I was trying to do (as an | exercise to myself) was reconverting Graham Hutton and Erik Meijer's | monadic parser library into a