Re: [Haskell] Typing in haskell and mathematics

2005-02-01 Thread Ben Rudiak-Gould
Jeremy Gibbons wrote: If you want "a < b < c" to mean "(a < b) && (b < c)" but "a + b + c" to mean "(a + b) + c", you're going to have to treat "<" differently from "+", which goes against the spirit of considering them both simply functions. I've wanted to chime in here for a while now. I stron

Re: [Haskell] Typing in haskell and mathematics

2005-02-01 Thread Benjamin Franksen
On Tuesday 01 February 2005 02:41, Jeremy Gibbons wrote: > <[EMAIL PROTECTED]> wrote: > > BTW, 'sigma sin' is not a function. > > I'm missing something here. I don't have an integral symbol to hand, > which is what I meant by the "sigma", I understood it that way. But let us use '\int' or '\integ

Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Jeremy Gibbons
On 1 Feb 2005, at 05:20, Cale Gibbard wrote: Statements like "a < b < c" are perfectly clear to everyone present, and if anyone has a type error in their head when reading that which they can't get past, they are most likely just being stubborn. Actually, that's another nice example of what I was t

Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Lennart Augustsson
Cale Gibbard wrote: Another common thing which is done whenever convenient is to treat Cartesian product as associative, and naturally identify the spaces (A x A) x A and A x (A x A), along with perhaps A^3 which might be functions f: {0,1,2} -> A, It's fine to identify (A x A) x A with A x (A x A

Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Cale Gibbard
I agree, as an undergraduate student of pure mathematics, I have been finding fairly large parts of the discussion about mathematical notation to be somewhat silly and uninformed. (Really it was more the previous thread, but it seems to have been continued here). One thing to keep in mind about mat

Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Bjorn Lisper
Jacques Carette: >Yes, I am aware that this untypeable in Haskell, because polymorphism is >straight-jacketed by structural rules. But >in mathematics, it is convenient and extremely common to: >1) look at the type a -> b as being a *subtype* of b (though I have never seen >it phrased that

Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Benjamin Franksen
On Monday 31 January 2005 04:24, Jeremy Gibbons wrote: > Despite being a fan of generic programming, I have my doubts about > this kind of automatic lifting. It works fine in "ordinary > mathematics", because there is no fear of confusion - one hardly ever > deals with functions as entities in thei

Re: [Haskell] Typing in haskell and mathematics

2005-01-30 Thread Jeremy Gibbons
Despite being a fan of generic programming, I have my doubts about this kind of automatic lifting. It works fine in "ordinary mathematics", because there is no fear of confusion - one hardly ever deals with functions as entities in their own right. (Witness "sigma sin(x) dx", involving a term sin(x

Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Jacques Carette
Tomasz Zielonka <[EMAIL PROTECTED]> wrote: It's not as bad as you think. You can do this: {-# OPTIONS -fglasgow-exts #-} module Apply where class Apply f a b | f -> a, f -> b where apply :: f -> a -> b instance Apply (a -> b) a b where apply f a = f a instance Ap

Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Tomasz Zielonka
On Fri, Jan 28, 2005 at 10:01:33AM -0500, Jacques Carette wrote: > The previous post on record syntax reminded me of some 'problems' I had > noticed where Haskell and mathematics have a (deep) usage mismatch. > > First, consider a syntax for other component-wise function application? > For exam