
15 Nov
2007
15 Nov
'07
10:38 p.m.
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. See http://haskell.org/ghc/docs/latest/html/libraries/base-3.0.0.0/Data-Typeable... for more details. Dan 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
Regards