« first day (1865 days earlier)      last day (3075 days later) » 

user1804599
9:00 AM
lol
 
and when it comes to chapter 8, where it tries to introduce IO/monads
the technical debt of syntax has become so large it kinda starts losing me
 
user1804599
what part of the syntax don't you grok
 
@Elyse deliberately :)
 
maybe syntax isn't the right word?
 
Haskell builds everything on top of each other
 
9:02 AM
some parts of the inference, pattern matching, function parameter matching and defining all functions through currying and defining types are just magic to me
 
if you glance over Functors, you have no chance in hell understanding Monads
 
especially when combined
 
@orlp Forget about things like "currying"?
 
@orlp change the order. Learn defining types first, leave the currying and inference for later
 
(for starters, it's probably not what you meant)
 
9:03 AM
Vlad is Back
 
@R.MartinhoFernandes in simple examples I know what a :: x -> y -> z means
 
> I liked the IBM mainframe PL/X language. It is me who wrote CTRACE record filtering for the IBM mainframe NFS server using the OOP features of the language.
this is new
 
but as soon as you start nesting that syntax, or combining it in other parts it becomes hard for me to grok
just because I'm not really used to it
 
@orlp It's right-associative. That's all you need to grok that.
 
@orlp like map :: (a -> b) -> [a] -> [b]?
 
9:04 AM
@BartekBanachewicz man I can cheat because you named it map
 
x -> y -> z is equivalent to x -> (y -> z), but not to (x -> y) -> z.
 
user1804599
@BartekBanachewicz show it. it's important.
 
user1804599
without it, "This" makes no sense.
 
@BartekBanachewicz but yeah, and it goes downhill from there
 
9:05 AM
@orlp try this example :: (a -> Bool) -> [a] -> [a]
 
Define functions and use :t fun in GHCi to get familiar with them.
 
user1804599
@BartekBanachewicz Thanks.
 
@BartekBanachewicz filter on predicate?
 
user1804599
Not necessarily, but possible, yes.
 
@orlp yea. I've picked those two on purpose. Look at their last two parameters.
Often looking at last two parameters can tell you a lot.
 
9:07 AM
Alternatively you can just read any bit of the form (a -> b) as a function parameter. That works too.
 
the thing is Some params -> (List -> List) makes kinda sense
but as robot pointed out, the params at the end are often omitted, because they are unnecessary
 
user1804599
I like to parenthesise the return type of fmap: fmap :: Functor f => (a -> b) -> (f a -> f b).
 
I used to do it for functions ending on (a -> a), but nowadays I just write State a typically
 
pszName
 
this is probably an advantage overall
 
user1804599
9:11 AM
filter is basically a filter factory. It takes a predicate and returns a function that filters a list.
 
but it does kinda confuse me a bit that you can't document through code that a function returns a function
 
@orlp because it's simple - every function (of n params) returns a function
 
@orlp You can document it by writing the parentheses.
 
@Elyse it's just partial application
no "factory" or anything
 
e.g. std::function<int, int, int> adderFactory(bool optimize) and int add(bool optimize, int, int) are indistinguishable in Haskell
 
9:12 AM
I mean whether you think about "a function that takes a predicate and a list and returns a list" or "a function that takes a predicate and returns a filtering function" doesn't matter.
 
user1804599
@orlp Haskell functions always take exactly one argument.
 
@orlp yes, and it's extremely convenient in practice, also see above
 
user1804599
You can't have ternary functions in Haskell.
 
I know
 
user1804599
9:13 AM
@GregorMcGregor No, it's currying.
 
@orlp Oh, I see your problem.
 
in the end you need all parameters if you want a non-function value
 
Stop trying to write C++.
vOv
 
I'll take this to heart
 
user1804599
9:14 AM
Yes, it is.
 
user1804599
You can't do partial application in Haskell.
 
user1804599
Partial application doesn't make sense in languages in which all functions have the same arity.
 
the arity being one, of course
 
what about 0 arity?
 
@Elyse Apply head to wall
 
user1804599
9:16 AM
@orlp There's no need to have zero-arity functions in languages that are lazy and pure.
 
You can't have currying without partial application hth
 
@orlp not functions
 
user1804599
PureScript needs it in some cases due to strictness, but emulates it by taking () as an argument instead of complicating the language by introducing nullary functions.
 
@GregorMcGregor "partial" only makes sense in the bigger picture.
 
I'm amazed that 2 of our most hardcore functional programmers in the room don't even know basic terminology
 
user1804599
9:19 AM
TIL you're one of our most hardcore functional programmers.
 
But then again it's Elyse and Bratek so
 
user1804599
@orlp what would be the distinction between nullary \ -> 42 and 42? None. :D
 
@Elyse would it be wrong to call 42 an arity 0 function?
 
user1804599
Not sure.
 
user1804599
I guess you could do so.
 
user1804599
9:21 AM
A nullary pure function is always constant function, and 42 is also always constant.
 
@GregorMcGregor Eh, again, partial application is reducing function arity. All haskell functions have arity of 1. It only makes sense if you treat e.g. map as an arity-2 fn
 
@Elyse 42 isn't constant
 
user1804599
42 is constant.
 
42 was 41 yesterday
 
9:22 AM
not for very large values of 42
 
user1804599
42 is like war.
It never changes.
 
The Answer to the Ultimate Question of Life, the Universe, and Everything
 
user1804599
Non-constant nullary functions must have side-effects. There's no other option.
 
TIL that answer is constant
 
@orlp why wouldn't it be?
 
9:24 AM
@BartekBanachewicz wow you must be seriously confused lol
 
@Elyse what is inside your "?" block btw
 
user1804599
@BartekBanachewicz I guess he's just trolling.
 
a fire flower?
 
by your logic all (?) functional languages do that
 
user1804599
@orlp inner beauty
 
9:24 AM
@Elyse semen?
 
user1804599
@GregorMcGregor We were talking about partial application, not about functional languages.
 
To say that all functions are of arity 1 is a gross misrepresentation
 
@GregorMcGregor you're gross
 
user1804599
There are languages that some consider functional, which allow functions of any arity, such as LiveScript.
 
user1804599
Haskell is not one.
 
9:26 AM
So why does arity map print 2 my dear
You make no sense
jfc
 
user1804599
It doesn't, since printing is a side-effect, and Haskell lacks side-effects.
 
Oh it's one of your im-walking-out-of-a-bar-at-7am days
curry on
 
user1804599
It's one of the I'm plonking you to avoid further being-trolledness days.
 
yeah, this is just sad.
 
functional expert alert
avoid further contact
 
9:30 AM
Footage of the warplane downed by the Turkish airforce along #Syria border, allegedly a SU24 https://t.co/tyiOmCzsug https://twitter.com/HaberturkTV/status/669072708660035584
 
@LucDanton looks rather random, really
 
@sehe almost the product of a fuzzer
 
Interesting stats
 
New Wordpress isn't in PHP. PHP is pretty much officially dead by now. #rejoice https://developer.wordpress.com/2015/11/23/the-story-behind-the-new-wordpress-com/
 
9:34 AM
@LucDanton Yeah; but that's not what reducing is... I'm a bit confused
 
this is pretty goddamn huge
 
@sehe it’s Clang reducing for GCC though, and I don’t think it supports concepts
 
@BartekBanachewicz Listen up: it's just wordpress. It's only "goddamn big" if it's been written in Haskell now
 
user1804599
@BartekBanachewicz No, it's not. Many not-WordPress projects are in PHP.
 
@LucDanton ah this is gonna explain the early invalid C++
 
9:36 AM
@sehe Haskell isn't really that strong in the mainstream blog thingy. I guess JS is a perfect lang for a platform like wordpress.
@Elyse irrelevant (for me)
 
user1804599
Weird.
 
@BartekBanachewicz ? IDGI, When would JS be a good language and why
 
WP has been running web for soo long
 
it’s also very ruthless regarding what you ask it to do, i.e. I asked for a 'sorry: unimplemented …' message and it looked for that. It does not try to produce otherwise 'sensible' programs, because I didn’t ask it to.
 
@LucDanton That's the other part... So it /is/ rather random (in how it related to the original)
 
9:38 AM
@sehe when you step outside the ivory tower and notice people not willing to put enough effort into Haskell to become productive in it
 
teehee
I asked about JS
 
too bad about the concepts features, otherwise I would have asked for an -std=c++14 'clean' compile alongside—ideal for tracking regressions, perhaps applicable here
 
it's good enough.
 
it's shit
 
It has one of the best package managers currently available, it's extremely easy to deploy and you can start writing in a week
@GregorMcGregor yes, that's true
But world demands shit quality and JS delivers
 
9:39 AM
if shit is good enough for you then I have some bad news
 
@BartekBanachewicz so maybe let's point my question so you hear it "Why is JS better than PHP here"
 
@sehe yes, it uses the Clang framework to smartly walk the tree (e.g. 'let’s try but without that function'), not to compile the program
 
> Calypso is the new WordPress.com front-end
 
@sehe it's not harder to learn and deploy, but has a better core and a nicer ecosystem
 
Teen who allegedly raped, killed math teacher competent to stand trial - when an underaged minor rape an adult, who is committing the rape?
 
9:40 AM
> However I think it’s extremely unlikely that [rewriting WordPress core in JS] it’ll happen. Plugins are one of WordPress’s strongest strengths and the fact that a plugin written 5 years ago can usually still work on WordPress today. Switching to sometime else would break all of that. Additionally PHP/MySQL are available on nearly every single webserver at nearly every hosting company while Node.js is not.
Also from the horse's mouth.
 
@chmod666telkitty the rapist - why the question
 
@bananu7 Oh wait, that's just the admin panel. NVM the world is doomed.
I had my 5 minutes of joy.
yawn
 
so what else is up
 
You. Apparently
Hi
 
9:44 AM
@sehe and really writing in JS feels quite a lot as in Lua. Sure, it's more annoying and the like, but the libraries quantity kinda evens it out, browser tools are much better than the ones for Lua (console.log in chrome is amazing), and overall how the lang performs is a function of much more than its core.
 
lol that's like saying "printf is amazing"
 
@GregorMcGregor but it is, no? :P
 
that's why it's called 'Hardware'
 
Morning.
@TonyTheLion You are <3
 
@GregorMcGregor console.log is a debugging utility. Which printf can certainly try to be, but in principle it's a C's try at higher-level console IO.
 
9:51 AM
user image
13
 
Approach with caution.
 
@Morwenn <3
 
It is possible another dog is approaching
 
The little one is there to lure burglars into a false sense of security.
 
9:56 AM
There might be a puppy hiding behing that dog.
 
Beware of the dog, don't step on it ...
 
10:06 AM
@sehe haha
Makes sense with a sign for the white dog
 
racist
 
@GregorMcGregor but are you a chinese troller then
or hwat
since you're obviously not a patata farmer
 
Ven
a-hoy
 
Would it be legal for std::stable_sort to call std::sort when the lack of stability isn't observable with the type of the elements of the collection to sort?
Hum...
 
@Morwenn theoretically the stability could still be observed by a comparator
 
10:16 AM
Stay Warm With These 12 Parallax Scrolling Libraries That Will Turn Your MacBook Into An Actual Space Heater
 
or by a custom allocator::pointer
etc
 
@orlp Not for the overload that doesn't take a comparator.
 
@orlp How so? I am not good with allocators.
 
buzzfeed js is amazing
 
10:17 AM
@Morwenn I probably explained it too complex
@Morwenn just ignore that - it can still be observed with arbitrary iterators
 
Yeah. The guarantee for stability is not limited to the sorting predicate.
 
I feel a bit dumb but I don't understand.
 
It should hold whatever predicate might be used subsequently.
 
This Man's Life Depended On Node.js Stable. Wait Until You Hear How He Died
 
@Morwenn a custom iterator can overload *it to track writes
 
10:21 AM
@Morwenn vector<int> v{1,2,3,4,5,6}; stable_sort(v.begin(), v.end(), [](auto a,auto b){return false;}); // This may not rearrange any elements, even though the difference isn't observable through that predicate.
 
@orlp Then we could observe that it doesn't use the same algorithm, but would this break the stable guarantee?
 
basically, I believe you can do it iff 1. no custom comperator, 2. no overloaded <, 3. no iterator object (T*), or a known one that doesn't track (std::iterator), 4. no custom copy/move constructor
@Morwenn yes
stability says that equal elements do not get moved in array position, relative to eachother
@Morwenn also
float/double comes to ruin your day again
 
@orlp Yeah, those ones are always party poopers.
 
0. == -0.
yet not same bit pattern
@Morwenn so I think it can pretty much exclusively be applied to calls to sort with two pointers to integers
and if you're special casing that - why not do radix sort?
 
@orlp Or aggregates of integers with trivial comparisons. Ok, not standard yet.
@orlp Too slow for small collections :p
 
10:29 AM
@Morwenn well don't you have your network stuff for small collections?
 
And the memory guarantees for radix sort probably do not match.
@orlp Yeah, but there's still a gap between 32 elements and the number of elements needed for radix sort to be useful.
Spreadsort is fast too when it comes to sorting integers, but only worth it for more than 10k elements.
 
Ven
ahoy, hey
 
user1804599
hello @Ven
 
Ven
hi @Elyse. what's up?
 
user1804599
work
 
10:39 AM
@Morwenn So what's the fastest thing to sort, say, 32-128 ints?
I've always done counting sort
 
I'm always counting on std::sort
 
user1804599
> Uncaught RangeError: Maximum call stack size exceeded
 
user1804599
Stack trace shows only 20 stack frames.
 
@GregorMcGregor No idea. Some sort that relies on the fast cache access probably.
 
10:41 AM
2 messages moved to bin
 
Input and code
 
@TonyTheLion Most of the time it's a safe bet.
 
Why? @TonyTheLion
 
yesterday, by Elyse
Thank you for choosing Lounge<C++>. Have a look at The Rules and enjoy your stay!
@MikhailTal Stack Overflow is for questions, if you had read the rules, like I asked you yesterday, you would know that
 
Im having a bug in a piece of code, i thought it would be more approporiate to as khere
ask*
 
10:43 AM
no
 
@Morwenn I've always written counting sorts because it's trivially parallelizable (on GPU)
 
I dont have a question per se
 
And all input fits in registers
 
user1804599
@MikhailTal Why?
 
I should try a sorting network for fun and profit
 
10:43 AM
@Elyse WHy the bug or why not the main site?
 
user1804599
Yes.
 
In the big picture, I was wondering whether having std::is_trivially_comparable traits and the like to support defaulted comparisons was a good idea.
@GregorMcGregor What if you only have 0, 150, 1500, 1500 and 60000 in your collection?
 
@Morwenn Radix sort then
 
@Elyse The bug happens at case 31 strangely, I don't know why. I hand checked some of the smaller cases and the program looks fine
 
@GregorMcGregor I mean, couting only works well when your values are close to each other, right?
@GregorMcGregor Well, then it becomes more expensive for small collections :/
Sorting networks work rather well with integers.
 
10:46 AM
I'll try this later
 
I don't think I like your tone. Your momma never leveled your speechcraft or something?
 
FUS ROH DAH
 
Ell
11:02 AM
I'm looking forward to 2018
 
Should be a few months into our next project then. Man, time flies.
 
@Ell what happens then?
 
What's in 2018
 
Presumably, TES VI.
 
OMG HYPE
Skyrimjob was p good
 
11:05 AM
oh you
 
Is getservbyname actually useful?
 
Surely there's scenario's where having that is useful
 
getservedbyname("Scarlett Johansson"); // Falls back to Eva Mendes in case of failure.
 
Hi, no question dumping.
 
11:12 AM
Seems rather important to not mix that up. And also easy to remember. C has only PODs — sehe 10 secs ago
 
2 messages moved to bin
 
I really get bad vibes too often around that Joachim guy
 
I thought I was clear the first and second time
 
@sehe I'm parsing, writing really ugly code.
Going for max perf for no reason at all.
 
@JohanLarsson Cool.
 
11:13 AM
Regarding type-punning, it's in C it's defined, I always mix those up. :) — Joachim Pileborg 41 mins ago
 
@JohanLarsson Not so cool
 
And perf is killed by substrings any way
 
lol
 
@ElimGarak Yeah. IRTA "I should really not bother with C++ questions as I divide my attention too much to be accurate"
 
> Are there any use cases where a union must be used and boost::variant cannot be used?
Are there reasons while one may prefer having a banana milkshake over mashed potatoes
(no. bad analogy)
 
11:18 AM
31
Q: non-class rvalues always have cv-unqualified types

fredoverflow§3.10 section 9 says "non-class rvalues always have cv-unqualified types". That made me wonder... int foo() { return 5; } const int bar() { return 5; } void pass_int(int&& i) { std::cout << "rvalue\n"; } void pass_int(const int&& i) { std::cout << "const rvalue\n"; } int main...

 
sbi
@KevinC Really. So much bad feelings just because the people here do not agree with you. Get this into your stubborn head: On Stackoverflow, the opinion of the majority of the high-rep users in the C++ tag certainly is "the standard". You do not have to like that, but you will need to accept it. Because this is how SO works. If you do not like this, why don't you just move on and advertise your project elsewhere?
Sigh.
 
@GregorMcGregor Horrible
 
@KevinC The only double standard I apply...
6
@GregorMcGregor Banana milkshakes certainly taste better, but bananas are more radioactive than mashed potatoes.
 
> Slotin was testing criticality of plutonium for the Manhattan Project when his hand slipped and he dropped a plutonium hemisphere onto the other hemisphere, producing a prompt criticality.
 
@ElimGarak I have seen a documentary about that. Poor guy.
 
11:25 AM
That is wrong, actually, he dropped a piece of the neutron reflector (made out of berryllium, for example). The core was made out of plutonium. Plutonium was used in the implosion type device (Fat Man, Nagasaki). Which is the normative part of today's thermonuclear devices as opposed to the gun type for the first stage. The initial fission reaction core is either spherical or egglike (like the W88 in Trident II missile).
 
> On 21 May 1946, with seven colleagues watching, Slotin performed an experiment that involved the creation of one of the first steps of a fission reaction by placing two half-spheres of beryllium (a neutron reflector) around a plutonium core. The experiment used the same 6.2-kilogram (13.7 lb) plutonium core that had irradiated Harry K. Daghlian, Jr., later called the "demon core" for its role in the two accidents.
wow
> Slotin grasped the upper 9-inch beryllium hemisphere[14] with his left hand through a thumb hole at the top while he maintained the separation of the half-spheres using the blade of a screwdriver with his right hand, having removed the shims normally used. Using a screwdriver was not a normal part of the experimental protocol.[1]
WTF? What an idiot.
 
People get too comfortable and make mistakes, but that was pretty dumb, yeah.
The resulting Cherenkov radiation must've been a pretty sight, though.
 
> At the time, the scientists in the room observed the blue glow of air ionization and felt a heat wave.
 
Man, I'd love to see that and you know, live to talk about it.
 
Ghost in the shell
 
11:36 AM
@ElimGarak Well, you could live to talk about it for about 10 days ;)
 
we should take the chernobyl plant and chop it up in trillions of small bits and spread it all over the planet
 
what heck is on her eyes though ...
 
at face value that might seem like a bad idea, but it would actually remove the problem :P
 
But he didn't really save the other scientists, that amount of radiation probably gave them cancer eventually. Many of the Los Alamos experimental core crew died of similar problems, Fermi included. Stomach cancer, IIRC.
 
@chmod666telkitty Oculus Rift?
 
11:38 AM
Oculus Rift does not look like a bra
 
@chmod666telkitty Apparently you didn't watch enough hentai.
 
@chmod666telkitty You own one?
 
@Morwenn I am glad you said that
@fredoverflow I don't any of the former but a lot of the latter, I guess they don't count ...
 
> Aleksandr Akimov was the shift supervisor of the night crew when Chernobyl #4 blew up. He refused to leave his post and continued flooding the reactor with water in an attempt to cool it down. He received a dose of 15 sieverts per hour, or 150,000,000 bananas, and died 2 weeks later.
I like people like this. He took those bananas like a man.
 
I'm more the kind to flee in the face of problems.
 
11:44 AM
So... I was listening to "Kiesza - Hideaway"... There is a line "Hideaway with me some more..." IHTA "Have your way with me some more."
 
 
Ugh, gross ahahah
Albert Stevens (1887–1966), also known as patient CAL-1, was the subject of a human radiation experiment, and survived the highest known accumulated radiation dose in any human. On May 14, 1945, he was injected with 131 kBq (3.55 µCi) of plutonium without his knowledge or informed consent. Plutonium remained present in his body for the remainder of his life, the amount decaying slowly through radioactive decay and biological elimination. Stevens died of heart disease some 20 years later, having accumulated an effective radiation dose of 64 Sv (6400 rem) over that period. The current annual permitted...
This reminds me of Vault-Tec. Whenever people tell me how Vault-Tec & the Enclave are unrealistic, I show them this guy.
 
Bored in the office? Use Chrome and search for 'a long time ago in a galaxy far, far away'. Regret it, you will not.
4
Brilliant
@orlp ew ew ew ew
 
@sehe I came, I saw, I became more bored
 
I don't care. It's nicely done
 
11:56 AM
Amazing
 
Also, do you ever work?
 
@sehe Trolling the lounge is a full time occupation
 
@ElimGarak That's horrible.
 
@sehe I do work, yes :)
 
I strongly suspect she has more occupations on the side. I mean, trolling
@TonyTheLion hehe. not you
 
11:57 AM
:D
 
@orlp yikes
 
@Rapptz the response of the baby is so hilarious though
"Ah"
 

« first day (1865 days earlier)      last day (3075 days later) »