
14 Oct
2005
14 Oct
'05
9:05 a.m.
On 10/13/05, Huong Nguyen
Hi all,
I want to write a small functionto test whether an input is a String or not. For example,
isString::(Show a) =>a ->Bool This function will return True if the input is a string and return False if not
Any of you have idea about that? Thanks in advance
I simply can not think of a reason for why you would want to do that. The system already knows whether a values if of type String at *compile-time* so there shouldn't really be any reason to test it at run-time. I think you'll get more insight if you just tell us why you think you need it and then we could probably show you the "idiomatic haskell way" to achieve what you need. /S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862