Reputation
3,305
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
12 18
Newest
 Enlightened
Impact
~246k people reached

May
31
awarded  Nice Answer
May
30
comment Maybe monad vs exceptions
Also, regarding (1): you could easily write a monad that can carry error information (e.g. Either) that behaves just like Maybe. Switching between the two is actually rather simple because Maybe is really just a special case of Either. (In Haskell, you could think of Maybe as Either ().)
May
30
answered Maybe monad vs exceptions
May
30
comment Maybe monad vs exceptions
@Oak: that's true, but that wasn't really my point. What I'm saying is that you get null checking exactly like that (e.g. if Nothing then Nothing) for free because Maybe is a monad. It's encoded in the definition of bind (>>=) for Maybe.
May
30
comment Maybe monad vs exceptions
@Oak: Regarding (3), the whole point of treating Maybe as a monad is to make the propagating None implicit. This means that if you want to return None given None, you do not have to write any special code at all. The only time you need to match is if you want to do something special on None. You never need if None then None sort of statements.
May
30
comment Why is the “kill” command called so?
To be entirely fair, the difference between moving and renaming a file is rather arbitrary. "Renaming" a file is just moving it to a different location which happens to be in the same directory.
May
19
revised Why isn't rich code formatting more common?
edited body
Apr
19
comment Do real-world algorithms that greatly outperform in the class below exist?
I think it's also partly historical--the algorithm for turning a regular expression into a DFA was patented when some of the earlier tools (sed and grep, I guess) were being developed. Of course I heard this from my compilers professor who wasn't entirely sure, so this is a third-hand account.
Apr
19
comment Should a new programmer focus on a single technology until he's proficient at it?
This is why I think SICP is the perfect introductory text--it covers a bunch of different ideologies in a uniform manner; you get to reuse syntax (sexps) and concepts while learning about functional programming, OOP, logic programming and even low-level register-based programming.
Apr
11
comment What are some characteristics of Python that makes it unique as its own language?
If you think Python has low syntactic overhead (despite having an obscenely complicated grammar and a relatively large amount of syntax sugar), what do you think of Scheme?
Apr
11
comment How were some language communities (eg, Ruby and Python) able to prevent fragmentation while others (eg, Lisp or ML) were not?
@root45: Don't Python libraries fail to work on alternative implementations (e.g. PyPy) with reckless abandon?
Mar
22
answered What do you use macros in your editor for?
Mar
22
comment Why was Tanenbaum wrong in the Tanenbaum-Torvalds debates?
@MasonWheeler: Of course. Anybody can pick up Ubuntu and use it with no command line stuff at all. My roommate--certainly not super tech literate--had no problems moving from Windows to Ubuntu. Other people I know using Ubuntu--varying in experience but all not experts--have not had any problems either. My old roommate last year had more problems with his Mac than my current roommate does with Ubuntu, at similar levels of computer experience. (Even printing, of all things, was easier by far on Linux than on the Mac!) So the whole Linux command line thing is a gross misrepresentation.
Mar
17
comment Are operators clearer to read than keywords or functions?
Well, Haskell lets you define arbitrary operators and set their precedence and associativity. The difference is that you can't overload operators per se--they behave like normal functions. This means you can't have different libraries trying to use the same operator for different things. Since you can define your own operator, there's much less reason to reuse the same ones for different things.
Mar
16
comment Are operators clearer to read than keywords or functions?
If users can add operators, why not let them set the precedence and associativity of the operators they've added?
Mar
16
comment Are operators clearer to read than keywords or functions?
@comingstorm: I actually think the Haskell way is better. When you have a finite set of operators that you can overload in different ways, you're often forced to reuse operators in different contexts (e.g. + for string concatenation or << for streams). With Haskell, on the other hand, an operator is either just a function with a custom name (that is, not overloaded) or part of a type class which means that while it's polymorphic, it does the same logical thing for every type, and even has the same type signature. So >> is >> for every type and is never going to be a bit shift.
Mar
16
comment How to write functionally in a web framework
I'm not quite sure what you mean by saying that the problems tackled by imperative programmers are "harder". I'm sure the sort of problems people working at banks or on GHC solve are as difficult as any.
Mar
15
comment Are operators clearer to read than keywords or functions?
I think | (and, by extension, ||) for or makes sense. You also see it all the time for alternation in other contexts, like grammars, and it looks like it's splitting two options.
Mar
15
comment How to learn Math to increase Programming skills?
SICP is really, really brilliant. I heartily second your recommendation.
Mar
15
answered Resources for learning common algorithms by Lisp