
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
On Wed, Aug 7, 2013 at 1:04 PM, Chris Schneider < chris@christopher-schneider.com> 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 allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners