« first day (1686 days earlier)      last day (3267 days later) » 

1:00 PM
what's gained by throwing instead of returning a wrapped value
@Ven creating types. Focus on that.
 
@R.MartinhoFernandes …I’ve never really used those save for some environmentalism fun I guess :s never heard of anything worthwhile to do with them either, unlike e.g. State Property watermills
 
Ven
control flow.
 
Good. Then there is no bug. Weekend! — sehe just now
Oh wait. Probably not constructive
 
Ven
Ruby both has "throw" and "raise".
you have "catch" and "rescue"
 
@BartekBanachewicz What do you gain by returning a wrapped value instead of throwing?
 
1:00 PM
@Jefffrey Monads are more flexible carrier of exception data that some implicit IO magic
you gain an explicit, clear, well defined paths of both error and success paths
 
@R.MartinhoFernandes Yeah. I should clarify that I’m really looking for the first few turns lol, I don’t remember anything save for worker first. But since I’m coastal with 3 seafood, I’m thinking warrior is the normal alternative?
 
@LucDanton Oh. I'm stupid. I meant watermills. Rivers are irrelevant for windmills.
 
Ven
that's a bit like a labeled if. you can break out of it (with throw). whereas for ruby exceptions, you need to raise(+rescue)
 
I want donuts
 
bah! You can define more than just "error" and "success"
 
1:01 PM
@Jefffrey It'll look more like Haskell. And remind him of purity and virginity
 
@R.MartinhoFernandes :D boy do I just love watermills
 
@BartekBanachewicz And you don't have that with try and catch blocks?
 
My fucking word, the effort I have to put in for the team responsible for the CI systems to look into why the CI system sporadically fails and blocks us.
 
@sehe he he
 
@BartekBanachewicz ITT Bartek again astounding the onlookers by suggesting something other than "Black" and "White"... WOW
2
 
1:02 PM
lol
 
@LucDanton Do you have Scout or Warrior?
 
Warrior
 
Also Ruby does not have the same support for monads as Haskell does.
 
@Jefffrey try/catch blocks formalize and lock you in one possible monad context.
 
I have no idea what that means.
 
Ven
1:02 PM
@BartekBanachewicz just always use the Error monad, right
you can't monad transform out of try/catch!
 
@Jefffrey Try-catch forms an implicit monad added to every one of your functions you have no control on.
 
yesterday, by Luc Danton
@buttifulbuttefly Also it used to be ErrorT, now deprecated.
 
that's how you can describe the whole mechanism
 
@LucDanton I usually let my city grow to 3~5 before getting the first food-based unit.
 
Ven
@LucDanton I was Ironying
 
1:03 PM
What
How do I have no control on it?
 
How far in that 3~5 interval depends on how fast it grows.
 
@Jefffrey Can you restrict a function from throwing exceptions?
 
@BartekBanachewicz noexcept :G
 
@nabijaczleweli we're talking about ruby.
 
Ven
@rightfold <eli-se> the one clip where they're on a ven.
fuck off pls
 
1:04 PM
@BartekBanachewicz Sure, I can catch all exceptions and ignore them inside the function.
 
Say, if it's a floodplains thing, you can get a 5pop city really really fast.
 
Don't know why you would do that, though.
 
@BartekBanachewicz I know.
 
@Jefffrey no, that's not what I asked. Can you, say, create a higher order function that can only accept a function that won't throw?
 
@Ven Sure but do it with the up-to-date API!
 
1:05 PM
what you said isn't teaching your child not to shit in public. It's saying "but I can clean up afterwards"
 
user1804599
@Ven :[
 
No because Ruby does not have strong typing. But I can take any function and then catch any possible exceptions from that function and ignore them.
 
wrapping a child in a giant bubble doesn't change the fact that it, well, shat itself
 
Ven
@rightfold hatsuney doesn't want me to bully you. she doesn't realize you're the one talking about ven diagram.
 
@Jefffrey and that's why I mentioned you have no control over that monad.
 
Ven
1:06 PM
ruby has strong typing
 
you can only accept the results it produces
 
Ven
what are you on about? use you're types' good
 
Your metaphors are disturbing.
@BartekBanachewicz What does that even mean in the programming context?
 
@Jefffrey I like my functions to return where I tell them to, not to put the data in some arbitrary global location.
 
Ven
Ruby has strong typing, as demonstrated in this video.
 
1:07 PM
@BartekBanachewicz Then use Haskell.
 
Ven
(no, but seriously – it's a fun video, please watch it)
 
As I said Ruby and Haskell are different beasts. Very different.
 
Ven
@BartekBanachewicz you must not like continuations
 
@Ven Just by looking the link I know I've watched it.
 
@Jefffrey My point is that it's hardly specific to Haskell.
 
1:08 PM
It's probably the "Wat" video or anyone from that guy. And I've watched them all.
 
Ven
@Jefffrey well! then you should know ruby is strongly typed :)
 
I just believe this model is better for pretty much any use.
 
Ven
Yes, it's from gary berndhat... or whatever is his name
 
Yeah, very strongly typed.
 
Ven
garybernhardt
 
1:09 PM
Even for an imperative language.
 
@LucDanton So, yeah, first few turns I set non-food-based unit (Warrior, usually) to let the city grow a bit, and set the science path to enable Slavery (Bronze Working, IIRC).
 
@BartekBanachewicz I don't think so, no.
 
wow unity's webgl stuff actually seems to work instead of crashing firefox now
 
I personally think Slavery is way too good to open with anything else.
 
Ven
just make break and continue throw control exceptions if they're not in a lexically-visible loop (with functions as a lexical breaking point), to allow for dynamically scoped break/continue/etc!
(just like in perl6)
 
1:10 PM
@Jefffrey That doesn't justify ruby choices at all. That just says they are different. What haskell chose I consider better because it's essentially a superset of what ruby offers. Instead of giving you one monad, haskell gives you tools to create your own, thus giving you more power and more control, while not sacrificing usability.
 
Xeo
@BartekBanachewicz Looks fluffy enough!
I'm still looking for a second kitten. :<
 
Take C++ exception model, with Java like exception specifications, and you have a good model that I think is better in imperative languages.
 
Then for SE, I just beeline for Representation+Caste System. With slave-built Pyramids you can get the combo very very very early on, and that's a huge benefit.
 
@R.MartinhoFernandes Yeah that all sounds familiar. Although buddy showed up online so it’s Age of Wonders III time.
 
@Xeo get this one
 
Ven
1:11 PM
@Jefffrey do you consider checked exceptions to be the superior model? serious q
 
@Jefffrey Why do you think it's better?
 
user1804599
@Ven I don't want you to bully me either.
 
Guys, I want to conduct an experiment
 
@Ven Because they let you specify that "Well, I take a function that will not throw exceptions" or "I can take a function that throws this type of exception" and so on.
 
can someone please upvote this post?
 
Ven
1:12 PM
@rightfold :P like I would ever do that
 
@Jefffrey So you are choosing that because it gives you more control. Why not choose monads then? do notation is imperative and you know that. Why wouldn't it fit an inherently imperative language?
 
If it turns out I have a neighbour that I think will not be friendly, or if I think I'll gain more by not being friendly, I might ignore the Pyramids and skip to the Middle Ages by researching Monarchy + slave-built Oracle => free Feudalism = ass-kicking everyone with Longbowmen.
 
2 million people reached :D
 
user1804599
bbq in partytent
 
user1804599
is that good idea?
 
Ven
1:13 PM
wow
 
@BartekBanachewicz Mainly because imperative languages's functions are usually not a chained sequence of functions in which you can say "Ok, if one returns Nothing or Left _, then everyone else also does. Often times they are series of statements, some of which also simply ignore the return value and just return nothing. And in that case, throwing an exception is better.
 
@R.MartinhoFernandes I knew that Oracle is a hardcore corporation, but slave-built?!
 
> China BeiJing
 
user1804599
or will it melt?
 
probably his flatmates
AYYYYYYYYYYYYYYYYYYYY
 
1:14 PM
> I like third party payment.
wut
 
@BartekBanachewicz In Civ4 pretty much all the early wonders I build are done with Slavery.
 
Ven
@rightfold it won't, steel beams can't do that
 
@R.MartinhoFernandes I normally skimp on the pyramids unless I have stone (that’s a thing right?), representation be damned.
 
And also non-wonders. I just whip the hell out of everyone.
 
@BartekBanachewicz What I know is that we have different meanings for the word "imperative". do notation is neither inherently imperative nor functional.
It's just a notation.
Syntax.
 
1:14 PM
@Jefffrey excuse me?
 
@Mr.kbok cool, COOL
 
@Jefffrey what's your notion of "imperative" then?
 
@R.MartinhoFernandes Wow I thought you were talking about your actual neighbour here
 
Ven
"Haskell is the best imperative language" :)
 
user1804599
@Ven it's a plastic tent, not a steel tent.
 
1:15 PM
@MarcoA. We now have an easy recipe for reaching 10M+ "people reached"
 
Ven
@rightfold ... plastic beams can't melt bbqs.
 
@Mr.kbok s/reached/scammed
that is also valid
 
@Jefffrey Why is it better? In a programmed monad ignoring the result value (or returning ()) can result in the error in the context - that's the point of using monads, no?
 
@BartekBanachewicz It's very hard for me to give a notion of "imperative". I don't care about labelling languages either, so that's almost a given.
 
user1804599
@Ven :v
 
user1804599
1:16 PM
I mean will the tent melt.
 
Ven
@rightfold is your internet fixed btw?
 
user1804599
The BBQ will obviously not melt.
 
user1804599
@Ven Yes!
 
@Jefffrey But on the other hand you were able to firmly define do notation as not imperative.
 
Ven
nice
 
1:17 PM
@BartekBanachewicz It's clearly functional. All about it screams "functions", starting with its definition.
 
@BartekBanachewicz I said that it's not imperative nor functional, as in "It does not adhere to a particular paradigm".
 
user1804599
Meh.
 
imperative (comparative more imperative, superlative most imperative)

 * essential - It is imperative that you come here right now.
 * (grammar) of, or relating to the imperative mood
 * (computing theory) Having a semantics that incorporates mutable variables.
 * Expressing a command; authoritatively or absolutely directive.
 
user1804599
Nothing is functional until you precisely define "functional".
 
user1804599
Nothing is imperative until you precisely define "imperative".
 
1:18 PM
More like anything is
 
@rightfold You can't. And you know it.
 
user1804599
As with "OO" neither of these terms have a definition everybody agrees on.
 
@Jefffrey OK then, answer my other question.
 
user1804599
So whenever talking about them, first give the definition you use.
 
(btw not being able to define something and yet still being sure that something isn't it is a part of definition)
 
1:20 PM
@BartekBanachewicz No idea what "can result in the error in the context" means.
 
over 10k agar.io!
 
10k why
I hit 2k once but I was so bored by then I just fed it all to someone else
 
My boss says thank you for reminding me of agar.io
 
took me 20mins only
np
 
@BartekBanachewicz You know that we both have an intuitive definition of "functional" and "imperative". If you want me to recite that "in functional languages you describe what you want, not how you want to achieve it + higher order functions + etc.." and "in imperative languages you describe the 'recipe' or how you want something accomplished" shit, then you are out of luck.
 
1:22 PM
@Jefffrey It means that the function will return the unit it should (or, in other terms, not return at all), but will result in a change in the context that will alter the behaviour of the program. That's similar to a function throwing an exceptions; exceptions reside in another "dimension".
 
And do notation, is just a notation. I don't know why you want to label it as "functional" or "imperative".
brb
 
Ven
functional programming is programming with values!
 
@Jefffrey Because it clearly implies that the operations specified within it are a series of effectful steps making change in the outer context (IOW sequence of "commands") instead of a composed computation producing one value from another.
 
Ven
except for types and code, obviously. that's dependently typed languages and macro-able ones :P
 
imperative programming is programming with emperors
 
1:24 PM
that's emperative programming
 
@rightfold Wrong. It's like porn.
@BartekBanachewicz Er, but it's totally not the first one and totally the second one. You're thinking of some particular monad, not of do-notation.
 
user1804599
No, functional programming is not like porn.
 
user1804599
Porn is much more satisfying.
 
porn is imperative
 
Ven
depends if you're the one making it or not
 
1:25 PM
"do it"
 
Ven
is porn reactive programming?
 
@R.MartinhoFernandes it's totally writing the second one to make it look like the first one and that's the very point of it
 
Ven
no, porn is extreme programming, duh.
 
@BartekBanachewicz The first one is just not it at all.
 
but as I said well I am not going to argue about do religiously
 
user1804599
1:26 PM
pooorn
 
user1804599
porn to be alive!
 
the other part of the discussion, namely why @Jefffrey thinks that an implicit mechanism of passing exception data behind main code line is better is more interesting
 
lol, Internet.
 
@BartekBanachewicz Well, it appears to me you are not doing that, anyway. You're arguing about something slightly related (some particular monad), and projecting it as do-notation.
 
@Ven it's an agile methodology heavily based on SCROTUM
2
 
user1804599
1:26 PM
You see we're porn, porn, porn, porn to be alive
 
@R.MartinhoFernandes I tried carefully to not think about any particular monad. When I said "effectful" I thought I was general enough.
 
porn programmers tend to do scr(ot)um
 
@BartekBanachewicz It's not general enough.
 
user1804599
Martinho Hernandez
 
do-notation is a notation for representing a particular form of composition.
 
1:27 PM
@R.MartinhoFernandes dang it.
Again I am really not going to hold my ground too much
 
user1804599
[tag:>>=-so-action-composition]
 
Ven
@R.MartinhoFernandes wut? it's a notation for applicating functions
 
I have searched on Google for "latex jedi" to see if there is not some pictogram of Jedi knight that I could use in a LaTeX document. It has found some pretty cute chicks in latex attire with light sabers. :D
 
mostly because I can't even say respond to a Cont or similar example
 
Ven
that's like idiom brackets. it's just function application
 
1:28 PM
@Ven there are no "function calls" in Haskell
:F
 
Ven
application, whatever
 
user1804599
I laugh at people who make distinctions between calls and applications.
 
@Ven and what's applying a function on a result of another function?
 
@Ven Yes, application of a particular function (>>=), which happens to be a kind of composition.
 
Ven
@BartekBanachewicz application.
 
1:29 PM
@Ven it's composition.
let a = f(x)
let b = g(a)

-- can be trivially shortened to
let b = g(f(x))
and in do notation it's return x >>= f >>= g obviously
 
Ven
which can trivially be shortened to (), yay :)
 
@BartekBanachewicz That's not do-notation.
 
@Ven you sound like my analysis professor: "and this 3-pages monster can trivially be solved to x"
 
@R.MartinhoFernandes "and if that statement was written using do notation, it could be alternatively written as ... obviously"
better?
 
@wilx you knew exactly what you were doing.
 
Ven
1:32 PM
@MarcoA. but maybe he isn't just joking
 
user1804599
do expressions don't necessarily use >>=.
 
a <- f x
b <- g a
-- turns into
return x >>= f >>= g

let a = f x
let b = g a
--turns into
g . f $ x
and both can be expressed as x >>> f >>> g IIRC
 
No.
That's not the same as the first one.
You're again thinking of a particular monad (Identity).
 
user1804599
 
1:34 PM
@R.MartinhoFernandes I have to ask you to elaborate.
 
(and {a <- f x; b <- g a} is not actually valid do-notation)
 
needs return and do :P
 
@BartekBanachewicz The first one is only equivalent to the second one if the monad is the identity monad. It's not equivalent for pretty much any other monad.
 
user1804599
Doesn't need return per se.
 
can just remove b binding
 
1:35 PM
Please add to the list of crimes: - Mixing spaces and underscores
 
@R.MartinhoFernandes what kind of "equivalent" are we talking here?
 
Ven
@Mr.kbok ???
 
People create IDs with a mix of spaces and underscores
 
user1804599
> The scapegoat is extinct. Whose fault is that?
 
user1804599
HHAHAHA
 
1:36 PM
> 299496_test Option
 
@BartekBanachewicz Representing the same function (as per extensionality)?
 
user1804599
but you cannot compare functions !!!? !?!?!??!?!
 
@R.MartinhoFernandes Mmm... the first can represent a contextful function
 
It can represent tons of things.
 
and is indeed exactly equivalent if the context is Identity
 
1:38 PM
Contextful or not.
 
user1804599
In Scala you can compare some functions for equality!
 
This context you mention is provided by the monad definition, not by do-notation.
(Hence why I said you're thinking of particular monads)
 
to get things straightened up for a moment
on the scale of 1 to 10 how wrong am I right now
 
0
Q: Compressing unicode strings

user26830I am looking for an algorithm to compress Unicode strings in Swift. The strings I will compress will be relatively small (no more then 160 characters). I found the LZW compression already implemented here. I copy pasted the code which worked well with ASCII characters but as soon as I added some...

lol
 
> If you wish to continue using Ripple Trade to access the Ripple network, Ripple Labs will require you to submit personally identifiable information similar to what you would provide to open a bank account, such as your full name, address, national ID number, date of birth, and possibly a copy of your driver’s license
 
Ven
 
Sorry, got an appointment now.
 
@Ven robot is great at haskell
 
See you later.
 
Ven
@BartekBanachewicz who's robot?
2
 
1:40 PM
I uh
 
Xeo
@R.MartinhoFernandes hf
 
Ven
@BartekBanachewicz that joke.
 
user1804599
lol copying code from rosetta code.
 
Ven
lol rosetting code from copy code
 
user1804599
COPY "CODE.COB"
 
1:43 PM
Backy back.
 
you didn't miss too much
 
@BartekBanachewicz It's not better in absolute. It's better in imperative non-lazy languages.
 
@Ven You're disqualified from this chatroom
 
Ven
@AndyProwl I was never qualified for this chatroom!
 
Ell
is the "Proprtional to" symbol a lowercase alpha?
 
1:44 PM
Also do notation is very functional. It might make the syntax look more imperative (see IO for example), but it's all about function composition.
 
@Jefffrey but why? You keep narrowing that, but I still don't understand the reasons.
 
I would argue that function composition is a trait more of functional languages than imperative languages.
 
@Ven Me neither but knowing who's robot is like 2+2
 
@BartekBanachewicz I keep narrowing what? I've told from the beginning that I was talking about exceptions being better in imperative languages.
 
@Jefffrey and I still don't understand why you think that
 
1:45 PM
Clearly exceptions are not better in, say, Haskell.
 
Xeo
@AndyProwl Improwlstor Syndrome.
 
Ven
@AndyProwl still no idea.
 
Xeo
The guy who's on his way to a date right now.
 
@BartekBanachewicz Because in many imperative languages monads are not as easy to use as in Haskell.
It's not idiomatic C++, for example, to use operator>>= as "monadic bind".
 
user1804599
> What was the color of your first car? The answer is: car.
 
1:47 PM
@Ven what do you think the "r" in "rmf" stands for?
 
Ven
@Xeo searching for "date" doesn't bring for much interesting stuff
 
Xeo
@Jefffrey Are you relating syntax to what monads are, now?
 
Sure you can. There probably are libraries for that.
 
Ven
@AndyProwl a name.
 
@Ven try again
 
1:47 PM
@Xeo No. You need monadic bind to make monads useful.
 
Ven
I mean, I now know. but that's not obvious
 
Call it >>= or mbind or whatever you want.
 
Xeo
@Jefffrey s/useful/existent/
Monads are defined by bind.
 
@Ven It's not obvious no, but we very often address him as robot here (also notice the avatar)
 
Also I personally like exceptions.
 
1:48 PM
@Xeo lol
 
There is only one Robot, and not knowing who that is, is an offense punishable by expulsion from the Lounge. :P
 
Ven
@AndyProwl I didn't check the avatar closely, so it just looked like hands.
alright.
 
And with proper exception specification you can have just about the same "pro"s you have with monadic errors.
 
Ven
@TonyTheLion where do I get the right to say who's to be kicked from the lounge? :) (except for mods)
 
@Ven now you are admitted in this chatroom
 
1:49 PM
Except that they don't permeate the return value, but rather an explicit separate specification.
 
@Jefffrey So you're basing that off imperative languages not having monads. That's a choice that someone already made. If an imperative language was designed with more flexible contexts, do you think it would also be as unfit?
 
Ven
@AndyProwl I now feel validated :P
 
@Ven Being here long enough might earn you that right.
 
Ven
@TonyTheLion I guess you need to stay a bit longer then :)
 
Notice how I said "might"
 
1:50 PM
@BartekBanachewicz I would prefer exceptions, but I reckon they would be equivalent in that case.
Exceptions vs monadic errors.
 
@Ven I think you underestimate how long I've been in this place
 
@Ven ASSERT_THAT(loungers, testing::Contains(Ven)); // succeeds
 
Assuming proper exception specification.
 
@Jefffrey My point is that monadic contexts would be more flexible. Why would you prefer exceptions in this case?
 
user1804599
1:51 PM
@Jefffrey No! You need join!
 
Ven
@TonyTheLion you think I care? Why make such a fuss of someone not knowing an alternative name :)?
@rightfold it's not join without a monad!
get your applicatives and your functors outta' here =P
 
user1804599
I think monads are like bukkake.
 
@Ven This is The Lounge. Did you expect anything else?
 
@BartekBanachewicz Personal preference. Both solutions would be equivalent. Well, I would argue that if you were to introduce function composition, higher order functions and monads, then your language would probably become functional at that point.
 
Ven
@TonyTheLion I don't expect anything, except being able to chat with people. you don't have the right to take that back :)
 
user1804599
1:52 PM
Higher-order functions are for losers.
 
Monadic errors just require more functional traits than imperative ones.
 
@Jefffrey They wouldn't be equivalent; I believe the monadic solution is inherently more powerful. You don't need to introduce function composition for that, at least not directly
 
@BartekBanachewicz Also I'm much more interested in how you think those are more flexible.
 
I wonder why checking out with svn via the command line is faster than the same thing with tortoise svn
 
@Jefffrey you're essentially the one implementing the exception mechanism then. It's pretty obvious to see that you can do everything that any exceptions do and other things.
 
1:53 PM
@R.MartinhoFernandes any idea yet why find blows up nonius? :D
 
user1804599
torture svn
 
Ven
@AlexM. tortoise's UI freezes all the time :)
 
@Ven You’ll get Applicative into your do notation and you’ll learn to like it!
 
Ven
@melak47 he left
 
@Ven If you think that was much of a fuss, you probably need to stay here a bit longer :D But hey now you're validated so you can
 
1:54 PM
@BartekBanachewicz For example? What can't you do with exceptions that you can do with monads?
 
Guys I've got a little problem and only the Lounge© can save me
 
@Ven he'll still get the message
 
Ven
@AndyProwl nah, nah, definitely. I mean, is the LRiO story a fuss?
 
@Jefffrey as a trivial useless example, you can automatically log the exception when it's thrown.
 
@Rerito Lounge<©++>
 
Ven
1:55 PM
@melak47 definitely! I just meant you shouldn't expect an answer right now :)
 
@melak47 ©/©++
 
@BartekBanachewicz Can I see an example of that?
 
Right, so I've got a function template nested in a class template (so far so good)
 
yo dawg
keep going :P
 
Ven
sorry, just thought of that randomly.
 
1:56 PM
(or rather show us the codez)
 
@Jefffrey I could write it later, but conceptually you could e.g. stack on WriterT and make fail tell
 
I get some specialization of the class template to be compiled in a specific translation unit
 
that has some assumptions made of course
 
@Ven that's my main mode of thought
 
Obviously, the function template is not compiled
 
alternatively if you're in IO (which is a different topic I'm sure you agree) you can just print
 
In another translation unit, I make use of these specializations and the function template
 
take Identity, change fail to do liftIO $ print x; fail x and stack over IO
 
@Rerito I think you're better off either showing some code and/or writing the whole thing in one message
 
Ok, let's get to it then
 
1:57 PM
yep
 
@BartekBanachewicz Wouldn't that be run only when fail is called?
 
user1804599
It's called when x <- y fails to pattern match.
 
@Jefffrey similarly to how an exception would be thrown only when throw is called.
 
Hmm, are you sure?
Looks pretty different to me.
You can return an error state without passing via fail.
That would mean that you are signaling an "error/exception" without logging it.
 
@Jefffrey similarly to how you can return an error state instead of throwing, right?
 
user1804599
1:59 PM
Let it crash.
 

« first day (1686 days earlier)      last day (3267 days later) »