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)
participants (2)
-
Ashley Yakeley
-
Eray Ozkural