[Haskell-cafe] Newbie question on Haskell type

Sebastian Sylvan sebastian.sylvan at gmail.com
Fri Oct 14 05:05:50 EDT 2005

On 10/13/05, Huong Nguyen <hiperfume at gmail.com> wrote:
> 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

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.

Sebastian Sylvan
UIN: 44640862

More information about the Haskell-Cafe mailing list