skysight-inc/HackerNews huggingface dataset:
Would someone please explain what a monad is and why they're useful, in down-to-Earth, simple language that an engineer can appreciate?

I know (and use) basically every other CS concept. Monads, though, I've never bothered looking into, because it seems like everyone who talks about them can't resist the urge to use flowery descriptions of their possibilities, rather than examples of their pragmatism.

Also, it's suspicious that pg has never once mentioned monads: https://www.google.com/search?q=site%3Apaulgraham.com%20%22m...

If they're useful, you'd think one of the best hackers would have said something about it. He spent a good deal of his career talking about closures, types, objects, functions, computing theory, lambda calculus, etc. But no monads.

So, are they useful? Would anyone please give examples of their usefulness?

EDIT: You know what's worse than hero worship? Not being able to make a reasonable argument which uses someone as an example without being accused of hero worship.
I'll start using it.
You are misunderstanding the physics. Suppose A and B are two quantum entities that result from a collision. They are entangled and moving away from each other. The math very clearly says that a modification of A's state will alter B's state after the time of collision. In fact, it must do so, since A and B do not have separate states. Their states are the same one little chunk of math.

This even works if the states are known! This is how quantum cryptography works. You put two particles into Bell state with each other, give one to someone else, and then decide later what message you want to send.

I recommend learning the math. It is pretty simple if you already have linear algebra.
It's listed on this page (about 2/3rds of the way down):

http://prepaid-phones.t-mobile.com/prepaid-plans

I believe you have to buy the SIM card and then go to this page to pick your plan:

http://prepaid-phones.t-mobile.com/prepaid-activate
Yes, spam links in part about kernel memory allocator.
This could be titled "Why I Am Content With A Mediocre Life and Why You (Probably) Are Too."

Fighting for a product I believe in. Developing a product I'm passionate about. Late nights of creative problem solving in my code that will directly effect our success. Owning what I build. The chance to win. And the risk, for me, is part of the thrill.

Compared to all this, the loss in terms of steady income from a corporate job is nothing.
You clearly have no concept of how trademarks work or even what they are, and your callous attitude toward them is not only going to get you into legal trouble, but is incredibly antagonistic and off-putting. I'm not sure what you were expecting to get out of making this and posting it on HN, but you will find that your attitude has done nothing but garner you a lot of ill will in a community that you were clearly trying to impress (and have failed spectacularly at doing so).
Look at "Which plan is right for you" on their pre-paid site: http://prepaid-phones.t-mobile.com/prepaid-plans
Programming languages are not natural languages. And where imperative programming can benefit from something that looks like a series of instructions resembling natural language, functional, declarative programming works better with the language being closer to mathematical notation.
>That will take some time.

Sorry, but isn't that fundamentally impossible?
It's called "bind". Here's how to memroize that:

One Type to rule them all, One Type to find them,
One Type to bring them all and in the Lambda >>= them
Ask HN: Do you use WolframAlpha to analyze your data files?
WolframAlpha has data input and file uploads as a paid feature (http://www.wolframalpha.com/examples/FileUpload.html). It auto analyzes your spreadsheets and text files. The question is, do you use find it useful ?
Anatomy of a failed rendition
Conference on “Hype in Science” today
NASA doesn't seem to think so:

https://news.ycombinator.com/item?id=4534359

https://news.ycombinator.com/item?id=6238297

but the OP is talking about traveling forward through time by going near light speed, which isn't really relevant to a warp drive.
Seeing as how we're talking about a relative increase in difficulty, I'm not sure what we're supposed to take away from a single data point?

You can see here[1] that this decade has brought on a distinct change in unemployment rates for college graduates. The last four years averaged an entire percentage point higher than the highest rate ever seen before. Since we both seem to agree that unemployment rates are a reasonable metric for determining the difficulty of finding work, it seems pretty clear that it is more difficult now as a college graduate than it once was.

[1] http://qzprod.files.wordpress.com/2013/04/screen-shot-2013-0...
> We already can travel to the future.

And we're doing it all the time.
You seem to, maybe fairly, denigrate startups and industry in general as well as academia.

What should an intelligent person do? What did you settle on? What advice would you give to young people?
They're a very simple abstract interface that happens to capture a surprisingly large class of data structures and computations. You need to implement two operations to make a monad: (1) take a normal value and put it in the monad (2) add a function to the pipeline of stuff being performed on the monad. If your language gives special syntax for these two functions, then you get to write generic code that does lots of different but related things depending on which monad that code gets called with. So, monads are just a handy and often-occurring interface. There's not a ton to understand here conceptually, you just use them and get used to the abstraction.

edit: pg likes dynamic languages, monads don't pop up there as much. They're more useful when you (1) you have special syntax for them and (2) the type system helps you keep track of what code is not in a monad, generically using any monad, or using one particular monad. So, you'll typically only see monads in expressive/high-level static languages
If I can't talk to you about it (e.g. I have to literally say "Oh, you forgot to declare a way to apply the greater than-greater-than-equal operator!"), it's hard to actually reason about a problem domain. It's like the magic moment where you go from stumbling through cryptic signs to being able to fluently read (aloud) complex math or logic formulas. I doesn't need to resolve to a normal, casual sentence you'd drop chatting with your cab driver - but there should be a way to pronounce it.

P.S.: I guess what I'm trying to say is - every normal mathematical expression has a way to pronounce it. "plus", "for all x", "there exists an x", "sum of", "element of", ...
According to our current knowledge, it is impossible. However that knowledge may be incomplete or incorrect, both of which is very likely.
Warning. I think I'm right with these things but I'm also very new to Haskell

> How is "m >>= f" pronounced?

If I'm not mistaken ">>=" is the bind function and could be written like:

bind m f

Meaning that "m >>= f" is pronounced as "bind m to f". What it's doing is:

main = do
m <- SomeActionReturningMonad
f m

Are you saying that a language that uses symbols isn't a language? Is Japanese a language since it uses symbols (glyphs? correct me if I'm wrong).

If you are talking about programming languages specifically, do you believe that "plus" should be used in place of "+"? Now I'm not going to get absurd and assume you mean using "parenthesis_start" in place of "(", but just in case... I will ask if you are.

Also, in Haskell specifically there are matching functions for those.
> In functional programming, a monad is a structure that represents computations defined as sequences of steps. A type with a monad structure defines what it means to chain operations, or nest functions of that type together. This allows the programmer to build pipelines that process data in steps, in which each action is decorated with additional processing rules provided by the monad. As such, monads have been described as "programmable semicolons"; a semicolon is the operator used to chain together individual statements in many imperative programming languages, thus the expression implies that extra code will be executed between the statements in the pipeline. Monads have also been explained with a physical metaphor as assembly lines, where a conveyor belt transports data between functional units that transform it one step at a time. They can also be seen as a functional design pattern to build generic types.

http://en.wikipedia.org/wiki/Monad_(functional_programming)
Oh God. You just described my life last year.

I'm taking a bunch less coursework this semester, and then I find out I need 30 points coursework to finish my MSc instead of 18. I would have been done with 18 this semester. I have to publish a thesis either way; it's a matter of whether they accept a non-Technion four-year-degree as a four-year degree or a three-year degree. I hate these anal, bureaucratic requirements; I just want to concentrate on research and in-depth issues rather than continually taking courses!

I just want to add one more issue:

4) In both teaching/coursework and research, academia is extremely detail-obsessed, constantly burrowing away from larger, important questions towards small, easily-answerable ones. For a good example, look at how many different kinds of differential equations the average engineering major at a really good university is required to learn to solve, and then check how often they actually solve those equations in either original research or in their jobs. Sometimes, yes, they do, but enough to justify having two or three distinct courses in just differential equations versus, say, a single full course in fundamental statistics? Oh, but there are a thousand different approaches to statistics!

The result is a system that, seen from the outside, appears to be trying to actively avoid tackling truly major scientific problems. Sure, it can give you a seminar on the latest approach to convex optimization problems or pure subtyping theories, but ask us what problems these solve and we academics will look at you sort of blankly.
this is very well covered. its trivial to search for sources yourself.

as for the lying part: check the timeline

https://en.wikipedia.org/wiki/Timeline_of_the_Fukushima_I_nu...
Why don't we just take this sidebar to Tele's native tongue, Mongolian?
What? All peers receive all messages from everyone. There is no distinguishing senders and receivers.
>I'm just saying that a C&D letter doesn't scare me.

Most hosting companies won't share your bravado.

>Y'all should read Vine's Terms of Service. I did.

>All right, title, and interest in and to the Services (excluding Content provided by users) are and will remain the exclusive property of Vine and its licensors. The Services are protected by copyright, trademark, and other laws of both the United States and foreign countries. Vine reserves all rights not expressly granted in these Terms.

Hm.
Regenerative braking http://en.wikipedia.org/wiki/Regenerative_brake is a mainstay of modern electric cars. They all do this.
It's not 4G though... If you want 4G, it's at least $50, $60 or more for more data.
I think of it this way, I dunno if that is the right way.

Programs should be these beautiful mathematical models that describe things - stick something in, get something out. Stick the same thing each time and get the same thing out each time.

Unfortunately to be useful programs have to be allowed to deal with messy stuff that can have side effects or some other ugly situation, or read input from a user or other programs.

You use monads to be explicit about where your program is messy and where it is isn't messy.

That can be stuff like IO, or stuff like Maybe (I dunno if what I'm getting here will even have a result - if it does, then it'll be Just (the result) otherwise it'll be Nothing) but the point is there is some messiness in there and you want to know there is messiness, otherwise you dont know what parts of your programs have messiness in them.

Perhaps you can think of them as atomic actions in concurrent programming? You declare something as atomic because you want to know the stuff inside the atom at least won't be affected by the rest of the concurrent messiness, so you can think about the pieces inside it as a non-concurrent piece.
Haven't Einstein, Hawking, and others made statements that the only indications that time travel is impossible are the issues of time paradoxes and because we haven't seen any evidence of time travelers? I thought besides those issues, they felt it should be theoretically possible?
> How is 'm >>= f' pronounced?

How do you pronounce '4 + 5'? It's easy, because you don't try to pronounce '+', you pronounce 'plus'. With '>>=', there are a few names that all mean the same thing.

There are two primary names, 'bind' and 'chain', and a description 'feed':

bind (the result of) m to (the input of) f

chain (the result of) m into f

feed m to f

There are probably a couple more things that can be said, in different contexts, but these three cover the majority use case.
E-bikes seem to be everywhere these days (in western europe). Even grandparents I know have been talking about getting them. http://en.wikipedia.org/wiki/Electric_bicycle
Google is not in business of making money with selling hardware like Apple and Samsung. Google is selling a platform, and then makes money from people using it.
You wouldn't have to say "Oh, you forgot to declare a way to apply the greater than-greater-than-equal operator!", you would say "Oh, you forgot to declare a way to apply the bind operator!". Now that you know that, you can stop saying that ">>=" doesn't have a name? You are upsetting poor bind :/

Also here is a great explanation with pictures that helped me understand it:

http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...
Oh, I agree completely! But I suspect the sorts of people who found and fund companies like Demand Media might have more of an "as long as I get paid, everyone else can just go fuck themselves" attitude.

So, yeah, I meant "epic win" from that standpoint. "Fail" from most other standpoints...
here in australia, decades of research and policy development have hit upon a world-class solution to the nuclear waste challenge.

We're building a road in a semi-arid remote location, on the traditional lands of a small, disemowered, remote indigenous community. At the end of the road, we plan to build a shed with a barbed wire fence. In return for this inconvenience, the local community will see employment opportunities (2 security guards) and compensation (scholarships for their children).

this standard of excellence is possible when you have a society that tolerates institutionalised inequity and cultural genocide, and apartheid style laws that target particular races. None of this should surprise, as this is the same spirit in which a large portion of the world's uranium is mined on traditional lands in Australia.
http://www.sbs.com.au/news/article/2013/12/08/calls-ranger-u...
>if you haven't noticed, that post is obviously about devices and management pre Google acquisition

You think they just scrapped everything and started over after the acquisition?
I recently read an article at the Harvard Business review that very much proves why Demand Media didn't last.

It's called "Three Rules for Making a Company Great."

The first rule is:

1. Better before cheaper

Demand Media severely violated rule number 1. They were all about cheaper before better. Their entire business model seemed to be about producing as much low quality content as possible. No wonder Google wanted to penalize them.

Think about this: If Demand has built their empire on producing super-high-quality articles, they would have had Google as an ally, instead of a threat. Google would have done what it takes to make sure they stuck around. Because Google wants high quality content. Instead, they abused Google's search engine, generating as much content as they could -- with very little focus on quality.

It is fortunate that many companies today are focusing on quality first. The fate of Demand Media is a good lesson for us all.

If we want to build something that lasts, we'll have a much easier time if we're building something that people actually want to stick around.

Who thinks the "content" produced by Demand Media is worth fighting for?

Their investors. Anyone else? I highly doubt it.

http://hbr.org/2013/04/three-rules-for-making-a-company-trul...
Ok. So if I understand correctly, I could give a monad an open file descriptor to "numbers.txt" as its value, along with a "read line" function and a "convert string to int" function, and I'd get back a list of numbers?
Show HN: tmprtr - a minimalist location-based weather app
"Don't build a business that churns out garbage by treating workers like shit"
This makes me think we will see cloud flare get acquired in the next 12 months.
Is the job market for entry-level web developers with no CS/BS degree pretty poor like in th US and Canada? I'm Canadian and hold a BA. I've just started doing web development and I'm interested in taking advantage of my visa options.
My experience as an electrician is that there's work available even for completely green newbies who don't know anything useful, and once you've worked for a few years and become a registered tradesman you're pretty much sorted for life.

I'm not sure where you're getting these anecdotes about poor pay, high risk of injury, short careers and unstable employment. Most of the guys I work with have had long careers (often with a single employer for 10-20 years) and haven't sustained any serious injuries. The ones who don't want to take on management roles get paid very well even though they're 'just' highly skilled tradesmen, and the ones who want to go further run their own companies and are doing very well for themselves.

Ironically, I actually terminated my career as a software developer because I was developing RSI and found the work rather unsatisfying (despite really enjoying programming work in general). Working as a tradesman has so far proven to be far more satisfying and far better for my health - plus it leaves me free to work on my own projects after hours rather than forcing me to leave them unfinished since I already spent a full day working inside.
Modern Open Source LMS
Here's the simplest reason in a sentence:

We want to write functions that don't involve IO (which we call "pure functions"), but we want to be able to use these functions on values that have been tainted by IO.

Ex.

The function abs takes an Int and returns its absolute value. No IO there; it takes an Int and returns an Int. However, in a pure language like Haskell, an integer that has been obtained through IO is of type "IO Int". Because Haskell is a pure language, we see that value as "tainted" by IO; it any anything derived from it are irreversibly tainted. A monad lets us pull the Int out of the IO context, get its absolute value with abs, and then stick that back into the IO context. That way, IO-tainted stuff keeps its label warning us that it's IO-tainted, but we can still use pure functions on it. This is necessary because if abs returned an IO Int, we wouldn't know whether or not abs does IO. That's to say, we couldn't get pure values back when we process pure values with abs.

This can be done for any "context", but IO was the most pressing one, and monads are what made IO in pure languages easy enough for them to be usable for everyday problems.

Also, the Paul Graham worship here is pretty bad, but being suspicious of something just because he hasn't mentioned it in an article is really bad.
Anyone got any solutions for cabal hell? I barely use Haskell because 50%+ of everything I try to install fails and I don’t have a freaking clue how to fix it.
I will wait for a blog post with pretty graphs.
Since 1 million light years in 14 years is way faster than the speed of light, and relativity doesn't allow you to exceed the speed of light by acceleration, clearly this is something other than regular old F=ma "acceleration".

Additionally, the fact that we don't see things 14 light years away accelerating to a million light years away very quickly, despite being under a constant 1 gee acceleration, would seem to indicate that this is not what actually happens.

Putting numbers into equations and getting other numbers out doesn't mean anything by itself. I can use the standard d = 1/2at^2 equation to "demonstrate" that combining one apple and three tangerines produces 4.5 dandelions, and you would get the same result putting those numbers into the equation, but it doesn't mean the exercise makes any sense.

I will be honest: I don't understand enough about physics to point out exactly what is wrong with the proposed theory. But I understand enough to realize that it is very wrong, and point out some obvious flaws.

Finally, since the equations are well understood, if this really does explain "dark energy" then it should be possible to put in real-world numbers for things like the gravitational field of the Earth and get numbers out for the accelerating expansion of the universe which match real-world observations? Has the author actually done this and compared the results with observations? I can see no indication of this, even though it should be an easy exercise. This is another major indication that this is all nonsense, if it is in fact the case that this analysis has not been done.
No, see below, I just think that if you write something is "easy to understand" and then you go on and explain it using unknown (to the reader) symbols without given the symbols pronounceable names, you're doing it wrong. One of the tricks that helped me most when learning more advanced math was to learn "reading"/"pronouncing" formulas first and understanding them second. It feels very nice and intuitive. That's why I'm always annoyed when people explain something using very domain-specific symbols and don't provide any way to "read" them.
I've always found it puzzling that many businesses believe that if they can't fill a job, it can't be because they're offering too low a wage - they invariably say the pay is fair.

If went around trying to buy bread at what I thought was a fair price, and found no takers, my immediate reaction would not be "Well, bakers just don't want to work hard."
I can understand that he is pissed off..but that much?

Nej, that's just a sensationalist cliffhanger.
JobTeleport- Get paid what you're worth, $10,000 bonus from the marketplace
You're right, I'm mistaken. 3400 PSI on our high pressure steel tanks. You can tell it's been a while since we dove a lot =P
> if you provided same value in the process. I am sure the founders and early investers did well and they still have a business valued at a quarter billion!

Because that is the only reason to start a company
It's a solved problem. Dilute it with sand until it is about as radioactive as the original ore, melt the sand, and dump the chunks of glass someplace out of the way. Yes, future generations will need to protect themselves from it, but they already need to in huge areas where the ground emits radon.
Use the new sandboxing feature of cabal: http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
Bitcoin network is over 256 times more powerful than the 500 supercomputers
To be fair to him (and co-discoverer/recipient Robin Warren), it's one thing to notice something; another thing to prove it. And he proved it by drinking the bacteria himself.
[ An interesting criticism of modern science is that by demanding proof, it rejects all truths that are not proven. ]

Cancer may be similar, though I suspect it's a syndrome i.e. not a single cause and cure; but many causes, and therefore many treatments.