The F# Samples
Links: Up
The samples documented here illustrate the use of F# for
a range of programming tasks related to the .NET platform.
It is currently assumed that you have a basic familiarty with
functional programming. Many of the samples here
explore aspects of programming which are unique to F#.
- The SimpleInterop
sample shows how to call F# from C# and vice-versa.
- The SimpleForm
sample shows how to declare a simple Windows Form.
- The AsyncDelegates
sample shows how to create and execute asynchronous
F# code, to be managed by the .NET Thread Pool.
- The Sockets
sample shows how to write a simple 'echo' server that
will accept multiple client connections via sockets
and simply sends back data to the client.
- The Concurrent Game of Life
sample shows how to write a multi-threaded GUI for
simulation-like computations in F#. It is an
advanced sample that demonstrates some of the powerful
and unique features of F#.
- The DirectX
directory contains a series of basic tutorials for using F#
with the Managed DirectX libraries for 2D and 3D graphics,
sound, music and other exceptionally cool stuff. They were
provided by Jack Palevich.
Tutorial 1 shows
how to create a DirectX device for use with a
Windows form. Tutorial 3 is
a basic introduction to the matricies used to specify 3D scenes.
Tutorial 6 introduces meshes and textures.
Interactive shows one way of using DirectX
with the F# Interactive top level.
- The Parsing
sample shows how to use the fsyacc and fslex tools to
build parsers and lexers for use with F#.
- The TypeFinder
sample shows how call .NET reflection libraries from F#.
- The VideoPlayer
sample shows how to call the Quartz video-playing COM component.
It is now somewhat out of date since it is probably better
to use Managed DirectX (TM) for this sort of thing.
- The now-out-of-date Automation samples
were written to show that it
is possible to use the Microsoft Word and
Excel 'Automation' APIs from F# to script these programs.
We've kept these samples in the distribution though
in truth it is now 100 times easier to use the managed
APIs that are now available for Office.
The old Automation APIs are not strongly-typed and some
fudge-like F# programming was needed to drive them.
Upcoming versions of Microsoft Office will include
strongly types .NET APIs.
- The WinForms
samples will cover common WinForm controls
via small examples.