Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #3399

A

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.

Visit the blog
24mentions?
23HN people?
2008–2025first – last linked?
Links on Hacker News per year · peak 7 in 2011

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?

  1. Liskov Substitution Principle is Contravariance (2010)
    3 people · 3 mentions · first linked 2015-01-22
  2. Structural Pattern Matching in Java
    2 people · 3 mentions · first linked 2011-08-24
  3. Enumeration-Based I/O in Scala using Haskell-style Iteratees
    2 people · 2 mentions · first linked 2010-10-17
  4. Structural Pattern Matching in Java
    2 people · 2 mentions · first linked 2009-08-22

What Hacker News says?

  1. 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”
  2. Submitted Imperative vs Functional Programming as a story · 81 points

    HN discussion
  3. You 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]”
  4. Submitted Arguments in favor of pure functional programming as a story · 32 points

    HN discussion
  5. Well, 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 ”
  6. Submitted Liskov Substitution Principle is Contravariance (2010) as a story · 3 points

    HN discussion
  7. I 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”
  8. Submitted Heterogeneous Lists and the Limits of the Java Type System (2008) as a story · 3 points

    HN discussion
  9. So, 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”
  10. Submitted Structural Pattern Matching in Java as a story · 3 points

    HN discussion
  11. That 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 ”
  12. Submitted Structural Pattern Matching in Java as a story · 3 points

    HN discussion
  13. Yes, 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 ”
  14. Submitted Structural Pattern Matching in Java as a story · 2 points

    HN discussion
  15. tiew9Vii · 2022-03-29Recommends
    This 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”
  16. Submitted Enumeration-Based I/O in Scala using Haskell-style Iteratees as a story · 2 points

    HN discussion
  17. And 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”
  18. Submitted Liskov Substitution Principle is Contravariance as a story · 1 points

    HN discussion
  19. apparently 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”
  20. Submitted Objects, Identity, and Concept-Formation as a story · 1 points

    HN discussion
  21. When 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”
  22. Submitted Towards an Effect System in Scala, Part 2: IO Monad as a story · 1 points

    HN discussion
  23. Submitted Enumeration-Based I/O with Iteratees in Scala as a story · 1 points

    HN discussion
  24. Submitted Noumenal Null: Null vs. Pure Reason as a story · 1 points

    HN discussion

Search all of HN for apocalisp.wordpress.com

Linked by the same people?