News for hackers. Stuff that matters.
Re:Everyday hassles in Go by nine_k on Tuesday December 30, 2014 @03:16PM (#8816498)
Did you ever work with a list? Did you ever do things like

   foo = [bar(x) for x in quux]
Or did you ever flatten a nested list?

Congratulations, you've been using one of the most widespread monads.

Monads are not artificial constructs. Monads, like functions, or loops, or conditional statements, emerge naturally when you try to describe a computation, even a simple one. This is like speaking prose without knowing that.

Re:Everyday hassles in Go by dllthomas on Sunday January 04, 2015 @03:31PM (#8835703)

    foo = [bar(x) for x in quux]
This is effectively a map, so it's strange to call it "using monads". "Using functors" would be more accurate.

You can get "monad" out of list comprehensions though, when you have multiple "for" clauses.

    foo = [y for x in quux for y in bar(x)]
seems equivalent to foo = quux >>= bar
Re:Everyday hassles in Go by AnimalMuppet on Tuesday December 30, 2014 @03:31PM (#8816578)
No, actually, I don't do things like that (see my parallel reply to codygman).

The Haskell types often seem to think that the computing they do is the same as the computing that everybody else does, and therefore that the problems that they want to solve are the ones that everybody else wants to solve. That's not a very accurate assumption.

Re:Everyday hassles in Go by codygman on Tuesday December 30, 2014 @06:13PM (#8817289)
> The Haskell types often seem to think that the computing they do is the same as the computing that everybody else does

Seeing as Haskell is used for general computing (including embedded software) the computing is the same. I know what you ate getting at, but I don't think it is based on facts or anything rational.

Re:Everyday hassles in Go by nine_k on Tuesday December 30, 2014 @05:27PM (#8817093)
Just for reference: what are the kinds of problems you solve?

Note that the code I quoted above is Python, and I have lots of stuff like that in my mundane production code (processing files, tracking transactions, counting money, etc).