[Haskell-cafe] Function returning the type of its argument.

2011-07-29 Thread Grigory Sarnitskiy
It is not possible in Haskell, moreover it seems to be too alien to Haskell. 
Nevertheless, is there an extension which would allow to write a function that 
returns the type of its argument?

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


Re: [Haskell-cafe] Function returning the type of its argument.

2011-07-29 Thread Roman Cheplyaka
* Grigory Sarnitskiy sargrig...@ya.ru [2011-07-29 21:54:05+0400]
 It is not possible in Haskell, moreover it seems to be too alien to Haskell. 
 Nevertheless, is there an extension which would allow to write a function 
 that returns the type of its argument?

Sounds like you want typeOf.

http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Typeable.html#v:typeOf

But be sure you *really* need this (or ask us if in doubt).

-- 
Roman I. Cheplyaka :: http://ro-che.info/

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


Re: [Haskell-cafe] Function returning the type of its argument.

2011-07-29 Thread Antoine Latter
On Fri, Jul 29, 2011 at 12:54 PM, Grigory Sarnitskiy sargrig...@ya.ru wrote:
 It is not possible in Haskell, moreover it seems to be too alien to Haskell. 
 Nevertheless, is there an extension which would allow to write a function 
 that returns the type of its argument?


What sort of problem are you trying to solve?

For the most part, Haskell types are known statically at compile time.

 ___
 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