Load the above file. Then:
> MyType -- This does what I want it to do after all.
a
b
> show MyType
"a\nb"
> putStrLn (show MyType)
a
b
> print MyType
a
b
-- Russ Abbott
_____________________________________________
On Tue, Nov 9, 2010 at 9:40 AM, Russ Abbott
<russ.abbott@gmail.com> wrote:
Is there some way to include control characters in a Show string so that they take effect when the element is Shown?
For example, if I define a String "a\nb" and use putStrLn on it, the \n causes a return, but when I simply return the string from a function, the \n is shown as \n. Is there a way to get the \n to execute when it's embedded in a returned value?
Thanks
-- Russ Abbott
_____________________________________________