« first day (880 days earlier)      last day (4083 days later) » 

Xeo
10:00 PM
Hmmm... @DeadMG, do you know what exactly is meant / wanted with "Impact on the standard"? Impact on the current standard, like conflicts or something, or just what is going to be added?
 
@Xeo It mostly refers to other requirements/pressures caused, like deprecating other components, other proposals needed, that kind of thing.
 
fileformat.info seems to pick the Window-1252 interpretation for the visualisation of C1 control codes (U+007F..U+009F), which is just silly.
 
Xeo
@DeadMG Ah, ok.
 
@R.MartinhoFernandes So basically the character works fine when writing it as proper UTF-8 and only breaks when it's entity encoded?
 
Xeo
@DeadMG So a new grammar rule (or what do you call it?) wouldn't fall in there?
 
10:01 PM
no
that shit's just "in my proposal".
 
Xeo
I guess I'll just leave that part empty then, huh.
 
@NikiC Yeah, weird. It might be that this is yet another wilfull violation of another standard by the HTML spec.
 
or just state that your proposal has no other requirements/dependencies/doesn't change any existing.
 
How long does it take for one to learnabstraction? sigh
 
user142019
@Pawnguy7 Did you ever write a function?
 
10:05 PM
Yes...
 
user142019
Well there you have it. You most likely wrote an abstraction.
 
LEss often, but yes :D
 
@NikiC Do you know if "HTML entities" are defined by HTML or if it defers to XML?
 
yay, puppy's proposals are live.
I am officially the author of N3572 through N3755
 
user142019
XML only defines &, < and &#…; I think, but I'm not sure.
 
Xeo
10:06 PM
> Proposing the Rule of Five—Walter Brown
That thief!
 
There is a difference between writing a function and writing a good function, though.
 
Greetings!
Can somebody please explain to me the following statement?

SomeClass& operator = (const SomeClass &); // can't allow assignment
In particular, the use of & and const
 
Xeo
Read a C++ book. :|
 
@Zoidberg XML defines them all.
 
@Xeo Of course....
 
user142019
@R.MartinhoFernandes OIC
 
@Xeo I know it's doing an operator overload of = , but I don't grok the significance of & and const
 
@NikiC So, according to that, it seems it's just non-conformant behaviour by browsers.
 
Xeo
Hm... I don't need to have a full-fledged ready specification in standardese, right? :)
 
@R.MartinhoFernandes it would seem so, though I'm not entirely sure
 
10:10 PM
@Xeo Right.
Herb said that proposals should be "feature-complete" by Bristol.
 
@Chimera It means it accepts a non-mutable reference to SomeClass.
 
@R.MartinhoFernandes So does this statement prevent copying of two instances of a class that aren't references to the class?
 
No, no.
Generally SomeClass& operator = (const SomeClass &); can be called with any instance of SomeClass, because any instance can bind to a non-mutable reference.
 
@R.MartinhoFernandes Though actually it says "are allowed to reference any Unicode code point other than U+0000, U+000D, permanently undefined Unicode characters (noncharacters), and control characters other than space characters." and NEL is a control character that is not a space character, so by that statement it would seem invalid to even use that entity. It all doesn't make sense to me ^^
 
@Chimera The comment refers to the fact that there is no definition of that operator= anywhere, which causes an error when it would be used.
In C++11 you would write SomeClass& operator = (const SomeClass &) = delete;, which not only makes the intention more clear, but also gets you the error earlier (compile-time, rather than link-time)
 
10:14 PM
@R.MartinhoFernandes ah ok thanks for the explanation, very much appreciated.
 
Dammit, forgot the 11.
@NikiC Oh, that makes some sense because Unicode leaves the interpretation of (most) control characters to external protocols.
 
@R.MartinhoFernandes yeah, of course we aren't using a C++11 compiler...
 
@NikiC Though it depends on what that means by "space characters".
 
@R.MartinhoFernandes "The space characters, for the purposes of this specification, are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR)." ;)
 
Ah, ok. Pretty clear.
 
10:18 PM
g++ (GCC) 3.2.2 <=== old as dirt
 
lol
@Chimera Yeah, I just mentioned the C++11 bits because before it used to be just a convention (hence why your sample has a comment), while now that practise has been formalised (with = delete;)
 
@R.MartinhoFernandes got it.
 
Did you just upvote me here?
32
A: Disable copy constructor

R. Martinho FernandesYou can make the copy constructor private and provide no implementation: private: SymbolIndexer(const SymbolIndexer& that); Or in C++11, explicitly forbid it: SymbolIndexer(const SymbolIndexer& that) = delete;

 
@R.MartinhoFernandes No but I probably should.
 
surely this is going to be breaking as fuck.
 
10:23 PM
@Chimera Ok, it just seemed like a weird coincidence that I got an upvote there about the same time you asked about it :)
 
yeah that is weird
 
@DeadMG It is merely moving deprecated stuff to the bin.
It's an "announced" breaking change.
 
@R.MartinhoFernandes In your answer what is "that"?
 
New paper: N3578, Proposing the Rule of Five&#8212;Walter Brown http://bit.ly/13YV7Ly
 
@Chimera The name of the parameter :) It's never used, so it is optional.
 
10:25 PM
place holder for a calss variable?
 
Walter Brown, Y U NO Rule of Zero
 
@R.MartinhoFernandes ok cool... So I guessed right...
 
If I have an author related to books, should the books have the author (thus no author), the author have the books,both?
 
but
 
10:27 PM
his proposed changes don't really work
unless my skimming was incorrect
for example, move-only types
 
Write a move ctor, a move assignment, and a dtor. Done.
That already works as in the proposal: no copy members are generated today.
 
well, I think that with =default; though, it's really not that big of a deal to have to add them when otherwise I would not have to.
 
Xeo
Hmm... damn. If I specify my lifting-lambdas as an extension of lambda-expressions, I would basically have to rewrite [prim.expr.lambda] ... maybe I'll just make it a new primary-expression >_>"
I'm really bad at this specification thing, it seems.
 
@DeadMG Yeah, basically the proposal is: either you get them all for free and write none, or you explicitly specify all the ones you want.
 
@Xeo Nothing wrong with that.
 
10:30 PM
@R.MartinhoFernandes That sounds like what we have right now? The devil must be in the details.
 
[] {, [](args) -> and []ident are not ambiguous grammatically.
 
@LucDanton No, you can get copy ctors implicitly as deprecated behaviour.
That's what the proposal deals away with.
 
Oh, the deprecated thing. Good.
 
Xeo
@DeadMG I know, and if I specify it as a primary-expression, I don't have to deal with forced empty [] and disabling the associated conversion to function pointer...
 
@R.MartinhoFernandes That's funny, the way I remember the wording it's that it's the deleted definition that's deprecated. Not the declaration.
 
10:33 PM
Today struct foo { ~foo(); } is copyable, with a deprecation warning (right? we have warnings for this, right? right?).
Under that proposal, it won't be.
I am sure this changes a lot of code, because there's a lot of the misguided struct a { a(){} ~a(){} }; out there.
 
Xeo
Lol, from some llvm review thing: i.imgur.com/QT1vQRv.jpg
They got a plugin that adds a "create macro" button...
 
@R.MartinhoFernandes what is that you are referring to?
 
13 mins ago, by Griwes
New paper: N3578, Proposing the Rule of Five&#8212;Walter Brown http://bit.ly/13YV7Ly
 
@R.MartinhoFernandes ah sorry, I meant the misguided part, basically where is the problem there
 
@bamboon No big problem, but it is completely redundant.
 
10:40 PM
@R.MartinhoFernandes oh, you really mean empty ctor and dtor?
 
Yeah.
It often implies problems at a bigger level, i.e., design.
Those things tend to have init() functions, or be nothing but passthrough getter/setters.
Let's test this hypothesis —
Hmm.
Now I have no idea where the problem comes from.
 
Xeo
@R.MartinhoFernandes Probably their automation script or sth
 
@R.MartinhoFernandes I like the idea, but I don't think it's feasible (due to breakage you mentioned).
 
@StackedCrooked To me it hinges on the "(right? we have warnings for this, right? right?)" bit.
I don't really know if compilers have been warning about it (I don't write code like that! :P).
 
Xeo
I don't think so
 
10:45 PM
I think -Weffc++ covers that.
 
@Xeo Then it's too soon to change it.
@StackedCrooked Not good enough, warning should be enabled by -std=c++11.
 
Xeo
@R.MartinhoFernandes Maybe it wasn't targeted specifically at C++14
 
Xeo
Oh
 
user142019
Girugamesh are fucking great.
 
10:46 PM
so xeo
how's your proposal coming along?
 
> This paper proposes to obsolete the deprecated behavior, giving C++14 a true “rule of five” instead of the traditional “rule of three.”
 
Xeo
17 mins ago, by Xeo
I'm really bad at this specification thing, it seems.
 
so "Badly" then :P
 
Xeo
I have all the ideas in my head, but they won't insert themselves into the editor. ;_;
 
that is why I started writing mine six months in advance
 
@StackedCrooked For clarity, the standard clearly states "In a future revision of this International Standard, these implicit definitions could become deleted", which is exactly why compilers should be warning at the default level.
 
-Weffc++ is odd. It combines useless warnings with some useful ones.
 
@wilx Yeah. It generates noise too easily.
 
@wilx Yeah, I tried it but it wasn't useful.
 
Xeo
@DeadMG I'm a lazy slacker, and it got the better of me more than once already - worst thing being, I don't seem to learn from those cases. :|
 
10:49 PM
@Xeo You're too lazy to learn.
I'm making ogonek::name(u) not always return the normative name.
 
the important thing is
I can now change my CV to make myself the author of four real proposals.
 
assert(ogonek::name(U'\n').empty()) is annoying, isn't it?
 
if only I hadn't cocked up the allocator one at the last minute
 
Xeo
@R.MartinhoFernandes lol
@DeadMG What exactly happened?
 
10:52 PM
@Xeo That's the normative name.
 
@Xeo I meant to introduce a small_allocator, but didn't,
 
I think it's ok to have ogonek::name get you a more useful name, and leave the normative bits in the ogonek::ucd namespace.
 
user142019
@StackedCrooked lolwot
 
@R.MartinhoFernandes I don't really know.
 
Xeo
@DeadMG Why not send in an addition? :P
 
10:53 PM
So assert(ogonek::name(U'\n') == U"LINE FEED") or something (official alias), while assert(ogonek::ucd::get_name(U'\n').empty()) if you really need that.
I'm also including typo corrections, i.e., no BRAKCETs.
 
Xeo
Crap. I can't just model my cases after INVOKE. :|
 
@Xeo Well, I suppose that, technically, I could, huh.
 
Xeo
Doing so would mean for []operator<<(std::cout, "hi") to invoke the member operator<<(void*)
Fuck.
 
@LucDanton You mean youtube.com/watch?v=CxK_nA2iVXw or you think it isn't annoying?
 
I would like to know the purpose of name first.
 
10:57 PM
@R.MartinhoFernandes Wait.
What does empty() mean?
 
@EtiennedeMartel ""
 
Okay. What does name do?
 
@Xeo Yeah, you need to consider ADL-found functions.
 
@EtiennedeMartel Who is name?
 
but I don't see the problem, personally
 
10:59 PM
Seeing the current room title, I feel obliged to point out that I refused to be bound by my rep-whore behavior.
 
just say that, when the resulting function object is called, it is as if that name had been invoked in the scope from which it was created.
 
Xeo
@DeadMG Meh, I get that for free with the id-expression(args...) version of call.
 
@EtiennedeMartel Gives you the name of that character!
 
@R.MartinhoFernandes Okay, so, LINE FEED.
 
Xeo
What my problem is that I currently have member functions being ranked higher than free functions
 
10:59 PM
In Python unicodedata.name('\n') gives "ValueError: no such name", which is just wrong (the character has a name: an empty string).
 
why so?
 
Xeo
And operator<<(std::ostream&, char const*) is a free function
@DeadMG Mirroring INVOKE
I think I have a solution in mind, though
 
@Xeo Screw INVOKE, you don't need any of that shit.
you're not thinking sufficiently DRY.
 
@Xeo That suggests your proposal is tackling some kind of 'uniform calling' bit. Arguably out of scope.
 
@Xeo I'm sorry Colonel member function, but we have to demote you. You are now Lieutenant member function. Sorry 'bout that.
 
11:00 PM
for []f, then when the result is called with args, it shall be as if f(args) was called.
all you need is a smidge of special wording for operators and you're done.
you can just delegate to all the normal lookup rules... you don't need to spec any yourself.
 
Xeo
@DeadMG For that, I don't need a proposal. #define LIFT(id) [](auto&&... vs){ return id(forward(vs)...), done. :s
 
[]operator+ to obsolete std::plus<> {}? Tempting.
 
@Xeo Firstly, horrific macro, and secondly, that doesn't work for operators.
and thirdly, we already knew they were equivalent.
 
Xeo
Anyways, my solution: If the unqualified-id matches operator-function-id, and sizeof...(vs) == 2, I just say it should produce `a0 operator-function-id a1`` .
 
Yo, unary operators.
 
Xeo
11:02 PM
@LucDanton Oh, true.
 
and fourthly
what the fuck is going to be the behaviour of []f if not that?
 
arg.f, arg.f(moar_args)
 
@LucDanton haha, []operator+ gets interesting with that.
 
@R.MartinhoFernandes Yup.
 
Where are all the proposals, by the way?
 
Xeo
11:03 PM
@R.MartinhoFernandes 1 arg, +a0, two args, a0 + a1, easy!
 
@isocpp
ISO C++ standards committee - ISO/IEC JTC1/SC22/WG21
207 tweets, 3k followers, following 0 users
 
[]operator++(int) // wait, what?
 
Xeo
@LucDanton Uh...
Y U make my life so hard. :(
Yeah, I don't think this proposal will fly for C++14. Ugh.
Too much to think through yet.
 
@EtiennedeMartel isocpp.org, bottom right coroner. (ah fuck it, the typo is funny)
 
Xeo
Although, it is only required to be feature complete - minor amendments to how it handles cases should be fine, right?
 
11:05 PM
yep.
 
Xeo
@LucDanton That's one really mean case. :/
 
Wasn't the deadline yesterday?
 
although
 
Xeo
@R.MartinhoFernandes I thought today?
 
I don't actually know if the deadline hasn't passed already, since they're throwing the props up right now.
@R.MartinhoFernandes 15th, I thought.
 
11:05 PM
Oh.
 
Xeo
Richard said 15th
 
hmm
I might scrape together a small proposal.
 
small x = 0;?
 
no
can we add default template arguments to existing templates without breaking them?
 
Xeo
11:07 PM
@DeadMG Depends on which ones, I think. STL adds them to std::less etc.
 
Oh, right, today was "Steak and Blowjob day".
 
no, I mean, whole new template arguments.
not defaults for existing ones.
 
@DeadMG The standard ones? User code is not allowed to assume them.
 
It's a breaking change.
 
Xeo
@DeadMG Not entirely sure. I remember hearing that users can't rely on the number of template parameters for standard class templates.
 
11:08 PM
@R.MartinhoFernandes So no user code is allowed to assume that I didn't go adding an extra defaulted template parameter.
 
@Xeo That used to be a popular misconception.
 
Xeo
@LucDanton Ah, ok.
 
I've seen it debunked on std.c++
 
@LucDanton It is?
 
Xeo
So I did have it correct in the back of my head.
 
11:08 PM
@R.MartinhoFernandes Well, members of the SC argued so on the list. At the least it's a grey area that could use better wording.
 
well
I could use a partial spec instead, but it's the fuglies.
 
Xeo
Where do you want another parameter?
 
containers
 
Xeo
... for?
 
I think people argued that you couldn't rely on the number of arguments because nobody uses template template parameters.
 
11:10 PM
small object.
 
But really, there's no good reason to break foo<std::vector>.
 
Xeo
Btw, Luc, any immediate relief for []operator++ handy? :s
 
@Xeo C++98 was written with the intent of allowing that, but since then people have realized it's basically just not possible.
 
Post-prandial vidya gaems means I'm far, far from being at my best to think right now.
 
Xeo
lol
Anybody else, then? :D
 
11:12 PM
so
 
FWIW special-casing []operator++(int) may not be the worst thing in the world.
 
FUCK YOU FN LOCK
 
[]operator+ for unary vs binary is far more... interesting.
 
Xeo
@LucDanton Well, I'd do it with casing on the number of arguments.
 
what are the rules for how many allocators are used by containers?
 
11:16 PM
Well there's the one member and then containers are allowed to use any number of (equivalent) copies that they want. Don't think this changed for C++11.
 
that's unfortunate
 
I guess that makes allocators the iterators of the allocation business.
 
in that case I'd basically have to go with a partial spec of the container.
 
Xeo
Hm. []operator[] and similar member-only operators will also be funny, although I guess I could pack them under member function. Yeah, I should do that.
Also, that looks kinda funny.
 
It does. I lol'd D:
 
Xeo
11:18 PM
Totally fucked up, but funny.
 
lol []operator[]
operator castle wall.
 
Should be commutative +operator[]
 
Xeo
lawl
 
Or []operator++ (postfix) and ++operator[] (prefix)!
 
Xeo
Stahp it, I have a proposal to write. :'D
<:]operator[:> -- operator smiley faces
Dammit, I have taken too much liking to digraphs, ever since the <:??)??<%> incident
 
11:22 PM
"incident"
I'm cutting the per-code point casing operations. Strings only.
 
Xeo
[]operator??!, the coalesced form of cond1 ? cond2 ? a : b : c
Okay, I'll stop now.
 
@R.MartinhoFernandes FnUCK YOU?
 
You need to know what you are doing to use them per-code point, so use the ucd sub-namespace.
 
Ohai
Wokay
 
@ScottW We've been there before.
Mar 6 at 16:33, by R. Martinho Fernandes
room topic changed to Die Lounge<C++>: Dies ist eine Kriegserklärung gegen PHP! [c++] [c++11] [c++-faq] [kein-helpdesk]
I kinda miss .
 
11:25 PM
@LucDanton Ah. Post-pradial and me meet again
 
Xeo
But this is awesome, operators give me even more reason to not simply make this a macro.
 
@R.MartinhoFernandes lol:
> I was about to like it but I won't, since I have no strong feelings one way or the other
I get a feeling []history[] is being []written++ but I'm not sure I like this. I'm pretty sure Herb's Stroustrup quote was written precisely against this type of thing
(not even having a clue what is is for)
 
Ell
Dern Bt home hub being bad
 
Crazy combinatorics time: with a set {1, 2, ..., N}, how many permutations of all subsets of this set there are
 
> "being able to do every trick is not a feature but a bug"
 
Xeo
11:29 PM
Tell that to INVOKE
 
@Xeo INVOKE seems kinda nice. But does it come with ugly complicated contextual operator overloads?
 
Xeo
Also, if I do the transformation to function object, I don't think I should just stop halfway there.
@sehe Contextual operator overloads?
 
@CatPlusPlus Too many!
2^many
 
Xeo
The [] in []id-expression comes from lambdas
 
I dunno. If []operator++ means something, surely [] provides some context?
 
11:31 PM
@CatPlusPlus There are 2^n possible subsets.
 
I know that
I want all permutations of those subsets
 
Ell
Why 2^n ?
 
Because
 
Xeo
If you have all subsets, don't you also have all permutations?
 
there's a formula for it, kinda like nCr but nPr.
 
11:31 PM
It's (2^n)!, i.e. too many.
 
@Xeo No
 
@Xeo Sure. So now we can have ... operators on lambdas? Only, without a body? Wait. I'm pretty sure it all makes sense and we're getting awesome sauce syntax.
 
@R.MartinhoFernandes Is it? I thought it'd be too easy
 
@sehe It's a function object that calls that operator.
 
user142019
@Xeo no.
 
user142019
11:32 PM
Sets are unordered.
 
Ell
People get so defensive sometimes, to ensure people know they didn't just learn something from someone else
 
Xeo
@sehe Never tried to pass an overloaded or templated function to std::bind? Or some Phoenix thing? Or to anything that is templated on that argument?
 
(I need a count of key space of permutation cipher :negative:)
 
@R.MartinhoFernandes Aha. You mean, the ugly syntax is missing ([]operator++ would be short for [](T something) { return ++something; } ?!
 
Xeo
@sehe ++something, but yeah
 
11:33 PM
@CatPlusPlus Well, are the permutations of a specific size, or of the whole set of subsets?
 
Xeo
With perfect forwarding and all that sugar
 
@Xeo Duh. I know what polymorphic lambdas are. I also know that []operator[] is just funky
 
Permutations of each of the subsets summed
 
@CatPlusPlus Oh. That's not what you asked first! :P
 
@Xeo Oh well, in that case, I just got plenty side-tracked by falling in with the worst case examples/contraptions I guess :0
 
11:34 PM
(Excluding empty set and one-length sets but those are N+1 anyway)
 
Xeo
I think operator++ and operator-- are the only unary ones with double meaning, right?
@sehe Yeah
 
@R.MartinhoFernandes Maybe, I'm bad at combinatorics :v:
 
Xeo
You'd mainly use it for normal functions
 
And English
Yeah I kinda asked it wrong
 
@Xeo (Of course the room topic could have shed some light. It wasn't actually all that clear what []operator+ unary/binary was supposed to mean :))
@Xeo Nice. I wonder how C++ syntax would absorb that. Seem kinda farreaching
 
Xeo
11:35 PM
@sehe []id-expression is currently ill-formed, so all's fine and dandy in that regard
 
@Xeo Makes sense. Mmm. Thinking
 
@CatPlusPlus It think it's sum(nCr!) for r in {0, 1, ..., n}.
 
I might be describing the key space wrong too, but it seems right vOv
I forgot how that C is called
 
Combinations.
 
Bad memories from 2 years ago and discrete math course
 
11:38 PM
That summation may have a closed form (there are many for things involving combinations and factorials), but I don't know it offhand.
And wikipedia doesn't have it.
 
Ell
(N!)/(n!(n-r)!)
Or something, Idk
 
That's not a closed form of the summation.
Wikipedia says Concrete Mathematics has a whole chapter dedicated to it. I have it on my shelf, but am too lazy to pick it up.
 
I'm bad at cryptography too
This keyspace might be infinite really
 
I should read more of that book some day.
Oh wait.
 
@R.MartinhoFernandes It's too heavy, it's not your fault
 
11:43 PM
It's sum(r! * nCr), actually, and wikipedia has that one.
 
@R.MartinhoFernandes I learned it as k "over" n, I think
 
There are nCr subsets of size r, and each has r! permutations.
 
@R.MartinhoFernandes Is there a page for that?
 
Summation is the operation of adding a sequence of numbers; the result is their sum or total. If numbers are added sequentially from left to right, any intermediate result is a partial sum, prefix sum, or running total of the summation. The numbers to be summed (called addends, or sometimes summands) may be integers, rational numbers, real numbers, or complex numbers. Besides numbers, other types of values can be added as well: vectors, matrices, polynomials and, in general, elements of any additive group (or even monoid). For finite sequences of such elements, summation always produces a...
 
Aw, just the formula. I was curious about that e.
 
Xeo
11:45 PM
0
A: Is anybody using monadic bind-style programming with Expected<T>

user239558Answering my own question to give some more information and document my experiment: I mutilated Expected<T>. What I did was rename get() to thenReturn() to discourage its use through naming. I renamed the whole thing either<T>. And then I added the then(...) function. I don't thin...

Not sure what to think here.
 
See, everyone wants do-notation!
Judging by the amount of half-assed attempts I see, I mean.
 
@Xeo Another one for the Stroustrup quote !
 
Xeo
@sehe lol
@sehe Btw, as I said, I really think I can't just stop halfway with the lifting.
 
I only have fmap for e.g. optional, not bind. Don't see the point.
 
Xeo
So I don't know if that quote really applies to my proposal. :/
 
user142019
11:48 PM
0
A: Operator overloading in C

Bill PringlemeirYou need a time machine to take you back to 1985, so that you may use the program CFront. It appears that C use to support operator overloading; to the sophisticated enough it still can. See Inside the C++ Object Model by Stanley B. Lippman. OMG, C++ was C! Such a thing still exists.

 
Xeo
@LucDanton fmap was what exactly again?
 
user142019
lol Cfront
 
Chased by a plane
 
@Xeo fmap :: Functor f => (a -> b) -> (f a -> f b)
 
@Xeo Nah. If your proposal is for language support for Poly Lambdas (the pythy thing) then obviously it didn't apply
 
11:50 PM
0
A: Operator overloading in C

user2159417no there is no operator overloading in c , it is only supported in c++

Better late than nothing (3 years later)
 
Xeo
@sehe It's orthogonal to polymorphic lambdas, really.
I'm talking about capturing existing overload sets, not creating new functions or anything.
 
@Xeo Ah. Sorry for being blatantly uninformed about your investments... :(
 
@sehe Given, void f(int); void f(double);, what is the type of &f?
 
@Xeo That's very nice too. I could use that indeed. Phoenix could :)
@R.MartinhoFernandes Thanks for the handy sample :-)
 
Xeo
20 mins ago, by Xeo
@sehe Never tried to pass an overloaded or templated function to std::bind? Or some Phoenix thing? Or to anything that is templated on that argument?
HA!
 
11:53 PM
@Xeo Could have implied full blown pythy syntax just the same:)
 
because, that would trivially wrap an overload set, in fact creating a polymorphic functor, as I'd create it right now, only without the plumbing?
 
Xeo
@R.MartinhoFernandes Hm.. doesn't that use bind internally for, say, Maybe? fmap f = \a -> a >>= f?
 
@Xeo It's a weaker operation than bind. You can describe it in terms of bind, but not vice versa.
 
Xeo
Ah, k
 
11:54 PM
fmap f = (>>= return . f) -- that return makes all the difference in the world
 
You can describe bind in terms of fmap and join.
 
Xeo
@LucDanton Right, the original f doesn't know about the Functor.
 
@Xeo Yup. That's usually phrased in the style of 'f can't change the shape/context of the value'.
 
Oops.
flip (>>=) = (join .). fmap
Or something.
Might need more dots. Possibly boobs.
Yeah, needed dots.
(The CT definition of monad is usually in terms of join and fmap instead of bind and return)
 

« first day (880 days earlier)      last day (4083 days later) »