| 1. | | Staging Servers, Source Control & Deploy Workflows, And Other Stuff (kalzumeus.com) |
| 330 points by revorad on Dec 12, 2010 | 54 comments |
|
| 2. | | The frontpage with a threshold of 100 points (news.ycombinator.com) |
| 256 points by pg on Dec 12, 2010 | 110 comments |
|
| 3. | | What's really wrong with BlackBerry (mobileopportunity.blogspot.com) |
| 248 points by macrael on Dec 12, 2010 | 74 comments |
|
| 4. | | SimpleCDN has been effectively kicked off the Internet by its ISPs w/o warning (simplecdn.com) |
| 125 points by archon810 on Dec 12, 2010 | 86 comments |
|
| 5. | | 10% unemployment yet every startup in NYC struggling to hire (jonsteinberg.com) |
| 116 points by jonsteinberg on Dec 12, 2010 | 178 comments |
|
| 6. | | Why choose Tropo over Twilio (diggz.org) |
| 110 points by blitzo on Dec 12, 2010 | 98 comments |
|
| 7. | | I Miss Lisp (technicat.com) |
| 99 points by DanielRibeiro on Dec 12, 2010 | 66 comments |
|
| 8. | | Ask HN: What is a monad? |
| 100 points by Azuldolphin on Dec 12, 2010 | 43 comments |
|
| 9. | | Wondering if you are getting a CR-48? Look for your zipcode here. (pastie.org) |
| 84 points by peregrine on Dec 12, 2010 | 80 comments |
|
| 10. | | Pornoscanners trivially defeated by pancake-shaped explosives (boingboing.net) |
| 84 points by panarky on Dec 12, 2010 | 36 comments |
|
| |
|
|
| 12. | | Oracle VP: “We have a strategy to run Java inside a Javascript environment” (cemerick.com) |
| 74 points by pepijndevos on Dec 12, 2010 | 55 comments |
|
| 13. | | Sorting Algorithm Animations (sorting-algorithms.com) |
| 69 points by drawkbox on Dec 12, 2010 | 18 comments |
|
| |
|
|
| 15. | | Procedural Building Generation in Unreal Engine 3 (epicgames.com) |
| 65 points by grinich on Dec 12, 2010 | 20 comments |
|
| 16. | | Sam Ruby, Brendan Eich, and Jeremy Ashkenas on CoffeeScript and "JS-next" (intertwingly.net) |
| 65 points by sstephenson on Dec 12, 2010 | 17 comments |
|
| |
|
|
| |
|
|
| 19. | | When Free Software isn't better (mako.cc) |
| 61 points by vu3rdd on Dec 12, 2010 | 45 comments |
|
| 20. | | Show HN: Flattehn: A Chrome extension to hide points / users until you've voted (chrome.google.com) |
| 61 points by Groxx on Dec 12, 2010 | 37 comments |
|
| 21. | | On C Linked Lists (Profiling and Optimizing) (ozlabs.org) |
| 60 points by djcapelis on Dec 12, 2010 | 31 comments |
|
| 22. | | The danger of having system programmers around (utcc.utoronto.ca) |
| 60 points by preek on Dec 12, 2010 | 28 comments |
|
| |
|
|
| 24. | | Original Macintosh Business Plan: July 12, 1981 (computerhistory.org) |
| 58 points by gatsby on Dec 12, 2010 | 11 comments |
|
| |
|
|
| |
|
|
| 27. | | Dieter Rams: Principles For Good Design (vitsoe.com) |
| 54 points by gatsby on Dec 12, 2010 | 14 comments |
|
| 28. | | A Secretive Banking Elite Rules Trading in Derivatives (nytimes.com) |
| 53 points by wallflower on Dec 12, 2010 | 34 comments |
|
| |
|
|
| 30. | | How to Get Started with Bitcoins (pzxc.com) |
| 52 points by pzxc on Dec 12, 2010 | 47 comments |
|
|
| More |
Monads enable syntactic sugar. If you're getting started with Haskell, you'll notice that when you write code that does I/O, you use a weird imperative-looking syntax ("do notation") that looks different to the normal functional style:
'putStrLn "Hello"' doesn't actually print anything; it returns an IO value that, when interpreted by the Haskell runtime, prints something: that interpretation takes place when 'main' is run. The do notation is syntactic sugar for creating a sort of compound IO value that interprets as a bunch of actions rather than just one. The reason you can use do notation for IO but not for (all) other Haskell code is that IO values are monadic (which is another and possibly more useful way of saying "IO is a monad"): that just means that they behave in a certain way when combined (to produce that compound value) and obey certain laws to make the do notation well behaved.Monads are a design pattern to abstract away repetitive functional code. For example, if you write a lot of pure-functional code you sometimes end up having to pass around a 'state' parameter. If a function reads or writes from the state, then any function that calls it has to pass in the state, and so on. This leads to a lot of functions with an extra state parameter, many of which don't even care about the state except to pass it down the call tree. An improvement would be to write a higher-order function which took a function which didn't care about state and wrapped it to produce one that just passed the state through. The State monad encapsulates this wrapping and lets you clean up the rest of your code.
Monads are what's between the lines of an imperative program. Bourne shell scripts have the default error-handling rule that they ignore failing commands unless it's the last one executed, or put another way, they run in a monad that ignores errors:
But you can tell it to run instead in a monad which stops after the first error: Old-school Visual Basic has the opposite default, but you can make it behave like a shell script with "ON ERROR RESUME NEXT". Yes, VB had monads.Monads are a specific example of higher-kinded polymorphism, which is a very powerful and useful concept that's starting to enter the programming mainstream (examples are template concepts in C++ and LINQ in C# and .NET). Parametric polymorphism (List<String> in Java and C#, etc) means you don't have to write a 'reverse' function that works on lists of strings, and another 'reverse' function for lists of ints, etc; you can just write a generic reverse function that works on lists of any kind, because it doesn't need to know the details of the contained type, just how to iterate over a list. However, if you want to reverse an array, you still have to write a new 'reverse'. If your language supports higher-kinded polymorphism, you can write a generic reverse function that works on any kind of container, because all it needs to know is that the container has some well-behaved method of iteration.
(The LINQ example is a bit more subtle, because C# doesn't support higher-kinded polymorphism, but LINQ is a hard-coded exception to that rule. The cool LINQ syntax works for any type which provides certain operations and behaves in a certain way - which just happen to coincide with the requirements for the type to be monadic.)