Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-06 Thread Jason Dagit
On Mon, Oct 5, 2009 at 11:02 AM, Sönke Hahn sh...@cs.tu-berlin.de wrote: On 5 Oct 2009, at 21:06, Lennart Augustsson wrote: OK, just pairs have no arithmetic, but one way of defining arithmetic is to treat the pairs as complex numbers. Or as mantissa and exponent. Or as something

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-06 Thread Henning Thielemann
On Mon, 5 Oct 2009, Jason Dagit wrote: 2. How can i use numeric literals to construct values, whose types are not in the Num class? Numeric literals are treated as Integer or Rational, and are then converted with the function fromInteger or fromRational, respectively, to the required type.

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-06 Thread Iavor Diatchki
Hi, On Tue, Oct 6, 2009 at 2:37 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: Numeric literals are treated as Integer or Rational, and are then converted with the function fromInteger or fromRational, respectively, to the required type. Whatever fromInteger function is in scope,

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Anton van Straaten
jerzy.karczmarc...@info.unicaen.fr wrote: American people will call it a discussion about semantics, and we, European will not understand why this word is used in a pejorative context... Semantics *should* be a pejorative word unless it refers to something formally specified, and preferably

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Miguel Mitrofanov
Just pairs have no natural arithmetic upon them. Exactly my point. BTW. the missing term of M.M. is DUAL NUMBERS. Remembered this already. Thanks anyway. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Lennart Augustsson
OK, just pairs have no arithmetic, but one way of defining arithmetic is to treat the pairs as complex numbers. Or as mantissa and exponent. Or as something else. So there's nothing wrong, IMO, to make pairs an instance of Num if you so desire. (Though I'd probably introduce a new type.) On

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Miguel Mitrofanov
And I agree that sometimes it can be suitable. But simply defining an instance of Num without a single word on the problem one is trying to solve is not just pointless. It's something that should not be done. On 5 Oct 2009, at 21:06, Lennart Augustsson wrote: OK, just pairs have no

Re: [Haskell-cafe] What is a number. (Was: Num instances for 2-dimensional types)

2009-10-05 Thread Sönke Hahn
On 5 Oct 2009, at 21:06, Lennart Augustsson wrote: OK, just pairs have no arithmetic, but one way of defining arithmetic is to treat the pairs as complex numbers. Or as mantissa and exponent. Or as something else. So there's nothing wrong, IMO, to make pairs an instance of Num if you