216 karma · joined April 28, 2011
map :: [a] -> (a -> b) -> [b]
In an implementation of map with this signature, the only way to get a list of b's is to use the function passed in. So, there's no way to do the array unwrapping shenanigans from the js example.
If you're going to do that, it'd be good to open source it so other people can take advantage of it. Maybe abstract out some other cross browser stuff as well. Also, it would cool if it made the DOM api nicer to work with.
What nonsense.
1) " When you’re just starting out, you need to be dynamic. You need to be flexible. You need to be able to bust out a prototype that just works, and you need to be able to change it on a dime without recompiling your code."
Unlike Perl, PHP, Python, Ruby, any of the Lisps, Lua, etc.? The real reasons js is interesting on the server side is code sharing and node's (flawed) concurrency story.
2) "JavaScript was once the startup of the browser wars, and it crushed Java and Flash for the same reasons that startups have the ability to disrupt markets and displace the established players: agility and flexibility."
Comparing apples to oranges. Also, the term "browser wars" means browser vs. browser, not embedded scripting language vs. plugins.
Also, ifconfig is deprecated.
1) Just 1 >>= \_ -> Just 2
2) Just 1 >>= \_ -> Nothing
3) Just 1 >>= \_ -> Nothing >>= \_ -> Just 2
4) Just 1 >>= \x -> Just(x+1)
5) Nothing >>= \x -> Just(x+1)
6) Just 1 >>= \x -> Just(x+1) >>= \x -> Just(x+1)
7) Just 1 >>= \x -> Just(x+1) >>= \y -> Just(x)
If you can answer all of those correctly, you should have a decent understanding of monads.answers:
1) Just 2
2) Nothing
3) Nothing
4) Just 2
5) Nothing
6) Just 3
7) Just 1Also, the term "trap music" for that electronic music isn't the original trap music either, see http://www.youtube.com/watch?v=GfPjYdef1lg