[Haskell-beginners] How to understand the type "ShowS"?

yi lu zhiwudazhanjiangshi at gmail.com
Tue Sep 24 12:15:38 CEST 2013


Prelude> :i ShowS
type ShowS = String -> String     -- Defined in `GHC.Show'

It is a type of a function? I cannot understand this type, and don't know
how to create functions of this type.

And this function "shows"

Prelude> :i shows
shows :: Show a => a -> ShowS     -- Defined in `GHC.Show'

I don't know how this function works.

Yi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130924/8266243a/attachment.htm>


More information about the Beginners mailing list