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"? (Lyndon Maydwell)
   2. Re:  How to understand the type "ShowS"? (Kim-Ee Yeoh)
   3. Re:  How to understand the type "ShowS"? (yi lu)
   4. Re:  How to understand the type "ShowS"? (yi lu)
   5. Re:  How to understand the type "ShowS"? (Shrivats)


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

Message: 1
Date: Tue, 24 Sep 2013 20:54:49 +1000
From: Lyndon Maydwell <[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:
        <cam5qztxk96u-z+vd0h9zsb1l+p+yodt+ww3xeaoskaucv_c...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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"


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130924/25df9a6f/attachment-0001.html>

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

Message: 2
Date: Tue, 24 Sep 2013 18:17:25 +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+ZdQ=QKh7odLBt+kHbrsWTqL=bgsy8nOmy=xnzckqwey...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Tue, Sep 24, 2013 at 5: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.


When you say "cannot" you probably mean "do not". Among the reasons are
this lack of ability is highly transient. And this transience is highly
dependent on the steps you take to change this.

There are heaps of freely available intro material on this. What have you
looked at?

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

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

Message: 3
Date: Tue, 24 Sep 2013 19:39:43 +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:
        <CAKcmqqwajwYD8hadwtqAwXC--3TF0x0fa95+66iMRo=szko...@mail.gmail.com>
Content-Type: text/plain; charset="iso8859-7"

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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130924/9072ba7d/attachment-0001.html>

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

Message: 4
Date: Tue, 24 Sep 2013 19:43:53 +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:
        <CAKcmqqwnxARX7H=8OEQr=kwmgtzhww43o7sjm1ts74c972+...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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



On Tue, Sep 24, 2013 at 7:17 PM, Kim-Ee Yeoh <[email protected]> wrote:

>
> On Tue, Sep 24, 2013 at 5: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.
>
>
> When you say "cannot" you probably mean "do not". Among the reasons are
> this lack of ability is highly transient. And this transience is highly
> dependent on the steps you take to change this.
>
> There are heaps of freely available intro material on this. What have you
> looked at?
>
> -- Kim-Ee
>
> _______________________________________________
> 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/cf81c372/attachment-0001.html>

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

Message: 5
Date: Tue, 24 Sep 2013 17:17:26 +0530
From: Shrivats <[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:
        <CAKyHutN3sNb7OxZbE+3q4+CuqYjiDJ_PmkeXx-iE=suz7lu...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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`.

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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130924/31b4e03a/attachment.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