Re: [Haskell-cafe] fastest Fibonacci numbers in the West

2005-01-28 Thread William Lee Irwin III
Am Donnerstag, 27. Januar 2005 06:08 schrieb William Lee Irwin III: Inspired by a discussion on freenode #haskell, I tried to write the fastest Fibonacci number function possible, i.e. given a natural number input n to compute F_n. For the moment, mlton-generated binaries crash computing fib

Re: [Haskell-cafe] field record update syntax

2005-01-28 Thread John Meacham
On Thu, Jan 27, 2005 at 12:59:50PM -0500, S. Alexander Jacobson wrote: I have a lot of code of the form foo {bar = fn $ bar foo} Is there a more concise syntax? I am thinking the record equivalent of C's foo+=5... you can use DrIFT to automatically create bar_u to update a field and

Re: [Haskell-cafe] RE: Answers to Exercises in Craft of FP

2005-01-28 Thread Paul Hudak
Chris, I'm not sure that I understand your argument. How about this scenario, which is what I do: Students are assigned problems, without solutions. They are given some time to work them out and turn them in. Then they are given the solutions, most of which I go over in class. This does

[Haskell-cafe] RE: Answers to Exercises in Craft of FP

2005-01-28 Thread Christian Hofer
This should have been sent to haskell-cafe... Am 27.01.2005 um 21:28 schrieb Paul Hudak: Chris, I'm not sure that I understand your argument. How about this scenario, which is what I do: Students are assigned problems, without solutions. They are given some time to work them out and turn

Re: [Haskell-cafe] RE: Answers to Exercises in Craft of FP

2005-01-28 Thread Ketil Malde
Christian Hofer [EMAIL PROTECTED] writes: That is perfectly alright with me. The problem that we are discussing is that it would be helpful to have the solutions to the exercises for a book that I buy for studying on my own. How about: 1) Solve the excercises, and publish the solutions

RE: [Haskell-cafe] wierd type errros with MPTCs

2005-01-28 Thread Simon Peyton-Jones
The kind error seems fair enough. GHC looks at the class decl, and decides that indexVal is of kind *. Then the instance declaration uses it with kind (*-*). You may say that it should look at the instance decl too, before deciding kinds, but the instance decl might be in another file.

Re: [Haskell-cafe] File path programme

2005-01-28 Thread Krasimir Angelov
On Thu, 27 Jan 2005 16:31:21 -0500, robert dockins [EMAIL PROTECTED] wrote: I don't pretend to fully understand various unicode standard but it seems to me that these problems are deeper than file path library. The equation (decode . encode) /= id seems confusing for me. Can you give me an

[Haskell-cafe] Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Iavor Diatchki
Hello, On Fri, 28 Jan 2005 10:01:33 -0500, Jacques Carette [EMAIL PROTECTED] wrote: The previous post on record syntax reminded me of some 'problems' I had noticed where Haskell and mathematics have a (deep) usage mismatch. It is interesting that my sentiment is exactly the opposite.

[Haskell-cafe] Re: field record update syntax

2005-01-28 Thread Peter Simons
John Meacham writes: you can use DrIFT to automatically create bar_u to update a field and bar_s to set a field. That is exactly what I need. Is there, by any chance, a solution that's based on Template Haskell too? Not that I'd have something against DrIFT; I'm just curious to know.

[Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread Chung-chieh Shan
Henning Thielemann [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: Over the past years I became more and more aware that common mathematical notation is full of inaccuracies, abuses and stupidity. I wonder if mathematical notation is subject of a

Re: [Haskell-cafe] Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Henning Thielemann
On Fri, 28 Jan 2005, Iavor Diatchki wrote: Hello, On Fri, 28 Jan 2005 10:01:33 -0500, Jacques Carette [EMAIL PROTECTED] wrote: The previous post on record syntax reminded me of some 'problems' I had noticed where Haskell and mathematics have a (deep) usage mismatch. It is interesting

[Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread Henning Thielemann
On Fri, 28 Jan 2005, Chung-chieh Shan wrote: Henning Thielemann [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: Over the past years I became more and more aware that common mathematical notation is full of inaccuracies, abuses and stupidity. I wonder

[Haskell-cafe] Nice pedagogical examples of type classes?

2005-01-28 Thread Benjamin Pierce
My Advanced Programming course is quickly approaching the lectures on type classes, and I am interested in finding a little more (beyond what's in SOE) in the way of examples that illustrate nice uses (especially of more advanced aspects of the class system). I'd be most grateful for pointers to

Re: [Haskell-cafe] mathematical notation and functional programming

2005-01-28 Thread Fritz Ruehr
Well, I don't know about modern works which might appeal to knowledge of FP languages, but there is a well-known, 2-volume work by Cajori: Cajori, F., A History of Mathematical Notations, The Open Court Publishing Company, Chicago, 1929 (Available from Dover). I know it through Ken Iverson

[Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread Chung-chieh Shan
On 2005-01-28T20:16:59+0100, Henning Thielemann wrote: On Fri, 28 Jan 2005, Chung-chieh Shan wrote: But I would hesitate with some of your examples, because they may simply illustrate that mathematical notation is a language with side effects -- see the third and fifth examples below. I

Re: [Haskell-cafe] mathematical notation and functional programming

2005-01-28 Thread Michael Matsko
Also, Walter Noll of Carnegie Mellon Univ. wrote a book, Finite-Dimensional Spacesin 1987 which basically presented undergraduate math in a notationally and conceptually unified manner. Some of the notation and terminology was strange, but consistent. Mike Matsko - Original Message

Re: [Haskell-cafe] File path programme

2005-01-28 Thread robert dockins
I don't pretend to fully understand various unicode standard but it seems to me that these problems are deeper than file path library. The equation (decode . encode) /= id seems confusing for me. Can you give me an example when this happen? I am pretty sure that ISO 2022 encoded strings can have

Re: [Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread Ketil Malde
Chung-chieh Shan [EMAIL PROTECTED] writes: O(n) which should be O(\n - n) (a remark by Simon Thompson in The Craft of Functional Programming) It's a neat thought, IMHO. I usually try to quantify the variables used, making the equivalent of 'let n = .. in

Re: [Haskell-cafe] mathematical notation and functional programming

2005-01-28 Thread Jorge Adriano Aires
Things I'm unhappy about are for instance f(x) \in L(\R) where f \in L(\R) is meant F(x) = \int f(x) \dif x where x shouldn't be visible outside the integral O(n) which should be O(\n - n) (a remark by Simon Thompson in The Craft of Functional

Re: [Haskell-cafe] Re: mathematical notation and functional programming

2005-01-28 Thread William Lee Irwin III
On Fri, Jan 28, 2005 at 08:16:59PM +0100, Henning Thielemann wrote: But what do you mean with 1/O(n^2) ? O(f) is defined as the set of functions bounded to the upper by f. So 1/O(f) has no meaning at the first glance. I could interpret it as lifting (1/) to (\f x - 1 / f x) (i.e. lifting from

Re: [Haskell-cafe] Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Jacques Carette
[I have now subscribed to haskell-cafe] Henning Thielemann [EMAIL PROTECTED] wrote: This seems to be related to what I wrote yesterday http://www.haskell.org/pipermail/haskell-cafe/2005-January/008893.html Yes, very much. Except that rather than trying to tell mathematicians that they are

Re: [Haskell-cafe] Re: field record update syntax

2005-01-28 Thread John Meacham
On Fri, Jan 28, 2005 at 02:36:59PM +0100, Peter Simons wrote: you can use DrIFT to automatically create bar_u to update a field and bar_s to set a field. That is exactly what I need. Is there, by any chance, a solution that's based on Template Haskell too? Not that I'd have something

Re: [Haskell-cafe] mathematical notation and functional programming

2005-01-28 Thread Hamilton Richards
At 9:14 PM +0100 2005/1/27, Henning Thielemann wrote: Over the past years I became more and more aware that common mathematical notation is full of inaccuracies, abuses and stupidity. I wonder if mathematical notation is subject of a mathematical branch and whether there are papers about this