7.7.0.7
3 Libraries Provided With Typed Racket
The typed/racket language corresponds to the
racket language—that is, any identifier provided
by racket, such as modulo, is available by default in
typed/racket.
The typed/racket/base language corresponds to the
racket/base language.
Some libraries have counterparts in the typed
collection, which provide the same exports as the untyped versions.
Such libraries include srfi/14,
net/url, and many others.
Other libraries can be used with Typed Racket via
require/typed.
The following libraries are included with Typed Racket in the
typed collection:
Describe a GIF stream, as produced by
gif-start
and accepted by the other functions from
file/gif.
Type alias for a list of three-element (R,G,B) vectors representing an image.
Unlike the untyped json library,
typed/json always uses 'null
to represent the JSON “null” value.
The functions exported by typed/json
do not accept a #:null argument, and they
are not sensitive to the current value of the json-null parameter.
The json-null binding itself is not
exported by typed/json.
Describes a
jsexpr,
where
'null is always used to represent the JSON “null” value.
Added in version 1.10 of package typed-racket-lib.
Added in version 1.10 of package typed-racket-lib.
NOTE: This library is deprecated; use typed/net/cookies, instead. This library is deprecated for the same reasons
that net/cookie is deprecated.
Describes an open FTP connection.
Describes an HTTP connection, corresponding to
http-conn?.
Describes an IMAP connection.
Describes exceptions raised by URL-related functions; corresponds
to
url-exception?.
Like PortT, but describes the functions that make POST and PUT
requests, which require an additional byte-string argument for POST or PUT
data.
Describes an SSL protocol, defined as
(U 'auto 'sslv2-or-v3 'sslv2 'sslv3 'tls 'tls11 'tls12).
Describes an OpenSSL server or client context.
Supertype of OpenSSL server and client contexts.
Describes an SSL listener, as produced by
ssl-listen.
Added in version 1.1 of package typed-racket-lib.
(for/extflvector type-ann-maybe (for-clause ...) expr ...+)
|
|
(for*/extflvector type-ann-maybe (for-clause ...) expr ...+)
|
|
(for/flvector type-ann-maybe (for-clause ...) expr ...+)
|
|
(for*/flvector type-ann-maybe (for-clause ...) expr ...+)
|
|
Added in version 1.5 of package typed-racket-lib.
Describes a character set usable by the
srfi/14 functions.
Describes a cursor for iterating over character sets.
Describes an SRFI 19 time or date structure.
Changed in version 1.10 of package typed-racket-lib: Updated to reflect web-server/http
version 1.3.
Changed in version 1.11: Updated to reflect web-server/http
version 1.4.
Changed in version 1.13: Updated to reflect web-server/http
version 1.6.
In some cases, these typed adapters may not contain all of exports of the
original module, or their types may be more limited.
Other libraries included in the main distribution that are either
written in Typed Racket or have adapter modules that are typed:
3.1 Porting Untyped Modules to Typed Racket
To adapt a Racket library not included with Typed Racket, the
following steps are required:
Determine the data manipulated by the library, and how it will
be represented in Typed Racket.
Specify that data in Typed Racket, using require/typed
and #:opaque and/or #:struct.
Use the data types to import the various functions and constants
of the library.
Provide all the relevant identifiers from the new adapter module.
For example, the following module adapts the untyped
racket/bool library:
More substantial examples are available in the typed
collection.