« first day (654 days earlier)      last day (4293 days later) » 

2:00 PM
It's a friggin Char as distinct type right?
 
I don't even know how to explain this to you.
I don't even know why I have to explain this to you.
 
Outputting a Char by printing digits is counterintuitive.
 
Right, the implementation of the feature that shows you the the data doesn't shows you the visuals.
 
@CatPlusPlus lol
 
@rubenvb Again, you are not outputting a Char.
Output is done with putStr.
 
2:01 PM
@R.MartinhoFernandes not per se on GHCi
I get "output" without it.
 
@rubenvb GHCi shows you the data.
If you want output use output functions.
What's so hard about that?
 
@rubenvb You get something which defies your expectation and you have failed to bring a good argument as to why it should match your expectations and not someone else's.
 
whatever. We have different opinions.
 
look at a std::string in gdb, and it'll look a lot different from what you get if you output the string with std::coutor similar.
 
It's an opinion.
 
2:02 PM
That's not because C++ or GDB are broken
 
Nothing more. You guys are too serious.
 
@jalf Of course it is.
 
@jalf that's really because C++ is broken. It doesn't support Unicode as a language/standard. Bad example.
 
gdb is a debugger. show is for interactive use.
 
What.
 
2:03 PM
@rubenvb No..
 
@ecatmur No, it's not.
 
C++ has perfectly good Unicode support.
 
GHCi does you a favour to aid in playing/debugging.
 
@ecatmur That's the wrong assumption we've been trying to debunk here.
 
show outputs a representation of the data.
Like repr, any representation is good.
 
2:03 PM
What I'm trying to say here is that show is a bad choice for GHCi to use.
 
It can't use anything else.
 
@ecatmur same thing, essentially. Both allow you to inspect the data being passed around by your program. But they're under no obligation to show you how the data would look if it were serialized to a file, or to stdout
 
@CatPlusPlus What kind of statement is that?
 
Or should it just output strings when functions return them?
 
@rubenvb How do you "output" 1?
 
2:04 PM
@R.MartinhoFernandes "one", ofc
 
How do you "output" Just 42?
 
I don't know Maybe.
 
@R.MartinhoFernandes how do I type that in Prelude?
 
@rubenvb Just 42.
 
2:05 PM
Prelude is a library.
 
Just 42.
 
@LucDanton Ooops.
 
@R.MartinhoFernandes I tend to forgot that constructor.
 
It will show you a representation of that value that happens to be valid Haskell.
 
yeah, cause <interactive>:21:1: Not in scope: data constructor Maybe'`
 
2:06 PM
show is the same as GDB's print.
 
@rubenvb I borked that. It's Just.
 
Or maybe more like Python's repr, it's expected to output valid code that you can copy-paste into the source file and run.
 
@CatPlusPlus gdb is a debug tool. It should show raw data. GHCi is not a debug tool.
 
Yes, it is.
 
@rubenvb A REPL is a debug tool.
 
2:07 PM
Soooo... what do you think ghci is used for?
 
A REPL with a built-in debugger is a debug tool.
 
short Haskell try codes
 
Welp.
 
"would this work?"--> nice. Convert to real code.
 
@CatPlusPlus Haskell source files allow non-ASCII Unicode in strings
 
2:07 PM
That doesn't mean it's safe to use them in general case.
People use broken editors and broken fonts.
Windows console will die if you try to output Unicode character it doesn't like.
 
@ecatmur But ASCII works everywhere.
 
@CatPlusPlus My case is not general. My case has a font, encoding, etcc.
@CatPlusPlus wrong. It just prints ?
 
Nobody gives a fuck about your case.
 
Stream's back on, I'm out of here. Sleep is for the weak.
 
If you want to view text, ask it to show text.
 
2:08 PM
@R.MartinhoFernandes Not everywhere.
 
@ecatmur In more places than non-ASCII. Happy?
 
@R.MartinhoFernandes well, it clearly doesn't work in places where people write their names with non-ASCII characters.
 
Yes, it does.
 
15 mins ago, by rubenvb
@StackedCrooked lol. Exactly my sentiment too. I don't give much more than one fuck, but I don't have a lot of fucks to give.
 
@ecatmur But the output GHCi produces works.
 
2:10 PM
I give a fuck.
@R.MartinhoFernandes not in my definition of "Works".
 
@R.MartinhoFernandes only depending on how you define "works".
 
Right, because your screwdriver doesn't work for taking out the nails off that wall.
 
Yeah, I really don't know why programmers needs an explanation for something so basic and obvious, so I'm out of this discussion, too.
 
That's what this boils down too.
 
How would a Russian Teacher demo'ing Haskell present toUpper? Using English? Haha.
 
2:11 PM
Sure, you can type it back in to a Haskell source file; you could also do that by replacing every character with the octal escape.
 
And you're not newbies, so forget about preferential treatment.
 
@rubenvb I assume a Russian teacher teaching Haskell would know how Haskell works.
 
Sure, but it's a silly limitation.
 
gdb print could replace everything with trigraphs.
 
@ecatmur No.
 
2:12 PM
@rubenvb It's not a fucking limitation-
It would be a limitation if it were as you say.
 
It's a trade-off between safety and clarity.
 
I already gave examples of why.
@ecatmur So what? That doesn't seem to make a point.
 
@R.MartinhoFernandes you mean e followed by the ` combining character?
 
@R.MartinhoFernandes That would increase compatibility with broken, archaic platforms.
 
For example.
 
2:13 PM
Solved by Unicode normalization.
 
@rubenvb No, not solved. Broken.
I don't you to change my data behind my back.
 
putStrLn $ map toUpper "Русский" works fine.
 
@R.MartinhoFernandes not if (it weren't Haskell and) Unicode normalization is performed unless explicitely disabled)
 
show outputs more-or-less internal representation.
In a nice way.
And you're just fucking crazy.
 
@CatPlusPlus I never called show. I don't even know about show (tutorial never mentioned it)
 
2:14 PM
Then change tutorial, whatever.
 
@rubenvb So, your tutorial is broken. That makes no point.
 
You know what: never mind.
 
howdy all
 
Did you also notice that '\n' results in "'\n'"?
 
I'm back to geometric algebra.
 
2:15 PM
Would you rather have this?
'
'
 
@R.MartinhoFernandes makes sense, that's a control character.
 
@ecatmur You can't have it both ways.
 
Printable characters should be treated the same whatever code page they're in.
 
it never shows the digits though...... Buuuuuut. Back to math.
 
2:16 PM
I'd rather have a newline, so long as it's escaped properly.
 
@ecatmur '\n' is quite printable.
 
@ecatmur that's my point exactly. buuuuuut. back to math
 
What.
You're even crazier than them.
 
@ecatmur Plus, printable or not is irrelevant, because if you want to print the characters, you need to use the "print the characters" tool, aka putStr.
 
2:17 PM
@R.MartinhoFernandes it's not a printable character though.
 
there's no debating whether or not I'm crazy. I'll come out and say I'm batshit insane.
 
Xeo
Finally back at home
 
stuck developing in Flash for work... T~T
 
Xeo
@ShotgunNinja Can you even call that "developing"?
 
You're basically asking for the semantics of putStr instead of show. The end result is that you get a broken interpreter that can't even show a damn 1.
 
2:18 PM
No, I really can't. But i'm writing what appears to be code, and getting paid for it.
 
Also, why are you all ok with the damn quotes?
 
@R.MartinhoFernandes Actually, in your argument, showing a number 1 should print it in decimal binary.
 
Xeo
@R.MartinhoFernandes What's going on?
 
@R.MartinhoFernandes You sound uncharacteristically grumpy today.
 
@rubenvb No, it prints it as a valid Haskell representation. Any valid Haskell representation is fine.
 
2:19 PM
@rubenvb Why?
 
@LucDanton consistency. The é prints the binary decimal value. The binary decimal value of 1 is 49
 
@KeithLayne You'd be too after 20 minutes of this nonsense.
 
@Xeo I'm trying to convince programmers that wanting the wrong tool to have the semantics of the right tool makes no sense.
@rubenvb It's consistent: it's always a valid Haskell representation.
 
Xeo
And the specific problem is?
 
@R.MartinhoFernandes never said I was.
 
2:20 PM
20 minutes? How many man-hours is that?
 
@R.MartinhoFernandes yup, and outputting any printable character as itself is a valid representation (except backslash and close-quote).
 
@R.MartinhoFernandes é is a valid representation (I can input it)
 
Yes, so what?
 
Why not backslash?
It's not consistent.
 
'\201' is valid as well.
 
2:20 PM
@rubenvb '\233' is not binary. Neither is 3.
 
You're not making a point.
 
Wth is binary decimal.
 
Lol at you making "no exceptions" rule with exceptions.
 
@LucDanton that's the decimal integer value of the binary form of the character.
 
You'd be making a point if '\201' was invalid.
@rubenvb 1 is a number.
 
2:21 PM
Characters are numbers.
 
'1' is a character.
 
@rubenvb It's the decimal value of any form of the character.
 
'é' is as valid as '\201'. 'é' is better because it is more readable.
 
ugh
 
It's not.
It's ambiguous.
 
2:22 PM
So it depends on context.
 
Also, if you want to read text, print text, i.e., use putStr.
 
Now I will close this tab as to be able to focus on Math.
cy guys tomorrow
or something
 
@ecatmur It's not readable if my font doesn't have it and there's a rectangle instead.
 
Or your terminal sucks, like all of them.
 
Using escapes outside of a safe subset works the same everywhere, i.e., it's consistent.
 
2:24 PM
@R.MartinhoFernandes well, use a better font then. Or use an operating system that knows how to do font replacement.
 
@ecatmur There isn't a font with the entire Unicode repertoire.
 
You really don't understand the idea of a safe subset, do you.
 
Don't tell me to use a better Universe.
 
@R.MartinhoFernandes Everyone should use unifont, duh.
 
If it becomes a problem, switch your output encoding to ASCII.
 
2:26 PM
@ecatmur And then what? Get ?s?
 
Are you trolling now?
Because toUpper 'é' in ASCII is '?'.
 
So, you want to break a tool that's meant to mostly aid in debugging, and then force users to invent workarounds to fix it.
Yeah, sounds like a great idea for a generic library.
Good job.
 
@CatPlusPlus Replace "a tool that's meant to mostly aid in debugging" with "debugger", because that's exactly what GHCi is.
 
2:28 PM
@CatPlusPlus yes, I think the benefit would outweigh any cost.
 
@R.MartinhoFernandes Well, I meant Show.
 
@rubenvb How is the interpreter supposed to know which representation to use when you show a character or a string? What if you fed it a string containing \201, then it would be wrong/unexpected to convert it to é. At least if you want it to be symmetrical. Then the interpreter would have to tag the input with "this is how it looked when the user typed it in", which is absurd
 
@ecatmur There is no benefit.
 
or, of course, it should be telepathic, and know which representation the user expected
 
If you work with Unicode text, and want to see how it renders, just use a proper tool for console I/O, i.e. putStr.
 
did someone try to break GHCi's text encoding or something?
 
@CatPlusPlus All text is Unicode text.
 
or is someone writing a unicode library in Haskell??
 
Hint: it's not a common use-case.
 
what's going on here?
 
2:30 PM
@ecatmur Not really, no.
 
@TonyTheLion Someone found out the wrong tool didn't do what they expected.
 
What would be funny is you and @rubenvb trying to use ByteString.
Or Text.
 
@R.MartinhoFernandes of course, it's the wrong tool. :)
 
See, Tony gets it.
 
If you're working with text, and you want to look at the codepoint decomposition, hex dump it. Or paste it into a character map tool.
 
2:31 PM
lol
 
Ya that's also easy.
 
It's far more likely that you're working with text and you want to read what it says.
 
and who is this someone?
 
You're still missing the point by an AU.
 
@ecatmur GHCi is not for reading, it's for debugging.
 
2:31 PM
putStr string
OH LOOK
 
it works!
lol
 
Incredible.
 
wait... is the crux of the problem here that the character someone is seeing for a given value is not what they expected, because they are trying to use a stupid tool?
 
The only stupid thing here is the user.
 
2:32 PM
You complain about a behaviour (show) that is very well documented and has very clear semantics for the sole reason that it was chosen as the default behaviour, which seemingly defies your expectations. However tons of other behaviours are available as not the default, but that still means that show is the problem.
 
stupid people are stupid.
 
The issue is that show escapes non-ASCII printable characters. I'm arguing that it's 2012.
 
You don't have to blindingly type your string into the interpreter. You can build expressions to have what you want.
 
@ecatmur That is a well made argument, but it is completely and utterly irrelevant
 
@LucDanton But I want to use my interpreter as cat!
 
2:33 PM
@ecatmur Assume that show is not called show but is called embed. Is it a problem then?
 
In 2012, not a single font exists which can render every Unicode glyph
5
 
@ecatmur And yet, nobody cares, because if they did, it would already be changed.
 
which is further compounded by the problem that whilst a a given value is associated with an intended symbol, lets say <what ever the ascii value for the dollar sign is> is supposed to be the dollar symbol, but it could be rendered to look like any characters
 
So in 2012, the behavior you're asking for would be guaranteed to break for some strings
 
@jalf irrelevant; every printable Unicode glyph can be rendered by at least one font.
 
2:34 PM
@ecatmur Yes, proprietary ones.
 
@ecatmur yes, but the interpreter does not control the choice of font
 
Consoles don't switch fonts.
2
 
show is simply not the behaviour you want, so stop using it. It is not problematic on its own, and there are things other than it. You're not forced to use it.
 
And no, Symbola doesn't have everything.
And no, I don't want to have all fonts ever in the world on my machine.
 
also, who cares about fonts in consoles?
 
2:35 PM
The default behaviour is one that breaks in least amount of cases.
@TonyTheLion Because that's where you use GHCi and Show the most.
 
right
 
The only use of Show in real code would be to convert numbers to strings, or serialisation.
 
@jalf But it could produce different outputs depending on the fonts available!
 
And then you don't fucking care if it escapes Unicode characters or not.
Because it's not a tool for working with Unicode in the first place.
 
I detect an ID ten T error
 
2:37 PM
haha, caught that from the C# chat
 
That GHCi shows the return value is a convenience feature, and it has to use Show, because how else would it output the internal representation of a list or a complex ADT.
And you're forcing me to keep on explaining that, so you're a terrible person.
 
<interactive>:2:1:
No instance for (Show (a0 -> a0))
arising from a use of `print'
Possible fix: add an instance declaration for (Show (a0 -> a0))
In a stmt of an interactive GHCi command: print it
@CatPlusPlus Like this!
So much better.
 
I feel this discussion is pointless. OP obviously doesn't understand the purpose of show and should go read about it and find what he doesn't understand in that explanation. Anything else is silly.
 
@CatPlusPlus failing to output printable characters in a readable form is a breakage. It's a tradeoff.
 
No, it's not breakage.
 
2:40 PM
@ecatmur Output is done with putStr and it doesn't fail.
 
@TonyTheLion Of course it is.
 
@ecatmur The behavior they currently use is the one which guarantees that you get valid, non-fucked output
 
Inspecting the representation is done with show and printable or not is irrelevant for that.
 
@R.MartinhoFernandes putStr doesn't escape control characters.
 
at the price of sometimes making you work a bit harder to read the string. But it ensures that the data is at least there
 
2:40 PM
@ecatmur It outputs them.
 
Guess why.
 
I don't why I need to explain this.
 
The alternative would be allowing some data to be silently thrown away depending on the current font
 
@R.MartinhoFernandes Terrible people.
Terrible programmers.
 
@jalf the data is still there; copy-paste it into a character map.
 
2:41 PM
man, I'm out.
 
@jalf And if you want to read it, you can always... I don't know, print it.
 
@R.MartinhoFernandes Don't be silly. What a crazy notion :o
 
@ecatmur What utilities from what language/environment will do the output that you describe? Escaped control, non-escaped Unicode?
 
I'm declaring this poor trolling and it's getting on my nerves so plonk.
 
2:42 PM
@ecatmur Soo, you're saying that what is basically a debugging tool should require me to copy-paste seeming garbage data into a character map which may or may not be available on my OS
 
And GHCi is a debugger, not basically a debugging tool.
 
I've wanted to plonk for a while, but I would have to plonk more or less every regular to spare my self from this shit
 
no, don't plonk every regular, plonk the troll
 
@jalf yes, it doesn't seem too unreasonable. If you're regularly dealing with non-ASCII text you'll have the tools on hand to help with the scripts you can't read yourself.
 
¬_¬ except you lot would still be going on about this shit, so what use is there
 
2:43 PM
encourage other regulars to plonk same troll
 
@ecatmur Yes, and putStr is one of those tools. Marvellous, ain't it.
 
or leave the room until this discussion has ended
 
@ecatmur It is fundamentally utterly and completely unreasonable in every possible way
 
@R.MartinhoFernandes We should fix GDB, too. Since it's interactive and can evaluate expressions.
 
The internet will end before this 'talk' will
 
2:44 PM
You want to make it harder to do use the interpreter for what it is designed for, in order to make it easier to abuse it for something it was not designed to do
 
$1 = {
<std::_Vector_base<int,std::allocator<int> >> = {
_M_impl = {
<std::allocator<int>> = {
<__gnu_cxx::new_allocator<int>> = {<No data fields>}, <No data fields>},
members of std::_Vector_base<int,std::allocator<int> >::_Vector_impl:
_M_start = 0x804b028,
_M_finish = 0x804b034,
_M_end_of_storage = 0x804b038
}
}, <No data fields>}
OMG, GDB is broken.
 
That is about as insane as it gets
 
PLONK THE TROLL
 
@R.MartinhoFernandes Tell me something new.
@TonyTheLion Who's that?
 
@ecatmur
@EtiennedeMartel that guy ^
 
2:45 PM
Well, well.
 
> $1 = std::__debug::vector of length 5, capacity 5 = {1, 2, 3, 4, 5}
To be fair!
 
Use a string (I got that output from the interwebs, I don't have GDB on this machine).
 
oh, the interwebs...
 
@LucDanton It tries to show you some convenient information about your data. That's very different from trying to hide relevant data
 
Did you know: you can make your own Show-like class that doesn't implement escaping for strings? WOOOOOOOOOOAH.
 
2:47 PM
You're going to hate what Python 3 does, then.
 
oh wow, how come I didn't realize that's what programming is all about?
 
In unicode, é can be encoded in at least 3-4 different ways. On seeing the glyph, I have no idea which one the string actually contained.
 
@R.MartinhoFernandes > $1 = "Русский"
 
@LucDanton :D
 
I tried to use é, but my console doesn't even work with that.
 
2:48 PM
only the French need that letter
so fuck it
 
@jalf true, that's unfortunate. It's a tradeoff.
 
@LucDanton Oh well.
 
@TonyTheLion and the English, but forget about them.
 
@ecatmur Yes, and it's a tradeoff you're making to gain the benefits you already have elsewhere. Nice move.
 
@R.MartinhoFernandes Tbh the pretty printers are not always in sync though. And not all of them are that great.
 
2:49 PM
@ecatmur Yes. It's a tradeoff. Throwing away what I obviously need, in order to give me something I don't need, because, well, if I wanted it, I'd have had other tools to get it
That is a terrible tradeoff
 
(e-acute) is a letter of the Czech, Hungarian, Icelandic, Kashubian, Luxembourgish, Slovak, and Catalan, Danish, English, French, Galician, Irish, Italian, Occitan, Norwegian, Portuguese, Spanish, Swedish, and Vietnamese language as a variant of the letter “e”. In English, it may be observed as a pronunciation aid in loanwords (e.g., résumé from French) or romanizations (e.g., Pokémon from Japanese). This also used in Dutch, and Navajo. É (é) is also used for with a rising tone in pinyin, the Chinese language roman-alphabet transcription system. Usage in various languages Chinese In ...
 
As for Python 3.
>>> '\201'
'\x81'
Oh woe.
 
Disgraceful in 2012.
 
That's even worse!
 
2:50 PM
@TonyTheLion all the countries get really anal about what their accents look like, but AFAIK they are all basically the same function, and there are very few languages which have more than one style of accent
 
It changed your escape code!
 
@thecoshman You are mistaken. There is a lot of variations in languages and writing systems. Closely related languages will have similarities, obviously, but it can get quite alien.
 
It's so obviously broken.
C++ is even more broken.
"\201" won't output anything.
 
@CatPlusPlus Is that a valid escape?
Btw, octal escapes are horrid.
 
2:52 PM
It's octal, should be.
 
@LucDanton huh? I am saying that few languages have a justification for getting pedantic about exactly how an accent is drawn, as they mostly only have one accent. There are a few, a am fairly sure, with more then one type of accent for a letter, thus it does matter
 
@CatPlusPlus U+0081 is a control character.
 
@thecoshman and collation rules vary for the same languages even when they are the same
 
I just copied it from somewhere above.
 
@CatPlusPlus but in C++ strings are be default ascii, no?
 
2:53 PM
@thecoshman [citation needed]?
 
@jalf which part :P
 
@thecoshman But it doesn't output anything!
 
@thecoshman Most languages I know have more than one.
 
@thecoshman Encoding is implementation defined, no?
 
I can start by mine, then Spanish, then French, and go on.
 
2:54 PM
@CatPlusPlus try U+00E9.
 
@CatPlusPlus oh, now that is broken, I would have thought the '01' would at least still output
 
@thecoshman that few languages have more than once accent, and that the rendering of the accent is insignificant in those languages
 
@CatPlusPlus Haskell escapes are decimal.
 
@thecoshman What.
 
It's even more horrid than octal.
 
2:55 PM
@R.MartinhoFernandes Oh.
 
@thecoshman French has not only acute and grave accents, but also circumflexes, umlauts and cedillas.
 
@jalf just what I have seen, as in European languages
 
@JerryCoffin Dieresis please. Umlaut is Germanic. (So yeah those things are anal.)
 
@JerryCoffin but does it have more then one option for a letter?
 
(gdb) print "\xe9\n\t\v\x81hello"
$3 = "é\n\t\v\201hello"
 
2:55 PM
@thecoshman Which ones? Offhand, I can't think of a single European language which has exactly one accent
 
@CatPlusPlus I would have thought the '\2' would try to escape, and just not done anything
 
@thecoshman yes
 
I think that if gdb can do it, and Python 3 can do it, then it's not unreasonable to expect Haskell to do the same.
 
@ecatmur That makes no point either.
 
@thecoshman Yes. "E", for example, can have any of them except a cedilla.
 
2:56 PM
@thecoshman It's an octal escape.
\201 is the entire thing
 
The fact that it can do it doesn't mean it should.
 
@jalf huh, well, what can you expect from a ignorant English boy :P
 
@ecatmur Change to p /x foo or /d or whatever.
 
All that matters is that you get a valid representation.
 
I don't even want those stupid Unicode characters.
 
2:57 PM
@CatPlusPlus "\201" prints an ü für mich
 
If default behaviour is to print them on repr, there's no way to not do that.
But it's 2012 right
 
It's 2012, we should not even care, because the world will end.
 
@jalf It's silly but I can't quite figure out when.
 
World already ended, you just missed the memo because it was full of replacement characters.
 
@R.MartinhoFernandes oh yeah, I forgot about all that stupid Myan crap
 
2:59 PM
 
Incredible.
 
@LucDanton You have both é and è. Sometimes in the same word: Exhibit A: "élève"
 
"\201" still doesn't output anything.
In 2012!
 
@R.MartinhoFernandes Oh wait, that was never about 'at the same time' then.
 

« first day (654 days earlier)      last day (4293 days later) »