Suzanne Soy <racket@suzanne.soy>
This library is implemented using literate programming. The implementation details are presented in the following sections. The user documentation is in the Type expander library document.
1Implementation of the type expander library
1.1Introduction
1.2Expansion model for type expanders
1.2.1Comparison with TeX’s macro expansion model
1.2.2Interactions between type expanders and scopes
1.3The prop:type-expander structure type property
1.3.1The type-expander struct
1.4Associating type expanders to identifiers
1.4.1The type-expander syntax class
1.4.2Calling type expanders
1.4.3Associating type expanders to already existing identifiers
1.4.4Defining new type expanders
1.4.5Locally binding type expanders
1.5Expanding types
1.5.1Cases handled by expand-type
1.5.2Applying type expanders
1.5.2.1Polymorphic types with ∀
1.5.2.2Recursive types with Rec
1.5.2.3Local bindings with Let and Letrec
1.5.2.4Anonymous types with Λ
1.5.2.5Preventing the expansion of types with No-Expand
1.5.2.6The overloaded : identifier
1.5.2.7Last resort cases: leaving the type unchanged
1.5.3Debugging type expanders
1.6Overloading typed/racket forms
1.6.1syntax classes
1.6.2Overview of the overloaded primitives
1.6.3:
1.6.4define-type
1.6.5define
1.6.6lambda
1.6.7case-lambda
1.6.8struct
1.6.9define-struct/exec
1.6.10ann
1.6.11cast
1.6.12unsafe-cast
1.6.13inst
1.6.14row-inst
1.6.15let
1.6.16let*
1.6.17let-values
1.6.18make-predicate
1.6.19:type, :print-type, :query-type/args, :query-type/result
1.6.20Type expanders for the typed classes
1.6.21Other typed/racket forms
1.7Future work
1.8Conclusion
2Some example type expanders
2.1Example type expanders: quasiquote and quasisyntax
2.2Implementation of the Let* special type expander form
2.3curry
2.4Putting it all together
AltStyle γ«γγ£γ¦ε€ζγγγγγΌγΈ (->γͺγͺγΈγγ«) / γ’γγ¬γΉ: γ’γΌγ: γγγ©γ«γ ι³ε£°γγ©γ¦γΆ γ«γδ»γ ι θ²εθ»’ ζεζ‘ε€§ γ’γγ€γ«