Philip JF
Reputation
1,301
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
7 10
Newest
Impact
~41k people reached

• 0 posts edited
• 0 helpful flags
• 34 votes cast

# 13 Comments

 Jun 15 comment What's the difference between recursion and corecursion? @tathanhdinh Because omega is defined to be Succ(omega) so if Succ(y) = omega then Succ(y) = Succ(omega) and y = omega. The last step is admittedly a bit sketchy without fleshing out your foundations and formalizing the definition. Jun 14 comment What's the difference between recursion and corecursion? This is all a bit of lie since ocaml has value recursion I really should have used SML which is the only "mainstream"-ish language that supports inductive reasoning. Jun 14 comment What's the difference between recursion and corecursion? the goal is to show omega is not in nat. We do this by contradiction. If omega were in nat than the set N = nat - {omega} would satisfy the laws. That is because nat satisfies the laws. If y in N, 1. y is not omega and 2. y in nat. From 2 we know Succ(y) in nat, and by 1 y is not omega Succ(y) is not omega. Thus Succ(y) in N. N also includes zero. But, N is smaller than nat. This is a contradiction. Thus, nat does not include omega. Feb 5 comment Who first coined the term Higher Order Function and/or First Class Citizen? "Higher order functions" exist in the work of Frege (functions taking functions as arguments for example), far predating Church's foundational work on the lambda calculus. A predicate in classical first oder logic is exactly a boolean valued function, so I second sclv's suggestion that this may be the source of the terminology. Jan 4 comment Why aren't user-defined operators more common? In Haskell, parsing is "easy" (compared to most languages). Precedence is context independent. The part that gives you hard error messages is related to typeclass and advanced type system features, not to user defined operators. It is overloading, not user definition, that is the hard problem. Dec 31 comment Why aren't user-defined operators more common? every single one of these problems has been solved in languages that have existed for 20 years... Aug 27 comment Scheme vs Haskell for an Introduction to Functional Programming? @alternative parsec has a Monadic interface, but it also has an Applicative interface, not to mention numerous other functions. It isn't that unreasonable to introduce Parsec before the monadic generalization Aug 4 comment What backs up the claim that C++ can be faster than a JVM or CLR with JIT? @gbjbaanb GC with finalizers is substantially different (and slower) than GC without at least on the JVM. Modern tracing GCs (without finalizers) tend to provide better performance than malloc and free most of the time since 1. memory is allocated by increasing a pointer (no data structure traversals) 2. less overhead from management strategies like reference counting 3. you only ever "free" giant blocks of memory. This is to say, you have to work hard to get the performance boost from C++ and even in the best of cases it mostly is from having less indirection. Jul 22 comment Getting non-programmers to understand the development process -1 @ThorbjørnRavnAndersen is correct. This post is wrong. It is very possible to prove programs correct (up to a certain notion of correctness), some of us do it all the time. I think the poster misunderstands the epistemological consequence of the halting problem, and is thus confusing non-programmers with untrue claims. Jun 4 comment Is there a language where collections can be used as objects without altering the behavior? have you ever met the list monad? Apr 14 comment What's the difference between recursion and corecursion? @user1131997 Thanks. I'm planning on translating some of the code into Java, stay tuned Sep 4 comment Is return-type-(only)-polymorphism in Haskell a good thing? @Jörg W Mittag It's not totally irrelevant. I've edited to adress your comment. Sep 4 comment Is return-type-(only)-polymorphism in Haskell a good thing? @ysdx Thats true. And in languages that support implicit parameters you get something very close to haskell's type classes (like in Scala). I was aware of that. My point though was that this makes life pretty difficult: I find myself having to use containers that store the "typeclass" all over the place (yuck!). Still, I probably should have been less hyperbolic in my answer.