Types 1

Table of Contents

Why Have Types?

1. How type checker works

(a + b) / c

a : String

b: String

c : Int

  • : string string -> String

/ : int int -> int

X: type error

f(a, b, c)

f: Int, String -> int a : int b : string c : int

X “type error”

f(a,b)

f : Int String -> Int a : Int b : String

returns Int because type checker is highly recursive

So if the return of type check is a type then pass it forward to interp

Date: 2024-11-08 Fri 00:00

Author: Anthony Rossi

Created: 2024-11-19 Tue 19:12