plt/racket — pull request #535 by takikawa (2014-01-07 22:25:51+00:00)
Title: TR: prefix arrows and ->* types

This PR adds two related things.

First, it adds support for prefix `->` types.

Second, it adds a prefix `->*` type constructor for writing functions with optional argument types. This uses the syntax of the `->*` contract combinator.

Related to 2, this also adds support for printing functions that are recognizable as a `->*` type (whether they were written that way originally or not) and prints them appropriately. This makes the printed type for `regexp-match?` change from this:

````
(case-> ((U Byte-Regexp Regexp Bytes String) (U Path-String Bytes Input-Port) Integer (U Integer False) (U False Output-Port) Bytes -> Boolean) ((U Byte-Regexp Regexp Bytes String) (U Path-String Bytes Input-Port) Integer (U Integer False) (U False Output-Port) -> Boolean) ((U Byte-Regexp Regexp Bytes String) (U Path-String Bytes Input-Port) Integer (U Integer False) -> Boolean) ((U Byte-Regexp Regexp Bytes String) (U Path-String Bytes Input-Port) Integer -> Boolean)
````

to this:

````
(->* ((U Byte-Regexp Regexp String Bytes) (U Path-String Bytes Input-Port)) Integer (U Integer False) (U False Output-Port) Bytes Boolean)
````

Note: I haven't added any documentation because I thought this change might be controversial. I'll obviously add docs if it's accepted, though there's a question of if prefix should be preferred or not. Also, I haven't added any tests for the printing behavior because there are no printing unit tests. I'll add them once the new printer PR is merged, because it also adds unit tests.