Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 299 Bytes

Polymorphism.md

File metadata and controls

24 lines (16 loc) · 299 Bytes

Polymorphism

Polymorphic functions

(: id : (All (A) (A -> A)))
(define (id x) x)

Polymorphic structures

(struct: Pare (X) ([left : X] [right : X]))

Polymorphic types

(define-type (Lst T) (Rec L (U Null (Cons T L))))

Variable-arity polymorphism

> map