Re: [Haskell-cafe] Redefining superclass default methods in a subclass

2007-01-14 Thread Meng Wang

Hi Brian,

Thank you for starting the thread. We (Martin Sulzmann and me) proposed a 
type class extension which allows modular extension of superclasses (a 
complement of subclass extension). The idea has been shown to be 
particularly useful in (but not limited to) encodings of generic 
programming with type classes. A brief introduction of the proposal is 
documented in our wiki: 
http://taichi.ddns.comp.nus.edu.sg/taichiwiki/GPHomePage. I will try to 
add it as a link in yours soon.



A more detailed and formal description of the proposal can be found in our 
Workshop on Generic Programming 06 paper which is available at

http://www.comp.nus.edu.sg/~sulzmann
http://web.comlab.ox.ac.uk/oucl/work/meng.wang/

Regards,
Meng

-W-M-
 @ @
  |
 \_/


On Tue, 9 Jan 2007, Brian Hulley wrote:


Simon Peyton-Jones wrote:

One of the great things about John's class-alias proposal is that
John worked out a lot of details and captured them in a web page,
rather than it getting buried in an email thread.

If you have ideas to refine his proposal, it'd be good to see if,
with him, you can come up with a unified design, and again capture it
in a Wiki page or something.


I've started a page at 
http://www.haskell.org/haskellwiki/Class_system_extension_proposal
John - I haven't added anything about your class alias proposal because 
you've copyrighted your proposal and I don't want to do the wrong thing ;-) 
Can you add a section for your proposal (or containing a link to your 
proposal) on his page?


Please could everyone who has any other ideas about class system extensions 
add them to the page above so that we have a central location. Hopefully it 
will gradually become clear what all the issues are and perhaps a path for 
trying to implement some extensions in order of difficulty.


Thanks, Brian.
--
http://www.metamilk.com 
___

Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Higher kinds (and impredicativity?)

2007-01-14 Thread Jim Apple

Why is this declaration ill-formed:

data Bad t where
   Bad :: Bad (forall (f :: * - *) . f)

GHC 6.6 says:

`f' is not applied to enough type arguments
Expected kind `*', but `f' has kind `* - *'
In the type `forall f :: (* - *). f'
In the type `Bad (forall f :: (* - *). f)'
In the data type declaration for `Bad'

I suppose this is because the kind inference rule is

C, x : k1 |- y : *
---
C |- (\forall x : k1 . y) : *

I'd expect

C, x : k1 |- y : k2
---
C |- (\forall x : k1 . y) : k2

Is there a foundational or an implementation reason for this restriction?

Jim
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe