The hs-dotnet package

[Tags: bsd3, library]

hs-dotnet integrates the .NET platform with Haskell (via GHC.)

It lets you interact with .NET code and libraries, providing full access to .NET objects in a type-safe manner. This also includes parameterized .NET types (generic types), representing them in a manner natural to Haskell.

Dually, Haskell functions can be accessed and called from .NET, hs-dotnet transparently exposing these as delegates for you. Two example uses of this facility are the use of Haskell when programming LINQ and in Windows Forms UIs. Here's how to fire up an example program accessing LINQ:

 c:\haskell> cd examples
 c:\haskell> ghci LinqQuery.hs
 LinqQuery> whereQuery

The package also includes tool support for automatically generating Haskell wrappers and types to .NET classes. The package assumes at least v2.0 of the .NET framework.

More info on package and its features at

[Skip to ReadMe]


Versions0.3.0, 0.3.1, 0.4.0
Change logCHANGES
Dependenciesbase (<3 || >=4), ghc-prim [details]
AuthorSigbjorn Finne <>
MaintainerSigbjorn Finne <>
UploadedSat Apr 18 20:35:18 UTC 2009 by SigbjornFinne
Downloads785 total (21 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-11-13 [all 6 reports]



old-baseOld, monolithic baseDisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainers' corner

For package maintainers and hackage trustees

Readme for hs-dotnet-0.4.0

== hs-dotnet: a pragmatic Haskell .NET interop layer ==

This is the README for hs-dotnet, a package that lets you access
and use .NET code / classes from Haskell (and vice versa..) 
Feel the power!

=== Web page ===

More info on the package, releases, etc can be found at

=== Getting started ===

After having built _and_ installed the Cabal package, you're ready to
go. Have a look in the examples/ directory for some bare-bones

== Generating class wrappers ==

While it is possible to access .NET without taking such a structured
approach, you may choose to generate Haskell wrapper modules for the
.NET-side classes you want to access. Writing these out by hand, and
in a manner that's type-safe, gets tiresome after a while and unncessarily
exposes you to RSI risks, so a tool is provided for this in... tools/

Simply name the class you want to wrap up, possibly along with the -d
flag, and it generates a Haskell module for the class. The tool has
a couple of shortcomings and limitations at the moment, but in most
cases that should give you a workable Haskell module. 

Improvements to wrapper generation is still evolving and expanded to 
make the interface to the .NET world more natural to the Haskell 

=== Installation ===

Installation amounts to building and installing the Cabal package.

Notice that you will have to perform the install step before you are
able to use the package. The reason being that the supporting .NET
assembly (and accompanying COM classes) needs to be installed(GACed)
and published first. 

You may manually do this step by running 'gacInstaller' on HsInvoker.dll
and 'regasm' on same.