News for hackers. Stuff that matters.
Re:Six years of professional Clojure development by Blikkentrekker on Thursday May 06, 2021 @06:44AM (#27061328)
Typed Racket actually has a rather marvelous type system.

The following is fine therein and statically type checks:

    (let ([x (if (condition) "string" (list "a list"))])
      (if (string? x)
        (string-length? x)
        (length? x)))
By process of elimination, because the type of the variable is `(U string? (List-of string?))`, the type checker can prove that if `(string? x)~ be false, the type of `x` must be `list?`, and that `(length x)` succeeds.

There are no comments on this comment yet.