Re: [Haskell-cafe] Reification in Haskell, was: To yi or not to yi

2007-06-21 Thread Pasqualino 'Titto' Assini
Hi Bulat,

do you mean that as the type information is used only at compilation time and 
then thrown away there is no way of getting it back at execution time?

best,

titto

On Wednesday 20 June 2007 16:33:12 Bulat Ziganshin wrote:
 Hello Pasqualino,

 Wednesday, June 20, 2007, 11:30:32 AM, you wrote:
   Most languages, even Java, have a reflection capability to dynamically
   inspect an object. It is surprising that Haskell doesn't offer it.

 how about asm? :)  there are no OOP objects in Haskell, each name is
 just an address of memory area. all operations are checked statically
 (at compile time). reflection capabilities may be only handmade - you
 can get any type info via hidden class dictionary (see
 http://homepages.inf.ed.ac.uk/wadler/papers/class/class.ps.gz for
 details of type classes implementation)


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


Re[2]: [Haskell-cafe] Reification in Haskell, was: To yi or not to yi

2007-06-21 Thread Bulat Ziganshin
Hello Pasqualino,

Thursday, June 21, 2007, 11:22:19 AM, you wrote:

more or less. there are Data and Typeable classes that provides this
information but to use them you

1) should use GHC
2) should add deriving Typeable clause to declaration of each type
you need to inspect
3) have Typeable a condition in definition of each function where
you need this information:

print_type :: (Typeable a) =  a - IO ()

so, its just something like class definition:

class Typeable a where
  typename :: a - String

with GHC automatically deriving instances of this class. no real RTTI
because Haskell data items are not objects. i suggest you to read
paper before asking more questions :)


 do you mean that as the type information is used only at compilation time and
 then thrown away there is no way of getting it back at execution time?

 best,

 titto

 On Wednesday 20 June 2007 16:33:12 Bulat Ziganshin wrote:
 Hello Pasqualino,

 Wednesday, June 20, 2007, 11:30:32 AM, you wrote:
   Most languages, even Java, have a reflection capability to dynamically
   inspect an object. It is surprising that Haskell doesn't offer it.

 how about asm? :)  there are no OOP objects in Haskell, each name is
 just an address of memory area. all operations are checked statically
 (at compile time). reflection capabilities may be only handmade - you
 can get any type info via hidden class dictionary (see
 http://homepages.inf.ed.ac.uk/wadler/papers/class/class.ps.gz for
 details of type classes implementation)




-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


[Haskell-cafe] Reification in Haskell, was: To yi or not to yi

2007-06-20 Thread Pasqualino 'Titto' Assini
Hi everybody,

What is the situation with respect to reification of function/thunks in 
Haskell?

Does any current implementation support it ? 

And, is there any plan for GHC to support it?

Claus's comments on this, follow.

 titto


On Monday 18 June 2007 23:45:23 Claus Reinke wrote:
  Is there any fundamental reasons why Haskell functions/closures
  cannot be serialised?

 no, and that is part of the problem: the language would need to be
 extended, but the academically interesting issues have been tackled,
 all that is left is a lot of work (that is why these things would be so
 valuable: complex implementation machinery, controlled by very
 small language extensions, sometimes even language simplifications,
 such as lifting existing restrictions on i/o), preferably with very good
 planning, so that all the work does not become useless right after it
 is finished. there isn't much hope that this issue is going to be settled
 via the usual academic funding sources.


  Most languages, even Java, have a reflection capability to dynamically
  inspect an object. It is surprising that Haskell doesn't offer it.

 it has to be done with care, or it will invalidate *all* your nice
 reasoning about haskell programs. random example

 reify (f . g) == [| f . g |] =/= [| \x- f (g x) |] == reify (\x- f (g
 x))

 reification is not a referentially transparent program context.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Reification in Haskell, was: To yi or not to yi

2007-06-20 Thread Bulat Ziganshin
Hello Pasqualino,

Wednesday, June 20, 2007, 11:30:32 AM, you wrote:

  Most languages, even Java, have a reflection capability to dynamically
  inspect an object. It is surprising that Haskell doesn't offer it.

how about asm? :)  there are no OOP objects in Haskell, each name is
just an address of memory area. all operations are checked statically
(at compile time). reflection capabilities may be only handmade - you
can get any type info via hidden class dictionary (see
http://homepages.inf.ed.ac.uk/wadler/papers/class/class.ps.gz for
details of type classes implementation)


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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