Haskell API

A Haskell API is provided to allow you to embed a Scheme interpreter within a Haskell program. The key API modules are:

There are a few things to be aware of when developing using the API regarding the Pointer type:
  • A pointer is an object that references a String variable name within an environment Env. In general you do not need to worry about pointers, but you need to be aware that they exist.
  • The Language.Scheme.Variables module contains functions that can be used to dereference pointers.
  • Functions should usually be defined using the CustFunc type. This allows you to write your own Haskell functions without worrying about pointers. But this does introduce some overhead as the Husk interpreter will automatically attempt to dereference any pointers in objects passed to your custom Haskell function.

The full API documentation is available online. You may also run make doc to generate API documentation directly from the source code.

Finally, see shell.hs in the husk source code for a quick example of how you might get started using the API.

husk-scheme online documentation rev 3.2 (2021.03.04)