Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  How to understand the type "ShowS"? (Kim-Ee Yeoh)
   2. Re:  How to understand the type "ShowS"? (yi lu)


----------------------------------------------------------------------

Message: 1
Date: Tue, 24 Sep 2013 18:50:48 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] How to understand the type "ShowS"?
Message-ID:
        <CAPY+ZdS=5dft3eds0yrofcq4_sdfubjs0p43n4rixhotwde...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Tue, Sep 24, 2013 at 6:43 PM, yi lu <[email protected]>wrote:

> I have just looked at the API of Prelude, and I remember similar
> definition for parallel haskell.


How far have you gotten with LYAH? Or Hutton's textbook?

What does a search on "haskell intro type system" reveal?

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130924/dd51afb3/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 24 Sep 2013 19:54:08 +0800
From: yi lu <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] How to understand the type "ShowS"?
Message-ID:
        <cakcmqqyqr-fwwckz3qc79lf8jo3cwk6tgicu+kj6vkahyjz...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Sep 24, 2013 at 7:47 PM, Shrivats <[email protected]> wrote:

> What does `show "asdf"` give you in ghci? What Lyndon showed you was that
> this function is equivalent to `shows x s = show x ++ s`.
>
> Ah, it works a bit like "++" ?

> Have fun,
>
> Shrivats
> On Sep 24, 2013 5:09 PM, "yi lu" <[email protected]> wrote:
>
>>
>> On Tue, Sep 24, 2013 at 6:54 PM, Lyndon Maydwell <[email protected]>wrote:
>>
>>> Looks like it's a convenience for building up a compositions of "Show"s.
>>>
>>> ShowS is indeed a synonym for a function. The type of shows alone isn't
>>> enough to figure out how it behaves exactly, but testing it out in GHCi is
>>> telling:
>>>
>>>
>>> > [Prelude] ? :i ShowS
>>> > type ShowS = String -> String -- Defined in `GHC.Show'
>>> > [Prelude] ? :i shows
>>> > shows :: Show a => a -> ShowS -- Defined in `GHC.Show'
>>> > [Prelude] ? shows "asdf" "qwer"
>>> > "\"asdf\"qwer"
>>>
>>> I don't know the meaning of this result.
>>
>>
>>
>>>
>>> On Tue, Sep 24, 2013 at 8:15 PM, yi lu <[email protected]>wrote:
>>>
>>>> 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
>>>>
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> [email protected]
>>>> http://www.haskell.org/mailman/listinfo/beginners
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://www.haskell.org/mailman/listinfo/beginners
>>>
>>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130924/0ae01f1c/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 63, Issue 36
*****************************************

Reply via email to