Hello,
it is possible to write
module Main(main) where
import Dynamic
main = putStrLn ( show ( typeOf (f (1::Integer))))
f x = x
The output is of course
Integer
But the typeOf will only work for 'concrete' data types.
It will not work for functions. So I can't write
main = putStrLn ( show ( typeOf (f)))
Thus it is possible to write a function that recognize functions, i.e.
functionType arg = case arg of
(arg:: a->b) -> "function"
So the question is: Is is possible to write a function the gives
back a String with the signature of the argument of that function?
For example:
'function f' gives the String "a->a"
Best regards,
Thomas
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users