Top all-time · #3399
Apocalisp
Personal blog · apocalisp.wordpress.comprogramming
Apocalisp is a personal blog at apocalisp.wordpress.com about programming. Since 2008, 23 different Hacker News readers have linked it 24 times, most often “Liskov Substitution Principle is Contravariance (2010)”. The last post was in 2012, but the archive is still widely read.
Too few sampled comments (11) to say how often HN recommends it.?
Why HN links it
HN readers link this blog's posts on type-level programming, Church encoding, and Liskov substitution as technical references for Scala, Haskell, and Java. Most comments cite them as support for their own points.
Summarised by Claude from a sample of 11 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
The end of programming as you know it
Most-linked posts?
- Liskov Substitution Principle is Contravariance (2010)3 people · 3 mentions · first linked 2015-01-22
- Structural Pattern Matching in Java2 people · 3 mentions · first linked 2011-08-24
- Enumeration-Based I/O in Scala using Haskell-style Iteratees 2 people · 2 mentions · first linked 2010-10-17
- Structural Pattern Matching in Java2 people · 2 mentions · first linked 2009-08-22
What Hacker News says?
yes, it can. It ugly, because you're doing type level programming, but is possible http://apocalisp.wordpress.com/2010/06/08/type-level-program...
Comment linking /2010/06/08/type-level-programming-in-scala/
on “Scala – 1 Star – Would Not Program Again”Submitted Imperative vs Functional Programming as a story · 81 points
HN discussionYou can encode them in Scala: http://apocalisp.wordpress.com/2010/07/02/higher-rank-polymo...
Comment linking /2010/07/02/higher-rank-polymorphism-in-scala/
on ““Transducers” by Rich Hickey at Strange Loop [video]”Submitted Arguments in favor of pure functional programming as a story · 32 points
HN discussionWell, Scala has advantages and disadvantages over Haskell, but I wouldn't say it is more "powerful" than Haskell. Consider the implementation of a properly lazy "const" function in Haskell: const x _ = x And in Scala: http://apocalisp.wordpress.com/2010/04/21/a-proper-constant-... Not sure about Coq, but Agda is Turing Complete (you just need to turn off termination checks) and Epigram also supports general recursio…
Comment linking /2010/04/21/a-proper-constant-function-in-scala/
on “True Scala complexity ”Submitted Liskov Substitution Principle is Contravariance (2010) as a story · 3 points
HN discussionI use Church encoding quite a lot in Java for a poor mans pattern matching / ADTs. It's one of the more useful patterns I use. import java.util.function.Function; public abstract class Tree { // Constructor private so the type is sealed. private Tree() {} public abstract <T> T match(Function<Empty, T> a, Function<Leaf, T> b, Function<Node, T> c); public static final class Empty extends Tree { public <T> T match(Func…
Comment linking /2009/08/21/structural-pattern-matching-in-java/
on “The visitor pattern is essentially the same thing as Church encoding”Submitted Heterogeneous Lists and the Limits of the Java Type System (2008) as a story · 3 points
HN discussionSo, Java's HashMap.get() should throw a checked exception whenever the value is not found in the map? That would sure eliminate a lot of boilerplate code :) Aren't exceptions meant to be used for, well, exceptional cases only, i.e. when no matter what, execution really can't be continued? It makes sense for a lot of functions to return some sort of "Nothing" value instead of raising an exception, but the problem is…
Comment linking /2008/05/16/thrower-functor
on “Introduction to monads in JavaScript”Submitted Structural Pattern Matching in Java as a story · 3 points
HN discussionThat is not a simple type. And people who still remember the original Pascal will know that you do not want to encourage people to make the size part of the collection type. And it doesn't buy you much if you cannot prove at compile time that the type you use to index into the collecton cannot overflow the collection bounds. Use Ada if you need that. But if you want you can also encode the sizes in binary or decimal…
Comment linking /2010/06/24/type-level-programming-in-scala-part-5a-binary-numbers/
on “Scala Feels like EJB 2 ”Submitted Structural Pattern Matching in Java as a story · 3 points
HN discussionYes, you can do that by using types indexed by a number. See https://apocalisp.wordpress.com/2010/06/16/type-level-progra... for one take on this.
Comment linking /2010/06/16/type-level-programming-in-scala-part-4a-peano-number-basics/
on “Scala Feels like EJB 2 ”Submitted Structural Pattern Matching in Java as a story · 2 points
HN discussionThis may be a useful pattern to you. The example is in Java but you should be able to achieve the same in Python https://apocalisp.wordpress.com/2009/08/21/structural-patter... . It’ll get rid of the ‘isinstance’ and give exhaustive matching. I used to use this pattern a lot when wanting ADT’s in a language without ADT’’s.
Comment linking /2009/08/21/structural-pattern-matching-in-java/
on “Algebraic Data Types in Haskell”Submitted Enumeration-Based I/O in Scala using Haskell-style Iteratees as a story · 2 points
HN discussionAnd functional programmers would argue that contravariance is the real meaning of Liskov’s substitution principle: https://apocalisp.wordpress.com/2010/10/06/liskov-substituti...
Comment linking /2010/10/06/liskov-substitution-principle-is-contravariance/
on “Liskov Substitution: The real meaning of inheritance”Submitted Liskov Substitution Principle is Contravariance as a story · 1 points
HN discussionapparently LSP is just a contravariant functor https://apocalisp.wordpress.com/2010/10/06/liskov-substituti... But I don't see how the relationship of contravariant functors to OO-style subclasses is as clear as the DI <-> function abstraction example (functions are just functions in OO or FP)
Comment linking /2010/10/06/liskov-substitution-principle-is-contravariance/
on “Why I Don't Teach SOLID”Submitted Objects, Identity, and Concept-Formation as a story · 1 points
HN discussionWhen I get a compiler error in Scala it's almost always something that would cause a runtime error in a non statically typed language. The downside is that the error messages can be difficult to parse and resolve for beginners. Once I got over the learning curve, I realized that in almost all cases the compiler was trying to tell me something very useful. I do get a little annoyed at all the Haskell/OCaml type nerds…
Comment linking /2010/06/16/type-level-programming-in-scala-part-4a-peano-number-basics/
on “Scala is not a better Java”Submitted Towards an Effect System in Scala, Part 2: IO Monad as a story · 1 points
HN discussionSubmitted Enumeration-Based I/O with Iteratees in Scala as a story · 1 points
HN discussionSubmitted Noumenal Null: Null vs. Pure Reason as a story · 1 points
HN discussion