
5 Feb
2014
5 Feb
'14
3:13 a.m.
Isn't toString just show?
On Feb 4, 2014 3:20 PM, "Johannes Waldmann"
Ben Foppa
writes: But do we have an inverse generic function toString defined anywhere?
well, we have: class Show a where show :: a -> String
likereString :: (IsString a, IsString b) => a -> b
well you probably don't want to actually convert from a to String (= List of Char) then from there to b, so it would need to be accompanied by some RULES (for specific instances of a, b) for efficiency.
This still does not answer the concern whether it is (semantically) wise to have String as the "base" concept here.
- J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe