Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Chattered
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
Chattered
12y ago
Ocaml exceptions are a misnomer, since they are often used as a control flow primitive for non-exceptional circumstances. The point is that they are cheap. Contrast with Java, where you wouldn't want to use exceptions the way you use
62.
▲
by
Chattered
12y ago
Which would be fine if I only ever used "+" with literals. But normally, I write things like x + y where x and y are values I got from who knows where. Javascript shouldn't pretend to figure out what I mean by this, because i
63.
▲
by
Chattered
12y ago
> Alternate logics are interesting, but you tend to be able to reduce them into each other in the same way that universal turing machines can simulate each other. They don't add new functionality, they add succinctness. So it's
64.
▲
by
Chattered
12y ago
I recognise it as the type of continuation returning something of type a. Also, if you instantiate r to Void then ((a -> Void) -> Void) <-> a is just double negation elimination. Am I getting sidetracked or does this line go som
65.
▲
by
Chattered
12y ago
I've sadly lost the logs, but I witnessed a great trolling on #haskell, where someone insisted that Haskell's map function was a for loop because the word "forall" appears in the type. That's the good old style of t
66.
▲
by
Chattered
12y ago
The stupidity of the comparison means that I have no idea what is meant by "threatening." In terms of individual lives, regular homicide is far more threatening than terrorism, as is choking on your next meal. Even ignoring the en
67.
▲
by
Chattered
12y ago
> who calls antibiotic resistance as serious a threat as terrorism What an unbelievably stupid comparison. Terrorism is mass murder turned into the sort of spectacle that causes us to massively overestimate a threat to our individual l
68.
▲
by
Chattered
12y ago
The first programming course we expose students to at Edinburgh has them doing Haskell in Emacs on Scientific Linux. We like steep learning curves, it seems.
69.
▲
by
Chattered
12y ago
Indeed. Consider: Nothing >>= \a -> f a Here, there is no "a" and there never will be, and I could even annotate the type of "a" with something which can never be inhabited (such as Void).
70.
▲
by
Chattered
12y ago
By "imperative state" I mean state for which the ordering of state updates is set by the operational semantics of your language, or the execution model, or the way it ends up implemented on an abstract machine. In the case of Hask
71.
▲
by
Chattered
12y ago
"It appears that in the presence of mutable state, a lot of the advantages of monads become moot." If you have imperative state then toy uses of the state monad might be overkill. But, for example, in a parser, imperative state is
72.
▲
by
Chattered
12y ago
Nothing new. From the OED of 1903: "Now often improperly used to indicate that some hypothetical phrase is to be taken in the strongest admissible sense." Fowler's "Modern English Usage" cites examples going back to
73.
▲
by
Chattered
13y ago
I have no problem with the idea that mathematicians can improve on definitions and make them more natural, especially as they learn more abstraction. And I don't think it was after the fact, or a generalisation of anything, to say that
74.
▲
by
Chattered
13y ago
I'm happier starting with the natural numbers, and just defining m^n as m multiplied by itself n times. Everyone gets that this is the point of exponentiation of natural numbers, and it has the obvious recursive definition: m^0
75.
▲
by
Chattered
13y ago
The given definition only tells you what natural numbers are; it doesn't directly tell you what 0^0 is. For that, the set theoretic definition of exponentiation was provided. That definition is not arbitrary, but is an instance of the
76.
▲
by
Chattered
13y ago
You'll get the program instantly, but writing formal specifications isn't trivial, especially when they have to be machine readable. Consider that there are some problems where the complexity of the coding is mirrored exactly in t
77.
▲
by
Chattered
13y ago
Ah, you want Populous: The Beginning, not the original Populous. The original Populous is a simulation. Populous: The Beginning is a fully 3D real-time strategy game, where you control individual units.
78.
▲
by
Chattered
13y ago
In the days when I had too much time on my hands, I used the editor to pit every combination of monster against each other in the arenas. The balancing was way-off, and monster's fighting abilities are inconsistent with their descripti
79.
▲
by
Chattered
13y ago
I'm pretty sure the D3D versions are included, but by default it fires up DosBox. Good luck getting them to work on the latest windows though. I remember having issues getting them to work even on XP.
80.
▲
by
Chattered
13y ago
And similarly, the list [1,2,3,4] is not a monad, and that's why "flatmappable" isn't a sensible alternative to "monad", as Bracha recently suggested. Though some have argued that this confusion indicates a hol
81.
▲
by
Chattered
13y ago
The function name is repeated because it's recursive!
82.
▲
by
Chattered
13y ago
yield and yield! are both keywords used in sequence expressions. To compute a sequence of type seq<'T>, you can use a sequence expression, in which the yield keyword takes a value of type 'T, and adds that value to the compu
83.
▲
by
Chattered
13y ago
I call code in Haskell's IO imperative . If you are tempted to call it pure functional, read this: http://conal.net/blog/posts/the-c-language-is-purely-functio...
84.
▲
by
Chattered
13y ago
It's always called a "read" error. If you're working at the REPL, it's detected at the Read phase of the Read-Eval-Print-Loop. It is, of course, a read- syntax error. But the fact that the Read phase can be usefull
85.
▲
by
Chattered
13y ago
When writing an S-expression of Lisp code, you're just one quote symbol off writing the list literal that evaluates to the code's parse tree. Modulo whitespace, the parse-tree prints as code. That's what we mean when we say y
86.
▲
by
Chattered
13y ago
That's either backwards or just wrong. Perhaps you're confusing this with the syntax for existentials in data-declarations? I'm really not sure. 'forall x. A x. x' is a type of polymorphic values. Given such a value
87.
▲
by
Chattered
13y ago
You have (Integral a, Num b) => a -> b It's just the function fromIntegral. You don't have the opposite, if, by which, you mean (Num a, Integral b) => a -> b I was talking about giving the same expression
88.
▲
by
Chattered
13y ago
Neither of the types you gave is inhabited, because the 'a' has kind * -> * . I think what you've said about subtyping is muddled. If a type A is a subtype of B, then values of type A should be values of type B. Now let&#x
89.
▲
by
Chattered
13y ago
There might be some confusion. The typical proof of the irrationality of root 2 is phrased as a proof-by-contradiction, and I've come across folk who mistakenly think that this technique is exclusive to classical mathematics. In fact,
90.
▲
by
Chattered
13y ago
You can't create subtype hierarchies in Haskell. Haskell doesn't have any subtyping: every value has exactly one type. This is why you cannot use the OOP solution for the game, which requires lists whose elements have a common sup
More ›