« first day (1156 days earlier)      last day (4018 days later) » 

23:00
I am so bad at combining Monads
it's not even funny
@BartekBanachewicz Better go back to OOP
@Borgleader fuck it
I just need to crunch that in my head
until it clicks
I think I am close
I wish qt used namespaces and snake_case for classes :(
qt::widget
don't use Qt, problem solved
sexy
Xeo
Xeo
23:03
@Jefffrey *cute
@Xeo them punz
Xeo
Xeo
@BartekBanachewicz Where are you hanging?
I can show you a code I have right now in the editor
but you have to promise you won't laugh
I will
23:04
fun :: Writer (Sum Integer) (IO ())
fun = do
		i <- getLine

		if null i then return ()
		else do
				let x = readInt i
				tell (Sum x)
				fun
too advanced, I could follow only up to fun ::
rather obvious what that should do, I guess.
@Jefffrey ...
after that I can only guess
@Jefffrey so guess, what I want it to do?
let's see
Xeo
Xeo
23:07
@BartekBanachewicz WriterT?
There are transformers for doing exactly that
you read a line (probably from an input stream) into i, if null you don't do shit, otherwise you read another int and print the sum?
@Xeo aha, so they do that.
no wait
Xeo
Xeo
WriterT Integer IO ()
x is the int version of i
23:08
@Xeo not (Sum Integer)?
Xeo
Xeo
Wait
nvm
Integer is not a monad
it converts i (which is probably of type string or something) and convert it to int
Xeo
Xeo
@CatPlusPlus *monoid
Transformers are applied to monads
Xeo
Xeo
23:09
@BartekBanachewicz I forgot for a second how Writer works
@CatPlusPlus I was talking about the IO part
and then there's a recursion
okey just don't write the solution yet
I guess it just asks for a bunch of numbers and then prints the sum of all of them
@Jefffrey yup. hardcore task.
neat
23:10
btw MonadPlus and guard
Xeo
Xeo
IO is not a MonadPlus, is it?
@CatPlusPlus I want to see the normal WriterT first
A writer monad parameterized by:

w - the output to accumulate.
m - The inner monad.
Xeo
Xeo
Ah, WriterT is a MonadPlus, though. But only if the innter Monad is. So no MonadPlus, eh?
it's awfully complicated for a beginner.
I mention that this is a valid use case for macros (IMO) and this guy is treating me like I'm dumb ._.
23:13
@Rapptz where that = ?
verbose settings
@Jefffrey wait. doesn't Qt use namespaces? That's a fatal flaw to an extent
@Rapptz gun' be hard to convince me that that is a valid use case, yeah
@sehe QNo
QTIL
I wouldn't use it but I think it's valid.
23:16
I see no point against it
tit*
everything is prefixed with Q in Qt.
Qt can use a namespace
oh good
@Rapptz lol look what @jrok did
them hackz
I'd never think about it
23:18
?
oh wait you can't :((
he deleted it
lol dietmar had the same answer.
at least the bool made sense :s
Xeo
Xeo
What question are you guys talking about?
-2
Q: In c++ how to avoid print message when I use function which has cout?

RdouIf i have two functions A and B, A will print message when we use A. B will use A, but when I use B, I do not want to print anything. How can I do this? double CTriangle::perimeter() const{ double D = Distance(A, B) + Distance(A, C) + Distance(B, C); cout << "Perimeter of this triangle i...

Xeo
Xeo
You could also set the streambuf to nullptr, I think
23:22
@BartekBanachewicz that's baaaaad.
@Xeo prezoisely
std::ostream(nullptr) does the job
@CatPlusPlus TIL
QTIL*
qt::til
2
actually if I read correctly, you can only get something along the lines of Qt::QWidget which is redundant
99.99% sure Qt not using namespaces is because it's ancient
yes, the "dark ages" when compilers didn't fully support namespaces
23:32
@Rapptz and they like couldn't fix that through all the years?
I wasn't probably even born back then
like, "Qt 5 won't suck because we are actually using stuff that's been in compilers for years!"
@BartekBanachewicz I don't maintain it.
I know they improved in other aspects
like slots can now use lambdas and stuff
rather than the old archaic SIGNAL and SLOT macro
I am just pointing out that for some people "it was created long ago" isn't an argument.
the signal and slot system uses templates and lambdas now, instead of macros
then you talk, mr i-know-everything-guy
23:35
@BartekBanachewicz well, I'm just pointing out that they probably didn't consider namespaces a big enough issue, truthfully it isn't. I mean prefixing is dumb but it's not terrible. I doubt there will be name clashes with the Qt stuff.
@Jefffrey what
It is an argument, because backwards compatibility is a thing
@BartekBanachewicz i was talking to rapptz
Qt 5 is not entirely backwards compatible
I actually don't know of many breaking changes made to Qt lol
23:35
and changing from QtStuff to qt::Stuff is a trivial search and replace
I read tutorials from like 1999 that had the same class names and stuff.
@BartekBanachewicz in my experience that doesn't work too well
Namespaces were added in 4.4
Qt current namespaces suck
23:37
You just cannot make it a default because of API and ABI issues
ICU is not using namespaces by default because of that also
let's be fair here: icu4cpp just has a terrible, terrible design.
if I were them, I'd do a breaking change and just overhaul the whole interface.
@CatPlusPlus what issues?
Very fun issues
@Jefffrey Well, for example, the mangled name of QtStuff != the mangled name of Qt::Stuff.
Keeping compatibility in C++ is hard enough even without making changes like that deliberately
23:44
Sunday C laugh, (scroll down for 'interesting' logical operation):
http://stackoverflow.com/questions/20600358/multiple-clients-connect-to-server-but-1-client-not-running-properly
that including text file thing would make all this data loading look neater :(
maybe I should do it
@MartinJames good lord... wtf
@Borgleader I was just stunned by the whole lot, "I could't get a multithread sever to work, so i decided to use multiprocess/fork with complex shared memory and semaphores instead". Then there's that &&..&&..&&.. I dare not even start to answer it.
2
Ell
Ell
Sounds like a silly question but why is abi comparability an issue?if you're going to breaking the interface then abi shouldn't matter

« first day (1156 days earlier)      last day (4018 days later) »