Re: [Haskell-cafe] Instantiation problem

2011-01-31 Thread Tom Nielsen
Patrick, I find Andrew Frank's work on axiomatic specifications of GIS systems -- which the paper you cite is built on -- very confusing, or indeed, confused. They have a bunch of example like data Car = Car Color class Car a where carColor :: a - Color instance Car Car where carColor

Re: [Haskell-cafe] Instantiation problem

2011-01-30 Thread Patrick Browne
On 29/01/2011 20:56, Henning Thielemann wrote: Is there a reason why you use an individual type for every unit? The existing implementations of typed physical units only encode the physical dimension in types and leave the unit factors to the value level. I found this to be the most natural

Re: [Haskell-cafe] Instantiation problem

2011-01-30 Thread Henning Thielemann
Patrick Browne schrieb: On 29/01/2011 20:56, Henning Thielemann wrote: Is there a reason why you use an individual type for every unit? The existing implementations of typed physical units only encode the physical dimension in types and leave the unit factors to the value level. I found this

Re: [Haskell-cafe] Instantiation problem

2011-01-30 Thread Patrick Browne
On 30/01/2011 19:43, Henning Thielemann wrote: I do not see a constant 1 that is equated with a type. This is due to my misunderstanding of Haskell. After your comments my understanding of the unit function is as follows: 1) In the instance below the argument for unit must have type

Re: [Haskell-cafe] Instantiation problem

2011-01-30 Thread Henning Thielemann
Patrick Browne schrieb: On 30/01/2011 19:43, Henning Thielemann wrote: I do not see a constant 1 that is equated with a type. This is due to my misunderstanding of Haskell. After your comments my understanding of the unit function is as follows: 1) In the instance below the argument for

Re: [Haskell-cafe] Instantiation problem

2011-01-29 Thread Steffen Schuldenzucker
Hi, Your definition of 'unit' in the instance MetricDescription LengthInCentimetres Centimetre is not well-typed. Maybe you want to write either unit (LengthInCentimitres 2.0) = Centimetre -- (pattern match fail for all (LengthInCentimetres l), l /= 2.0) or unit l = Centimetre -- i.e. unit

Re: [Haskell-cafe] Instantiation problem

2011-01-29 Thread Henning Thielemann
Patrick Browne schrieb: Below is some code that is produces information about the *types* used for measuring (e.g. metres). The following evaluation returns 1.00 which the convert factor for metres. convertFactorToBaseUnit (unit (LengthInMetres 7)) . The next evaluation returns the type,