Re: [Haskell-cafe] ShowList magic

2010-05-17 Thread Lennart Augustsson
Your question is actually deeper than some of the people answering you seem to realize. How does ghci decide what to do when you say show [] ? The expression [] has type [a], which means it could be a list of any type 'a', including Char. Normally, when Haskell can't determine the type in this ki

Re: [Haskell-cafe] ShowList magic

2010-05-16 Thread Ivan Miljenovic
On 17 May 2010 12:56, Abby Henríquez Tejera wrote: > I'm a Haskell newbie and there's a bit of Haskell code that I don't > understand how it works. In the prelude, defining the class Show, the > function showList is implemented twice, one for String and another one > for other lists: > >    showLi

[Haskell-cafe] ShowList magic

2010-05-16 Thread Abby Henríquez Tejera
Hi. I'm a Haskell newbie and there's a bit of Haskell code that I don't understand how it works. In the prelude, defining the class Show, the function showList is implemented twice, one for String and another one for other lists: showList cs = showChar '"' . showl cs where sh