Re: Records and type classes

1994-05-16 Thread jones-mark
Simon suggests that: | type classes can model extensible records. Indeed, they can, and in several different ways, depending on the kind of extensible records that you want to give the programmer. The particular system that Simon outlined is pretty close to a proposal for `structures in

Re: Multiple Parameter Classes

1994-03-15 Thread jones-mark
I missed out on the discussion about multiple parameter type classes last time round, so I'm pleased to have another chance to say my piece. I added multiple parameter classes to Gofer at a time when there was quite a lot of discussion on this list about such classes. I'd been involved in

Re: Local definitions in list comprehensions

1993-11-28 Thread jones-mark
| I'm fairly sure that local definitions were possible in Miranda(TM), and | I see they are permitted in Gofer. Mark Jones explains why they are not | part of Haskell, on page 44 of the Gofer manual: | | Local definitions: A qualifier of the form pat = expr [...] | | [

Defining datatype selector functions

1993-11-19 Thread jones-mark
Here's an idea, going back a few years, for a small extension to Haskell that would make it a little easier to define datatype selector functions. I'm curious to see what other people think about it, but I'm not sure that I want to put this forward as a proper proposal for 1.3 or 2.0 or ...

Re: Laws

1993-11-04 Thread jones-mark
The bottom line: Equational reasoning in a typed language needs to take account of types. For those who would like me to go into a little more detail: Warren has described a puzzling situation in which the two similarly defined functions: f1 x y = const (show x == show y)

re. 1.3 cleanup: patterns in list comprehensions

1993-10-14 Thread jones-mark
In response to some comments from Nikhil: | Thomas says: | AN ASIDE: Actually, in this example, what I *really* wanted was a | definitional list comprension (Kevin, was that what you called it? | You wrote a note about this ages ago): | So that a qualifier can also be a

Re: Why does one work and not the other?

1993-09-20 Thread jones-mark
Van Snyder (= [EMAIL PROTECTED]) asks why the following definition doesn't work: | q :: (Integral d) = Array d (Array d d) | q = array (1,2) [1 := array (1,3) [j := j | j - [1..3]]] ++ | [2 := q!1] The reason is that it is missing some parentheses. Using the rule that

Re: Polymorphic recursive calls possible via type classes

1993-07-27 Thread jones-mark
Konstantin Laufer [EMAIL PROTECTED] writes: | Consider the following recursive function binding: | | f [] = 0::Int | f (x:xs) = 1 + f([]::[Int]) + f([]::[Bool]) + f xs | | This binding is ill-typed since f is used in two different instances | of its polymorphic-to-be type.