Re: How overload operator in Haskell?

2003-07-12 Thread Andrew J Bromage
G'day all. On Fri, Jul 11, 2003 at 04:28:19PM -0400, Dylan Thurston wrote: Don't be silly [...] Never! Cheers, Andrew Bromage ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: How overload operator in Haskell?

2003-07-12 Thread Jon Fairbairn
On 2003-07-12 at 20:20+1000 Andrew J Bromage wrote: G'day all. On Fri, Jul 11, 2003 at 04:28:19PM -0400, Dylan Thurston wrote: Don't be silly [...] Never! Or only sometimes. I'm surprised that no-one has yet answered the question How overload operator in Haskell? with Overload operator

Re: How overload operator in Haskell?

2003-07-12 Thread Liu Junfeng
I come up a solution as this: --- module Vector where data Vector =Vector [Double] fromVector :: Vector - [Double] fromVector (Vector v) = v fromList :: [Double] - Vector fromList v = Vector v toVector :: Double - Vector toVector x = Vector (repeat

Re: Reading/Writing Binary Data in Haskell

2003-07-12 Thread Martin Sjögren
tor 2003-07-10 klockan 04.56 skrev Glynn Clements: OTOH, existing implementations (at least GHC and Hugs) currently read and write 8-bit binary, i.e. characters 0-255 get read and written as-is and anything else breaks, and changing that would probably break a fair amount of existing code.

Re: How overload operator in Haskell?

2003-07-12 Thread Ganesh Sittampalam
On Thu, 10 Jul 2003 10:58:51 +1000, Andrew J Bromage [EMAIL PROTECTED] wrote: This suggests that wrapping each standard mathemtaical function/operator in its own typeclass would have literally no run-time performance penalty: class Plus a b c | a b - c where (+) :: a - b - c

CFP: CLIMA IV - 4th Intl. Workshop on Computational Logic in Multi-Agent Systems

2003-07-12 Thread João Alexandre Leite
== FIRST CALL FOR PAPERS CLIMA IV Fourth International Workshop on Computational Logic in Multi-Agent Systems

Re: How overload operator in Haskell?

2003-07-12 Thread Dylan Thurston
On Fri, Jul 11, 2003 at 05:38:18PM +1000, Andrew J Bromage wrote: G'day all. On Thu, Jul 10, 2003 at 11:16:56PM -0700, Ashley Yakeley wrote: As written, this is _not_ a good idea. Trust me, you end up having to put type annotations everywhere. Even (3 + 4 :: Integer) is ambiguous,

Re: Arrow Classes

2003-07-12 Thread Alastair Reid
I'm glad to hear there isn't a _serious_ cost (i.e. performance penalty) for fine-grained hierarchies. One cost which doesn't seem to have been mentioned is the programmer cost. With the current Haskell Prelude, a matrix operation (say) might have type: invert :: Num a = Matrix a -

Re: Arrow Classes

2003-07-12 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Alastair Reid [EMAIL PROTECTED] wrote: One way to overcome part of this problem would be to generalize the idea of 'type synonyms' to allow 'context synonyms'. For example, we have type synonyms like: type Point = (Int,Int) we could have 'context

Re: Decimal Literals

2003-07-12 Thread Ashley Yakeley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ketil Z. Malde) wrote: I.e. for 3.14, allow any rational number in [3.14,3.15), or perhaps (3.135,3.145]? Specifically the simplest rational in the range (I prefer the second one, round half even). One rational is simpler than another if both

Re: Template Haskell question

2003-07-12 Thread Ashley Yakeley
In article [EMAIL PROTECTED] .com, Simon Peyton-Jones [EMAIL PROTECTED] wrote: Yes, sorry, as Ian says, type splices just aren't implemented at the moment. The error message is uninformative. This is useful info though -- someone wants type splices! Ah, but what I really want is to be

Multiple pointers to objects

2003-07-12 Thread Ron de Bruijn
Hi there, I was almost certain that Haskell was a great language until I wanted to make a real usefull program and got the following problem. I have data Lesson = Lesson Teacher SomeOtherProperties deriving Show data Subject = Subject Name [Teacher] SomeOtherProperties deriving Show

Re: Representing cyclic data structures efficiently in Haskell

2003-07-12 Thread andrew cooke
Sarah Thompson [EMAIL PROTECTED] writes: [...] work that well for circuits because, for anything other than trivially simple components, the connections between nodes need to be labelled. it's been a while since i used it, but i thought erwig's graph library had labels on edges. it's a really

Re: Multiple pointers to objects

2003-07-12 Thread Nick Name
On Sat, 12 Jul 2003 07:47:02 -0700 (PDT) Ron de Bruijn [EMAIL PROTECTED] wrote: It's ofcourse possible to put a list of Subjects that a Teacher teaches in the data declaration of the teacher. But then there is no way of saying efficiently (O(1) Just a pointer or index):Give me a list

Handling large ini files.

2003-07-12 Thread Thaddeus L. Olczyk
A while ago I looked at Haskell. I got stuck on a problem which basically caused me to stop using Haskell. Realising that I never asked anyone else how they would approach the deal, I decided to ask before I put the final chapter on Haskell. I have a program that requires a lot of customisation.

Re: Handling large ini files.

2003-07-12 Thread Andrew Rock
On Sunday, July 13, 2003, at 06:54 AM, Thaddeus L. Olczyk wrote: A while ago I looked at Haskell. I got stuck on a problem which basically caused me to stop using Haskell. Realising that I never asked anyone else how they would approach the deal, I decided to ask before I put the final chapter on

Re: Handling large ini files.

2003-07-12 Thread Andrew J Bromage
G'day all. On Sun, Jul 13, 2003 at 10:09:21AM +1000, Andrew Rock wrote: I think that each being a customisation *is* sufficient for coherence of one data structure to hold them all. I agree, though using different data structures for each set of configuration parameters which will be used