[Haskell-cafe] Show function a -> String

Roel van Dijk vandijk.roel at gmail.com
Fri Nov 27 07:48:00 EST 2009

>ShowFloat -> Floating -> String
I do not really understand this type.

Did you mean something like this:

showFloat :: (Show a, Floating a) => a -> String
showFloat = show

In that case it depends on what type you fill in for 'a' and more
specifically that type's Show instance. One value for which most (or
all) show functions will give an error is ⊥ (undefined). If the type
you pick is some kind of IEEE 754 type then you might have some
trouble with denormalized values. But that is just a guess, you would
have to test for that.

If that is not what you mean than I would appreciate some clarification.


More information about the Haskell-Cafe mailing list