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:  Showing a value,     when there are many approaches?
      (Chris Schneider)


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

Message: 1
Date: Wed, 7 Aug 2013 13:47:55 -0600
From: Chris Schneider <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Showing a value,       when there are many
        approaches?
Message-ID:
        <caghc4ug4exhc1m07edd+nxzhhrfet2equoqhmy_utf3qa3i...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Ok, that makes sense, I misinterpreted `show` since for integers & friends
it is just the same as a `toString` in other languages.

Is there a standard name for "render a human readable form of this data"?
 toString() in java, to_s in ruby, and similar?




On Wed, Aug 7, 2013 at 12:51 PM, Brandon Allbery <[email protected]>wrote:

> On Wed, Aug 7, 2013 at 1:04 PM, Chris Schneider <
> [email protected]> wrote:
>
>> I can't just use a `show` function directly to do this, since there are
>> options I need to pass.
>>
>
> And you shouldn't use `show` for this, because if it prints your
> MacAddress as anything other than an unambiguous representation of the
> Haskell MacAddress type then it has lost information useful for debugging.
> More to the point: if I cannot see the difference between your MacAddress
> and a String, then it's an unacceptable `show`. `show` should reflect the
> Haskell data structure so I can verify that my program is doing the right
> thing; if it shows what looks like a String, but I'm expecting to see a
> MacAddress, then I will suspect a type error somewhere.
>
> `show` is like Perl's Data::Dumper or Python's repr. I don't want pretty,
> I want accuracy.
>
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> [email protected]
> [email protected]
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>
> _______________________________________________
> 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/20130807/e11fb3e0/attachment-0001.html>

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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 62, Issue 6
****************************************

Reply via email to