Re: a universal printer for Haskell?
At 2002-02-19 09:56, Richard Uhtenwoldt wrote:
This is reflection! I'd rather not have Haskell contaminated with such things;
Can you say a little more about why you think reflection is bad? Does it make the language implementation run slower?
It's ugly, and isn't part of the spirit of the language. You shouldn't be able to peer into types that way. If you decide to change the private structure of your types, you shouldn't have to worry about what effects it will have on the rest of the program. Consider: module A (Thing()) where { data Thing = MkThing Char; } module B where { import A; peek :: Thing -> Char; peek thing = (\(MApp _ (MChar c)) -> c) (reify thing); } B can look inside a private structure of A. The problem is not the Reify class, but the compiler's autogeneration of instances.
(I'd ask via private email, but when I emailed you in the past I didn't get a reply.)
That sounds like me... -- Ashley Yakeley, Seattle WA
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 20 February 2002 03:35, Ashley Yakeley wrote:
At 2002-02-19 09:56, Richard Uhtenwoldt wrote:
This is reflection! I'd rather not have Haskell contaminated with such things;
Can you say a little more about why you think reflection is bad? Does it make the language implementation run slower?
It's ugly, and isn't part of the spirit of the language.
The above statement cannot be a basis for any argument against Bernard's proposal. Where Bernard makes a careful analysis of the matter, you introduce your prejudice. Since you are defining the spirit of the language, perhaps you could make a list of the "parts" of that spirit so that people will not come up with any proposal that violates your understanding of aesthetics. A general concept such as reflection cannot be deemed as worthless in itself. Any system that has a tiny bit of introspective powers can be said to be reflective to some extent, for instance a Haskell interpreter. Thanks, - -- Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr> Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8cysgfAeuFodNU5wRAuc2AJ9UW0VRcxSqs0dS/rIN7/YBaXBO2wCfRtbB +5ZG8wk9nZH3Z7WEz7rNvqw= =NevV -----END PGP SIGNATURE-----
participants (2)
-
Ashley Yakeley -
Eray Ozkural