This library provides a more convenient syntax for writing typed racket polymorphic and curried functions. It is very similar to Haskell type annotations.
source code: https://github.com/jackfirth/compact-annotations
Declares that id has the type determined by function-type, which may be a parametric type over type-var-id ... if provided. The syntax of function-type allows for partially applied function types, optional argument types, and rest argument types.
With this syntax, the type of the identity function can be defined as follows:
A function that takes one value and returns a function that takes another value and ignores it, returning the first value can have it’s type defined as follows:
Optional arguments can have their type specified with a +. For example, a function that greets people with "Hello" by default can have it’s type defined as follows:
Rest arguments can also have their type specified with a *. A function that converts it’s arguments from one type to String then appends them all can have its type specified as follows: