Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tmhedberg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
61.
▲
by
tmhedberg
14y ago
What if an ioctl is trying to indicate that a certain "entry" is not valid or available? I don't understand the question. It is not possible for ioctl to be called on a valid, open file descriptor that represents a file that is not valid
62.
▲
by
tmhedberg
14y ago
ENOENT isn't a new error code. It's the standard errno value that indicates an attempt to access a nonexistent file or directory on all POSIX platforms. The problem is that it was being misappropriated in a nonsensical way, returned by an i
63.
▲
by
tmhedberg
14y ago
Who is arguing that the monad as a means of composition is superior to all others? Or that Haskell doesn't emphasize the power of composition of high-order functions? Function composition is one of the most important tools in a Haskell prog
64.
▲
by
tmhedberg
14y ago
For what it's worth, I would suggest just writing code as a means of building your intuition. Don't worry about understanding every last detail; just hack away at it and intuition will come as a natural consequence of your persistence. At l
65.
▲
by
tmhedberg
14y ago
Alternatively, we replaced some easy to follow procedural code with a manual, verbose, and error-prone abstraction. I have no idea what is going on with the author's decorated classes, generators, etc. It's complicated and fairly ugly to
66.
▲
by
tmhedberg
14y ago
Looks good, thanks. :)
67.
▲
by
tmhedberg
14y ago
Just for fun, I translated it to Haskell: https://gist.github.com/4105055
68.
▲
by
tmhedberg
14y ago
Couldn't they just mix all the colors together in roughly equal proportions (by weight, for instance) before packaging them into packets, and just rely on the statistical improbability of a noticeable imbalance in colors? I doubt there is a
69.
▲
by
tmhedberg
14y ago
Why would you do this instead of declaring it as `int main(void)`?
70.
▲
by
tmhedberg
14y ago
Since Citi would never allow marketing company run their tracking service on citi.com and since users won't be eager to click on n23uiahsf8das9fda.somethingelse.com link, they don't have much choice. They do have a choice. They could choo
71.
▲
by
tmhedberg
14y ago
Maybe is a monad, which means Maybe computations can be chained together with `>>=` (or using `do` notation) without checking for `Nothing`. You can easily produce a large composition of potentially-failing computations while comple
72.
▲
by
tmhedberg
14y ago
I don't know much category theory either; my argument is based solely on my knowledge of Haskell. Maybe I'm being obtuse, but I don't quite understand what you mean when you say "mconcat with a map". But to see why mconcat isn't as general
73.
▲
by
tmhedberg
14y ago
If __add__ is taken to be any associative operation of a monoid, then Python's sum is merely equivalent to Haskell's mconcat, which is not nearly as general as reduce/foldl. Plus, unless you implement something akin to newtype wrappers for
74.
▲
Linus Torvalds Answers Your Questions
(meta.slashdot.org)
228 points
by
tmhedberg
14y ago
|
131 comments
75.
▲
by
tmhedberg
14y ago
Why do I get prompted to enter a commit message when I'm just doing a git pull? Because `git pull` == `git fetch` + `git merge`. If there are upstream commits you are fetching that are not ancestors of your head commit, then pulling invol
76.
▲
by
tmhedberg
14y ago
Pretty much any question about why things are done a particular way in Unix can be answered the same way: "for historical reasons". I'm a full-time Linux user, so that's not intended as a dig against Unix, but merely an observation. Each of
77.
▲
by
tmhedberg
14y ago
As when Knuth stopped releasing new versions of TeX because it reached a point where it was "done", software that has been around for long enough can eventually mature to the point where there's nothing left to add without expanding the sco
78.
▲
by
tmhedberg
14y ago
GHC will warn about partial functions/inexhaustive patterns if you compile with -Wall (or even just -fwarn-incomplete-patterns, but -Wall is recommended). I've often wondered if it would be feasible to eliminate the partial functions from t
79.
▲
by
tmhedberg
14y ago
I'm not sure what you mean by "FP isn't meant to tie two huge, horrible systems together". Is any language or programming paradigm really designed with that usage in mind? But assuming that that is in fact the case, I wonder whether it woul
80.
▲
by
tmhedberg
14y ago
Did I suggest that it was a function? If so, I didn't intend to.
81.
▲
by
tmhedberg
14y ago
I suppose that, in my personal experience, I just haven't written a lot of Haskell code that used multiple similar record types in the same namespace. I don't have any evidence for this, but I feel like it's often a bit of a code smell when
82.
▲
by
tmhedberg
14y ago
Also one thing that always gave me pause about Haskell was the record system, and the inability to have fields with the same name in the same module (especially when the fields are generated from a database). Has there been any progress on
83.
▲
by
tmhedberg
14y ago
Every new GHC release is like a little Christmas morning! The pace of new feature development impresses me. I'm particularly interested in the new type-level literals (which seem like they will make it much less cumbersome to express certai
84.
▲
by
tmhedberg
14y ago
I don't really understand the fuss about the Python thing. `#!/usr/bin/python2` should work on pretty much any system, not just an Arch Linux system. Whatever happened to "explicit is better than implicit"? If the Python community eventuall
85.
▲
by
tmhedberg
14y ago
Among other things, he managed to land Eagle with only seconds of fuel remaining, having manually maneuvered it to an alternative landing site after the computer had navigated to a primarly landing area covered with boulders. All this whi
86.
▲
by
tmhedberg
14y ago
I'm curious what sorts of things you have in mind when you refer to "pieces [of Haskell code] that require superhuman effort to type correctly"? In my own Haskell experience, except when playing with silly and mostly pointless tricks like d
87.
▲
by
tmhedberg
14y ago
The (* >) operator [1] (the space in the middle is just to circumvent HN's rather dumb comment formatting) sequences its two arguments, ignoring the one on the left. So string "0x" *> takeWhile1 hexadecimal parses a literal
88.
▲
by
tmhedberg
14y ago
Have you tried Learn You a Haskell for Great Good ( http://learnyouahaskell.com/ )? It's not as comprehensive or full of practical examples as something like RWH , but as an introductory text, I think it does a better job than any other
89.
▲
by
tmhedberg
14y ago
In fact, with compiler optimizations such as GHC's stream fusion, the intermediate result may never actually exist at all.
90.
▲
by
tmhedberg
14y ago
I concede on the pseudocode formatting point. Upon rereading, that is uglier than necessary. The trouble with exceptions is that, unless you're referring to Java-style checked exceptions, there's nothing that forces you to handle them. You
More ›