Re: [Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-21 Thread Shao Chih Kuo
This might be easier: Prelude> putStrLn $ return $ head "this and that" t Prelude> Gene A wrote: The thread on the use of "show" and print to display an Int value, brought up a problem I had early on... the one of cleanly displaying a Char value, on a line all by itself.. My first attempts: Th

Re: [Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-19 Thread Henk-Jan van Tuyl
On Sat, 19 Aug 2006 19:21:36 +0200, Gene A <[EMAIL PROTECTED]> wrote: [...] Prelude> putStrLn $ (head "this and that"):[] Or you could use: putStrLn [head "This and that"] -- Met vriendelijke groet, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ -- Using Opera's revolutionary e-mail client: ht

Re: [Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-19 Thread Niklas Broberg
> c2Str c = c:[] This function is often known as box, its much more general than char to string, it puts any single element in a list like box ... or 'return', which is in the Prelude already, but which is even more general, it puts any single element into any (dare I say it) monad, where a lis

Re: [Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-19 Thread Neil Mitchell
Hi c2Str c = c:[] This function is often known as box, its much more general than char to string, it puts any single element in a list like box Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listin

[Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-19 Thread Gene A
The thread on the use of "show" and print to display an Int value, brought up a problem I had early on... the one of cleanly displaying a Char value, on a line all by itself.. My first attempts: This was just plain hard to read: with the character t being where it was: Prelude> putChar $ head "t