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

Roman Cheplyaka roma at ro-che.info
Fri Jul 29 20:04:08 CEST 2011


* Grigory Sarnitskiy <sargrigory at 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/



More information about the Haskell-Cafe mailing list