Function returning the type of its argument.

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?

* 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?
Sounds like you want typeOf. http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Typeab... But be sure you *really* need this (or ask us if in doubt). -- Roman I. Cheplyaka :: http://ro-che.info/

On Fri, Jul 29, 2011 at 12:54 PM, 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?
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
participants (3)
-
Antoine Latter
-
Grigory Sarnitskiy
-
Roman Cheplyaka