[Haskell-fr] a function which return the type of element
westondan at imageworks.com
Thu Nov 15 22:38:41 EST 2007
There are several possibilities. The one that maps most closely to the
expression you wrote is:
> import Data.Typeable(typeOf)
> if typeOf a == typeOf (undefined :: Int) then f else g
Of course, f and g must have the same type.
for more details.
BOUNEB ZINE EL ABIDINE wrote:
> Dear All ;
> I look for the function which return the type of un element in Haskell :
> For example
> If type(a) = Int then f else g
More information about the Haskell-fr