Re: [Haskell-cafe] decoupling type classes

2012-01-17 Thread Dominique Devriese
2012/1/16 Yin Wang yinwa...@gmail.com: The typical example would be instance Eq a = Eq [a] where  [] == [] = True  (a : as) == (b : bs) = a == b as == bs  _ == _ = False It can handle this case, although it doesn't handle it as a parametric instance. I suspect that we don't need the

Re: [Haskell-cafe] decoupling type classes

2012-01-16 Thread Dominique Devriese
Yin, 2012/1/14 Yin Wang yinwa...@gmail.com: On Sat, Jan 14, 2012 at 2:38 PM, Dominique Devriese dominique.devri...@cs.kuleuven.be wrote: I may or may not have thought about it. Maybe you can give an example of parametric instances where there could be problems, so that I can figure out

Re: [Haskell-cafe] decoupling type classes

2012-01-16 Thread Yin Wang
The typical example would be instance Eq a = Eq [a] where  [] == [] = True  (a : as) == (b : bs) = a == b as == bs  _ == _ = False It can handle this case, although it doesn't handle it as a parametric instance. I suspect that we don't need the concept of parameter instances at all. We

Re: [Haskell-cafe] decoupling type classes

2012-01-14 Thread Yin Wang
Also, you don't seem to have thought about the question of parametric instances: do you allow them or not, if you do, what computational power do they get etc.? I may or may not have thought about it. Maybe you can give an example of parametric instances where there could be problems, so that

Re: [Haskell-cafe] decoupling type classes

2012-01-14 Thread Yin Wang
On Sat, Jan 14, 2012 at 2:38 PM, Dominique Devriese dominique.devri...@cs.kuleuven.be wrote: I may or may not have thought about it. Maybe you can give an example of parametric instances where there could be problems, so that I can figure out whether my system works on the example or not. The

Re: [Haskell-cafe] decoupling type classes

2012-01-12 Thread Dominique Devriese
Yin, 2012/1/12 Yin Wang yinwa...@gmail.com: I have an idea about type classes that I have been experimenting. It appears to be a generalization to Haskell’s type classes and seems to be doable. It seems to related the three ideas: type classes, implicit parameters, and (typed) dynamic

[Haskell-cafe] decoupling type classes

2012-01-11 Thread Yin Wang
Hi all, I have an idea about type classes that I have been experimenting. It appears to be a generalization to Haskell’s type classes and seems to be doable. It seems to related the three ideas: type classes, implicit parameters, and (typed) dynamic scoping. But I don't know whether it is good or

Re: [Haskell-cafe] Decoupling type classes (e.g. Applicative)?

2010-11-02 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/29/10 09:35 , Dominique Devriese wrote: * Only introduce a dependency from type class A to type class B if all functions in type class B can be implemented in terms of the functions in type class A or if type class A is empty. Er? Eq a

[Haskell-cafe] Decoupling type classes (e.g. Applicative)?

2010-10-29 Thread Dominique Devriese
Hi all, I have a problem with the design of the Applicative type class, and I'm interested to know people's opinion about this. Currently, the Functor and Applicative type class are defined like this: class Functor f where fmap:: (a - b) - f a - f b class Functor f =

Re: [Haskell-cafe] Decoupling type classes (e.g. Applicative)?

2010-10-29 Thread Ozgur Akgun
On 29 October 2010 14:35, Dominique Devriese dominique.devri...@cs.kuleuven.be wrote: I have a problem with the design of the Applicative type class Sorry for going a bit off-topic, but every-time I see someone complaining about such things, I remember this proposal: