rackettyped-racket

What does `n` mean in Typed Racket?


n shows up at the type level in error messages, what is it?

Example:

(: trick (All (t u) ((U t (Listof u))  -> (Listof u)))) 
(define (trick x)
    (cond
      [(list? x) x]
     )      
)

Error with this n type:

Type Checker: type mismatch
  expected: (Listof u)
  given: (U (Listof u) (∩ (Pairof Any (Listof Any)) t)) in: x

I tried writing a type signature with n in it and using go-to-definition in Dr. Racket, but it says the symbol is not found.


Solution

  • it's not n, it's (intersection).

    Thanks @willness and @molbdnilo.