Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
asQuirreL
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
asQuirreL
10y ago
Yes, there are, but in my opinion, for it to be a circular buffer, it should wrap the end of the data back round to the front when the end of the queue reaches the end of the buffer. Inserting 4 into: [x, x, x, 1, 2, 3] Produces:
62.
▲
by
asQuirreL
10y ago
I don't think this is a circular buffer. The strategy here is to shift the data inside the buffer to the middle once either the front or back pointer are at the front/end of the buffer respectively, rather than to wrap around. My
63.
▲
by
asQuirreL
10y ago
I wrote a full implementation of this version in Haskell as part of my dissertation [0]. I'm linking to a specific commit because in the coming month, I will be modifying it to introduce structural type inference (so that what would ty
64.
▲
by
asQuirreL
10y ago
I would argue that the whole point of having a type class is the laws. It allows the programmer to assume certain properties are true that the type checker cannot verify. Just because the language lets you write an instance that does not co
65.
▲
by
asQuirreL
11y ago
In a dependently typed language, types may rely upon arbitrary terms that are computed at runtime, and yet you are correct that dependently typed programs are checked statically. The way this is achieved is if a property can only be checked
66.
▲
by
asQuirreL
11y ago
Some types are not (and cannot) be enforced at compile time [0]. In fact what makes something a type is not something internal to the type, but its participation in a larger type system or type theory, so in that sense, almost any abstract
67.
▲
by
asQuirreL
11y ago
Any day in which you can say this, is a good day.
68.
▲
by
asQuirreL
11y ago
This of course assumes the candidate knows the answer to the question they asked, which is something the interviewer can't verify because they also don't know.
69.
▲
by
asQuirreL
11y ago
This is an interesting point, and one I've seen from the other side as well: When leaving secondary (high) school, for university, a common piece of advice is: "You may have been one of the smartest people here, but be careful, yo
70.
▲
by
asQuirreL
11y ago
I'm a bit dubious about your sweeping generalisation that "most mathematicians haven't don't any logic". I also agree with GP that logic also does not deal with absolute truth. Proofs in formal logic may be applied
71.
▲
by
asQuirreL
11y ago
Nice explanation! I believe the short-circuited open `sum` function will evaluate to `1`, though.
72.
▲
by
asQuirreL
11y ago
Well, I would say it exposes a flaw in your interface, which would have given the function access to more information than it required. You know it's fine because you are aware of implementation details, but rust is telling you that yo
73.
▲
by
asQuirreL
11y ago
Not in figures, but a graph was given in the article that shows the sample distribution.
74.
▲
by
asQuirreL
11y ago
It is possible that some people teach for the enjoyment and gratification of it. Some of my lecturers are excellent programmers. Good programming skills are not necessary to teach CS, but that does not imply that teaching CS is a sufficient
75.
▲
by
asQuirreL
11y ago
Couldn't reply to the child post, so I'm putting it here: Yes it is true that if a company helps but does not entirely solve a problem, they are not obligated to stick it out. But in this case it may be that they are not helping b
76.
▲
by
asQuirreL
11y ago
On a similar theme, this year there is a conference called Wadlerfest [1] running in Edinburgh in honour of Phil Wadler's 60th birthday. [1] http://events.inf.ed.ac.uk/wf2016/
77.
▲
by
asQuirreL
11y ago
> Cool. I’m glad to see Pascal has adopted Rust’s approach of putting the type last, so you can actually see at a glance what the variable names are. I'm guessing (hoping) this is irony...
78.
▲
by
asQuirreL
11y ago
It is an imaginary machine, intended to have restrictions that most real hardware wouldn't have (like not being able to access the BAK register directly), but the aim of this is to make the game more of a challenge, and thus more fun.
79.
▲
by
asQuirreL
11y ago
> Well, computer "science" is primarily an engineering discipline. I would say that software engineering was the engineering discipline, and computer science a mathematical discipline. My point was that the proof itself is not
80.
▲
by
asQuirreL
11y ago
I prove mathematical properties purely for the sake of proving them. The fact that they have any bearing on the real world is a mildly interesting diversion. Given this frame of reference, empirical evidence almost never enters the picture
81.
▲
by
asQuirreL
11y ago
I feel like the analogy would be "writing mathematical proofs without writing down any of the propositions" (And indeed, the Curry-Howard correspondence lends credence to this). Writing down types for programs is not just useful b
82.
▲
by
asQuirreL
11y ago
A lot of the observations in this article are very interesting, but personally, I drew different conclusions. The first one is the main thesis of the post which is that some people have an innate ability to program that others do not posses
83.
▲
Automatically Applying HLint Suggestions
(mpickering.github.io)
18 points
by
asQuirreL
11y ago
|
2 comments
84.
▲
by
asQuirreL
11y ago
Oh yeah, I totally agree, the examples for the IO monad match up very well to what can be done with Promises. My point was more that this is the case because the IO monad is the canonical black box monad: All you can do with it stems from i
85.
▲
by
asQuirreL
11y ago
Not sure promises are equivalent to the IO monad in particular. They could form a Monad instance, although that is not the interface they have chosen to expose. It does seem it would be more similar to the `Either` monad, however.
86.
▲
by
asQuirreL
11y ago
But not into a register right? Given my (flawed) assumption that there would be two reads, whilst the first might load the second into the cache, it wouldn't load into a register without another instruction telling it to. This costs a
87.
▲
by
asQuirreL
11y ago
Also worth noting that storing them in a long probably means 2 memory reads per access on most modern architectures, whereas storing them in bitfields will allow the compiler to select the containing CPU word, which will be 1 read. I would
88.
▲
by
asQuirreL
11y ago
Some notes about using sets to represent types: Firstly the symbol you are using for "subset of" is in fact the symbol for " strict subset of". This means you are saying that when C : A + B there is some value that impl
89.
▲
by
asQuirreL
11y ago
Imagine oneself playing a game of Simon Says, where we don't know who Simon is or which bits he's actually saying, he in fact sounds exactly like everyone else giving us instructions: we can choose to believe what we want about th
90.
▲
by
asQuirreL
11y ago
From a Computational Learning Theory perspective, we are faced with an infinite hypothesis space, with an infinite VC dimension. So yes, there's not much strategy that can be employed here. But, the fact that there is one correct answe
More ›