Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
xi
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
xi
16y ago
Care to elaborate?
32.
▲
by
xi
16y ago
I can stringify a list by saying map(str, numbers), because str() happens to be a function that I can map with. But I can’t capitalize a list in that way, because capitalize() is a method. Yes, you can: >>> map(str.capit
33.
▲
by
xi
16y ago
Of course we know what defaulting is. Why is it bad? I wonder who is that we you refer to. Is applicative a Bourbaki-style pseudonym for a group of aspiring Haskell hackers? I never said it is bad, it looks like a useful and convenie
34.
▲
by
xi
16y ago
Try C. Hacking the Python interpreter or making a Python wrapper for a library written in C is a good way to learn C for a Python programmer.
35.
▲
by
xi
16y ago
It's called defaulting : http://www.haskell.org/onlinereport/decls.html#sect4.3.4 In my opinion, though it wasn't me you asked, it's an ugly workaround for Haskell's lack of proper coercion rules.
36.
▲
by
xi
16y ago
I find myself wondering if this is getting upvoted by Haskell contrarians who aren't actually reading the article and noticing that it not about Haskell "being too mathematical", but not being out-of-the-box suitable as a really convenient
37.
▲
by
xi
16y ago
Syntax. Strict indentation rules do not allow using a block of code in an expression.
38.
▲
by
xi
16y ago
Even assuming independence from the debug output, `putStrLn` may fail or block, which breaks referential transparency.
39.
▲
by
xi
16y ago
I'm not arguing that there are no ways to debug Haskell programs. My point was that the OP's phrase indicates at least basic familiarity with Haskell and debug printing might be the thing he had in mind writing it. Haskell's not like othe
40.
▲
by
xi
16y ago
You can't inject 'print' or 'printStrLn' into a random function, which is the point of debug printing. And using 'Debug.Trace' qualifies perfectly as subverting Haskell's type system .
41.
▲
by
xi
16y ago
I disagree. For instance, debug printing is a very common pattern in many languages.
42.
▲
by
xi
16y ago
When somebody tosses around phrases like how to subvert Haskell's type system to accomplish basic shit you can do in other languages, it's a big red flag that they've never used Haskell, and possibly have never even seen Haskell code. IMO
43.
▲
by
xi
16y ago
Just like semantic indentation, ":" is ABC's heritage. It was discovered that newbie programmers comprehend block operations better when they end with ":". http://python-history.blogspot.com/2009/02/early-language-de...
44.
▲
by
xi
16y ago
2.7 is the last major release of the 2.x series. The goal was to ease transition to 3.x by backporting some of the features and provide a stable base for people unable or unwilling to jump to 3.x.
45.
▲
Why Python3 breaks Python2 code
(mail.python.org)
2 points
by
xi
16y ago
|
0 comments
46.
▲
by
xi
16y ago
I wonder how Clojure deals with ambiguities when dispatching by arbitrary predicates. Also in this case, the overhead of of generic call will grow linearly with the number of methods, right? In Python, you could limit generic dispatch to a
47.
▲
by
xi
16y ago
Multi-methods are not overloaded functions (in the C++ sense). You are correct that overloaded function calls are resolved at compile-time while multi-method calls are resolved at runtime, but if you want to make a C++ analogy, you'd bette
48.
▲
by
xi
16y ago
We could also notice that UW+VW is a subspace of (U+V)W, and therefore the following statement is valid: dim(U+V+W)<= dim(U)+dim(V)+dim(W) - dim(UV)-dim(UW)-dim(VW) + dim(UVW). So the result is weakened, but not entirely lost.
49.
▲
by
xi
16y ago
It is explained in the comments: take three different lines in the plane, and you'll get 2=3.
50.
▲
by
xi
16y ago
Python is as strongly typed as Scheme; 1+"1" will produce an exception in Python.